Closed
Bug 611930
Opened 14 years ago
Closed 14 years ago
Crashreporter should provide information on installed LSPs.
Categories
(Core :: Networking, defect)
Tracking
()
RESOLVED
FIXED
mozilla2.0b8
Tracking | Status | |
---|---|---|
blocking2.0 | --- | beta8+ |
People
(Reporter: khuey, Assigned: khuey)
References
()
Details
Attachments
(1 file)
9.14 KB,
patch
|
ted
:
review+
robert.strong.bugs
:
superreview+
|
Details | Diff | Splinter Review |
See the URL for an example of a crashreport. I'm open to suggestions about what data is worth capturing and what format we should print in.
Attachment #490328 -
Flags: superreview?
Attachment #490328 -
Flags: review?(ted.mielczarek)
Assignee | ||
Updated•14 years ago
|
Attachment #490328 -
Flags: superreview? → superreview?(robert.bugzilla)
Assignee | ||
Updated•14 years ago
|
blocking2.0: --- → ?
+ * Kyle Huey <me@kylehuey.com missing > but please land this :)
Comment 2•14 years ago
|
||
Could we get this for beta8? Freeze is Monday, and I think this would help us understand a big portion of our present crashiness. Which is good to know ASAP. :)
Comment 3•14 years ago
|
||
Comment on attachment 490328 [details] [diff] [review] Patch >diff --git a/widget/src/windows/LSPAnnotator.cpp b/widget/src/windows/LSPAnnotator.cpp >new file mode 100644 >--- /dev/null >+++ b/widget/src/windows/LSPAnnotator.cpp >+void >+LSPAnnotationGatherer::Annotate() >+{ >+ nsCOMPtr<nsICrashReporter> cr = >+ do_GetService("@mozilla.org/toolkit/crash-reporter;1"); >+ PRBool enabled; >+ if (cr && NS_SUCCEEDED(cr->GetEnabled(&enabled)) && enabled) { >+ cr->AnnotateCrashReport(NS_LITERAL_CSTRING("LSPs"), mString); LSPs doesn't sound descriptive enough. Maybe Winsock_LSP or something? >+ nsCString note; >+ note.AppendLiteral("LSPs: "); nsCString note = NS_LITERAL_CSTRING("LSPs: "); ? >+ note.Append(mString); >+ cr->AppendAppNotesToCrashReport(mString); Please file a bug on having Socorro display the LSP field, and put a comment here with the bug number, so we can remove this from the App Notes bit once that's fixed. >+ nsCString str; >+ for (int i = 0; i < n; i++) { >+ AppendUTF16toUTF8(nsDependentString(providers[i].szProtocol), str); >+ str.AppendLiteral(" : "); >+ str.AppendInt(providers[i].iVersion); >+ str.AppendLiteral(" : "); >+ str.AppendInt(providers[i].iSocketType); >+ >+ wchar_t path[MAX_PATH]; >+ int dummy; >+ if (!WSCGetProviderPath(&providers[i].ProviderId, path, >+ &dummy, &err)) { >+ AppendUTF16toUTF8(nsDependentString(path), str); >+ } >+ >+ if (i + 1 != n) { >+ str.AppendLiteral(" ; "); I'd stick a newline in here instead to make this more readable.
Attachment #490328 -
Flags: review?(ted.mielczarek) → review+
![]() |
||
Comment 5•14 years ago
|
||
Comment on attachment 490328 [details] [diff] [review] Patch Awesome!
Attachment #490328 -
Flags: superreview?(robert.bugzilla) → superreview+
![]() |
||
Comment 6•14 years ago
|
||
Comment on attachment 490328 [details] [diff] [review] Patch >diff --git a/widget/src/windows/LSPAnnotator.cpp b/widget/src/windows/LSPAnnotator.cpp >new file mode 100644 >--- /dev/null >+++ b/widget/src/windows/LSPAnnotator.cpp >... >+NS_IMETHODIMP >+LSPAnnotationGatherer::Run() >+{ >+ mThread = NS_GetCurrentThread(); >+ >+ DWORD size = 0; >+ int err; >+ if (SOCKET_ERROR != WSCEnumProtocols(NULL, NULL, &size, &err) || >+ err != WSAENOBUFS) { >+ // Er, what? nit: would be nice if the comment mentioned that this call is just to get size. >+ NS_NOTREACHED("WSCEnumProtocols should always fail here ..."); "should always fail here" seems wrong to me >+ return NS_ERROR_FAILURE; >+ } >+ >+ nsAutoPtr<char> byteArray = new char[size]; >+ WSAPROTOCOL_INFO* providers = >+ reinterpret_cast<WSAPROTOCOL_INFO*>(byteArray.get()); >+ >+ int n = WSCEnumProtocols(NULL, providers, &size, &err); >+ if (n == SOCKET_ERROR) { >+ // Lame nit: better comment as well stating why this should not fail Might be a good thing to have Jim take a look at this as well
Attachment #490328 -
Flags: review?(jmathies)
Assignee | ||
Comment 7•14 years ago
|
||
(In reply to comment #6) > Comment on attachment 490328 [details] [diff] [review] > Patch > > >diff --git a/widget/src/windows/LSPAnnotator.cpp b/widget/src/windows/LSPAnnotator.cpp > >new file mode 100644 > >--- /dev/null > >+++ b/widget/src/windows/LSPAnnotator.cpp > >... > >+NS_IMETHODIMP > >+LSPAnnotationGatherer::Run() > >+{ > >+ mThread = NS_GetCurrentThread(); > >+ > >+ DWORD size = 0; > >+ int err; > >+ if (SOCKET_ERROR != WSCEnumProtocols(NULL, NULL, &size, &err) || > >+ err != WSAENOBUFS) { > >+ // Er, what? > nit: would be nice if the comment mentioned that this call is just to get size. OK > > >+ NS_NOTREACHED("WSCEnumProtocols should always fail here ..."); > "should always fail here" seems wrong to me Passing in a 0 length buffer should always fail (unless, I suppose, the user has 0 LSPs, but Windows ships with built in LSPs). > >+ return NS_ERROR_FAILURE; > >+ } > >+ > >+ nsAutoPtr<char> byteArray = new char[size]; > >+ WSAPROTOCOL_INFO* providers = > >+ reinterpret_cast<WSAPROTOCOL_INFO*>(byteArray.get()); > >+ > >+ int n = WSCEnumProtocols(NULL, providers, &size, &err); > >+ if (n == SOCKET_ERROR) { > >+ // Lame > nit: better comment as well stating why this should not fail > > Might be a good thing to have Jim take a look at this as well Sure.
![]() |
||
Comment 8•14 years ago
|
||
Perhaps then "WSCEnumProtocols succeeded when it should have failed" for clarity
![]() |
||
Comment 9•14 years ago
|
||
Comment on attachment 490328 [details] [diff] [review] Patch btw: I don't think Jim needs to review this for it to land... I mainly want him to know about this code since he touches windows widget quite often.
Attachment #490328 -
Flags: review?(jmathies)
![]() |
||
Comment 10•14 years ago
|
||
Jim, cc'ing you to give you a heads up about this addition.
![]() |
||
Comment 11•14 years ago
|
||
(In reply to comment #10) > Jim, cc'ing you to give you a heads up about this addition. Should be interesting to see what shows up.
Assignee | ||
Comment 12•14 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/c8a4b4ed9160 and http://hg.mozilla.org/mozilla-central/rev/4744e56a99b8 to fix some non-IPC unicode issues.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b8
Assignee | ||
Comment 13•14 years ago
|
||
It looks like this information is getting cut off on the crash reports :-(
Comment 14•14 years ago
|
||
App notes has a limit of 1000 characters or so. This really needs to go in a dedicated field and be stored in the database separately to be much use for aggregate reports, I think.
Assignee | ||
Comment 15•14 years ago
|
||
Guess we might as well remove this from the App notes then. We don't get through the MS LSPs on any of the reports :-/
Comment 16•14 years ago
|
||
Dunno why, but TestWinDND.cpp is trying to link this and failing because it needs ws2_32.lib (this is a non-libxul-only test which is why trunk is green).
Assignee | ||
Comment 17•14 years ago
|
||
It's trying to link statically against gkwidget which uses symbols from this.
You need to log in
before you can comment on or make changes to this bug.
Description
•