Closed Bug 547414 Opened 15 years ago Closed 9 years ago

crash from nsIServerSocket restart after sleep / hibernation [@ nsServerSocket::OnSocketDetached] - purecall

Categories

(Core :: Networking, defect)

1.9.2 Branch
x86
Windows 7
defect
Not set
critical

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: munzarp, Unassigned)

References

Details

(Keywords: crash, stackwanted)

Crash Data

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.0.18) Gecko/2010020220 Firefox/3.0.18 (.NET CLR 3.5.30729) Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.0.18) Gecko/2010020220 Firefox/3.0.18 (.NET CLR 3.5.30729) After sleep_notification i close existing nsiServerSocket. After wake_notification i start listening again. Firefox will crash. Reproducible: Always Steps to Reproduce: 1.Write extension with code which restart sockets after sleep/hibernation. 2.Put your computer to the sleep. 3.Wake up your computer try to use firefox. Actual Results: Exception occur in method asyncListen of nsiServerSocket. "Component returned failure code: 0xc1f30001 (NS_ERROR_NOT_INITIALIZED) [nsIServerSocket.asyncListen]" Expected Results: Socket will start listen again. function listener_start(port) { try { listenSocket = Components.classes["@mozilla.org/network/server-socket;1"].createInstance(Components.interfaces.nsIServerSocket); listenSocket.init(port,true,-1); listenSocket.asyncListen(serverListener); } catch(e2) { alert(e2); } } function stopLocalServer() { if(listenSocket) { listenSocket.close(); } } function ExtOnLoad() { var wakeObserver = { observe: function(aSubject, aTopic, aData) { listener_start(localServerPort); } }; var sleepObserver = { observe: function(aSubject, aTopic, aData) { stopLocalServer(); } }; var observerService = Components.classes["@mozilla.org/observer-service;1"] .getService(Components.interfaces.nsIObserverService); observerService.addObserver(wakeObserver,"wake_notification", false); observerService.addObserver(sleepObserver,"sleep_notification", false); }
3.0.x/1.9.0.x is very close to end of life. please try with 3.6.y/1.9.2.y or later.
Component: General → Networking
Keywords: stackwanted
Product: Firefox → Core
QA Contact: general → networking
Summary: nsiServerSocket restart after sleep / hibernation → crash from nsIServerSocket restart after sleep / hibernation
Version: unspecified → 1.9.0 Branch
My crash id is bp-e0013df0-d966-43f5-bcd8-755142100220 If anyone wonder why I want restart socket it is because unsolved bug 532905 . I have tried 3.5.x and 3.6, 3.7a2pre same problem. Im programmer.I also have debug build of firefox. I can debug in visual studio 2008. But i have little experience with firefox source. If you want some more info or help. Please let me know. This problem realy bothers me.
In crash report it shows method OnSocketDetached. My code for Event stop listenning in nsIServerSocketListener is empty like this onStopListening : function(socket, status) {} };
238 mListener->OnStopListening(this, mCondition); it sounds like your object was dead.... https://developer.mozilla.org/en/How_to_get_a_stacktrace_with_WinDbg has instructions for getting symbols into your debugger, you can use it w/ visual studio too. irc.mozilla.org has people who can help you w/ the rest.
Severity: normal → critical
Keywords: stackwantedcrash
Hardware: x86_64 → x86
Summary: crash from nsIServerSocket restart after sleep / hibernation → crash from nsIServerSocket restart after sleep / hibernation [@ nsServerSocket::OnSocketDetached] - purecall
Version: 1.9.0 Branch → 1.9.2 Branch
Crash Signature: [@ nsServerSocket::OnSocketDetached]
Skritek, can you still reproduce this, and have a stack ?
Keywords: stackwanted
Whiteboard: [closeme 2012-04-25]
Resolved per whiteboard
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Resolution: --- → INCOMPLETE
Whiteboard: [closeme 2012-04-25]
I have just experienced the same problem. I have no C debugging info. But I try to recreate the server socket after my JS code gets onStopListening(). And when I do, it crashes the program (TB v 12.0.1). Here is what I can see in the problem report (also sent to Mozilla): AdapterDeviceID: 0x27a2 AdapterVendorID: 0x8086 Add-ons: sendlater3@kamens.us:3.3.10,SQLiteManager@mrinalkant.blogspot.com:0.7.7,{25A1388B-6B18-46c3-BEBA-A81915D0DE8F}:1.7.8,{3c6e2514-e97b-401a-8559-6ce25356926f}:1.0,{a300a000-5e21-4ee0-a115-9ec8f4eaa92b}:0.3.7,{aee74dd0-6dc9-11db-9fe1-0800200c9a66}:2.3.2,{bfec0750-aa6f-11db-abbd-0800200c9a66}:2.12,{f13b157f-b174-47e7-a34d-4815ddfdfeb8}:0.9.89,{e2fda1a4-762b-4020-b5ad-a41df1933103}:1.4,inspector@mozilla.org:2.0.12,{cc138c46-ac77-4397-afc0-6cb6a13b7242}:3.1b3,{972ce4c6-7e08-4474-a285-3208198ce6fd}:12.0.1 AvailablePageFile: 3127259136 AvailablePhysicalMemory: 1477906432 AvailableVirtualMemory: 1957416960 BuildID: 20120428123112 CrashTime: 1340040469 EMCheckCompatibility: true FramePoisonBase: 00000000f0de0000 FramePoisonSize: 65536 InstallTime: 1338666198 Notes: AdapterVendorID: 0x8086, AdapterDeviceID: 0x27a2, AdapterSubsysID: 01bd1028, AdapterDriverVersion: 6.14.10.4814 ProductID: {3550f703-e582-4d05-9a08-453d09bdfdc6}
Please, provide Crash report ID, steps to do that provided here - https://support.mozillamessaging.com/en-US/kb/mozilla-crash-reporter#w_viewing-crash-reports
Thanks for the info. Here it is: Crash ID: bp-266d3b34-e578-457d-9550-6319d2120619
(In reply to David White from comment #10) > Thanks for the info. Here it is: Crash ID: > bp-266d3b34-e578-457d-9550-6319d2120619 You have other crash signature, than listed in this bug, you should fill new one by pressing "Report this bug in Thunderbird" on your Crash ID page and provide there all information about how your crash appearing
Thanks but I don't see much point. My code is almost identical to that shown here and the failure I see is the same. This dates from long ago and was never really resolved. So thanks but I won't waste my time.
I'm not sure, why you think that _purecall | nsXPTCStubBase::AddRef() is almost identical to nsServerSocket::OnSocketDetached, but filling or not filling bug is you decision...
David is saying the code is almost identical, not the stack. David, could you post the code please ? Phoenix, Signatures can change over time, so I think we might assume _purecall | nsXPTCStubBase::AddRef() is the current crash signature bp-266d3b34-e578-457d-9550-6319d2120619 0 ntdll.dll KiFastSystemCallRet 1 ntdll.dll ZwWaitForSingleObject 2 kernel32.dll WaitForSingleObjectEx 3 kernel32.dll WaitForSingleObject 4 xul.dll google_breakpad::ExceptionHandler::WriteMinidumpOnHandlerThread toolkit/crashreporter/google-breakpad/src/client/windows/handler/exception_handler.cc:764 5 xul.dll google_breakpad::ExceptionHandler::HandlePureVirtualCall toolkit/crashreporter/google-breakpad/src/client/windows/handler/exception_handler.cc:708 6 msvcr80.dll _purecall f:\dd\vctools\crt_bld\self_x86\crt\src\purevirt.c:47 7 xul.dll nsXPTCStubBase::AddRef xpcom/reflect/xptcall/src/xptcall.cpp:59 8 xul.dll nsCOMPtr<nsIRDFXMLSerializer>::nsCOMPtr<nsIRDFXMLSerializer> objdir-tb/mozilla/dist/include/nsAutoPtr.h:932 9 xul.dll `anonymous namespace'::ServerSocketListenerProxy::OnStopListeningRunnable::OnSto netwerk/base/src/nsServerSocket.cpp:404 10 xul.dll `anonymous namespace'::ServerSocketListenerProxy::OnStopListening netwerk/base/src/nsServerSocket.cpp:436 11 xul.dll nsServerSocket::OnSocketDetached netwerk/base/src/nsServerSocket.cpp:241 12 xul.dll nsServerSocket::OnMsgClose netwerk/base/src/nsServerSocket.cpp:113 13 xul.dll nsRunnableMethodImpl<void I examined several _purecall | nsXPTCStubBase::AddRef() crashes of the past 4 months and most have the above stack. (A few having LDAP on the stack are not)
Status: RESOLVED → REOPENED
Crash Signature: [@ nsServerSocket::OnSocketDetached] → [@ nsServerSocket::OnSocketDetached] [@ _purecall | nsXPTCStubBase::AddRef() ]
Ever confirmed: true
Resolution: INCOMPLETE → ---
See Also: → 532905
I am confused. The original comments describe my situation almost exactly. I know nothing of _purecall | nsXPTCStubBase::AddRef() or of nsServerSocket::OnSocketDetached. These are C++ methods if I am correct. My addon is working purely in JS. I know that after a wakeup from suspend, my instance of nsiServerSocket is basically dead - just like described in comment #3 above (and the other bug to which that comment refers). I know that if I try to recreate it either on the OnStopListening() callback or as a result of an observed "wake_notification", TB crashes and wants to send a report. This seems to be an old bug and it appears to continue to exist at this time in TB 12. So I added a comment here. Beyond that, I cannot say. Thanks
perhaps this will clarify : 1. the standard (breakpad) crash stack may not be terribly helpful, as you suggest ... the js stack is needed 2. we have two distinct but related issues, hence 2 bugs: a) the listening failure after wake, bug 532905 b) the crash, this bug report Perhaps b wouldn't happen without a, but that remains to be seen. And I presume bug 532905 is the more important issue. and has great info, but I'm not so sure it's in the right component. Have you asked about 532905 in any extension forum, like mozilla.dev.extensions? Or a networking forum?
Thanks Wayne, I have posted to mozilla.dev.extensions.
(In reply to David White from comment #17) > Thanks Wayne, I have posted to mozilla.dev.extensions. David, what were you able to learn? FWIW, in 3 months there are no crashes newer than version 12 with _purecall | nsXPTCStubBase::AddRef() signature. And none for ServerSocket::OnSocketDetached
Flags: needinfo?(munzarp)
Crash Signature: [@ nsServerSocket::OnSocketDetached] [@ _purecall | nsXPTCStubBase::AddRef() ] → [@ nsServerSocket::OnSocketDetached] [@ _purecall | nsXPTCStubBase::AddRef() ] [@ _purecall | nsXPTCStubBase::AddRef ]
Skritek reports not having problem.
Status: REOPENED → RESOLVED
Closed: 13 years ago9 years ago
Flags: needinfo?(munzarp)
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.