Closed Bug 609585 Opened 11 years ago Closed 9 years ago

crash [@ nsLDAPConnectionLoop::Run()] handling mPendingOperations. [@ nsCOMPtr_base::~nsCOMPtr_base() | nsLDAPConnectionLoop::Run()], [@ libxpcom_core.dylib@0x4011] (Mac)

Categories

(Directory :: LDAP XPCOM SDK, defect)

x86
All
defect
Not set
critical

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: wsmwk, Assigned: timeless)

References

Details

(Keywords: crash, Whiteboard: [tbird crash])

Crash Data

Attachments

(1 file, 3 obsolete files)

crash [@ nsLDAPConnectionLoop::Run()]
~#200 for v3.1.6

bp-9e3ec5db-5c64-48dd-9ee5-8d9432101104 v3.0.5
bp-83cbaf2c-58a4-42dd-8ab0-b23052101014 v3.1.4 "was sending an email"
0	thunderbird.exe	nsLDAPConnectionLoop::Run	directory/xpcom/base/src/nsLDAPConnection.cpp:868
1	xpcom_core.dll	nsThread::ProcessNextEvent	xpcom/threads/nsThread.cpp:527
2	xpcom_core.dll	NS_ProcessNextEvent_P	objdir-tb/mozilla/xpcom/build/nsThreadUtils.cpp:250
3	xpcom_core.dll	nsThread::ThreadFunc	xpcom/threads/nsThread.cpp:254
4	nspr4.dll	_PR_NativeRunThread	nsprpub/pr/src/threads/combined/pruthr.c:426
Component: LDAP Integration → LDAP XPCOM SDK
Product: MailNews Core → Directory
QA Contact: ldap-integration → xpcom
Version: Trunk → other
same crash, even though different line number??

nsCOMPtr_base::~nsCOMPtr_base() | nsLDAPConnectionLoop::Run()
bp-2bf074a1-bffa-41eb-b988-ffb312101101 v3.1.4
0	xpcom_core.dll	nsCOMPtr_base::~nsCOMPtr_base	objdir-tb/mozilla/xpcom/build/nsCOMPtr.cpp:81
1	thunderbird.exe	nsLDAPConnectionLoop::Run	directory/xpcom/base/src/nsLDAPConnection.cpp:881
2	xpcom_core.dll	nsThread::ProcessNextEvent	xpcom/threads/nsThread.cpp:527
3	xpcom_core.dll	NS_ProcessNextEvent_P	objdir-tb/mozilla/xpcom/build/nsThreadUtils.cpp:250
not sure there is a Mac version of this crash. but bp-e9a73ab6-1693-43c1-84a9-3568c2101020 @ libxpcom_core.dylib@0x4011 has nsLDAPConnectionLoop::Run on the stack
comment 0 is a null pointer crash:

868 if (mRawConn->mPendingOperations->Count()) { 

mPendingOperations is null.

comment 1 is a different crash (please file a new bug) -- I think comment 2 goes with comment 1.
Summary: crash [@ nsLDAPConnectionLoop::Run()] → crash [@ nsLDAPConnectionLoop::Run()] mPendingOperations is null
actually, don't, maybe they're all the same...
actually. I think they're the same. try the following before forking a bug.
Summary: crash [@ nsLDAPConnectionLoop::Run()] mPendingOperations is null → crash [@ nsLDAPConnectionLoop::Run()] handling mPendingOperations
Attached patch outline (obsolete) — Splinter Review
I haven't asked a compiler what it thinks, but this should outline my thinking.
Assignee: nobody → timeless
Status: NEW → ASSIGNED
Attachment #490041 - Flags: review?(bienvenu)
(In reply to comment #5)
> actually. I think they're the same. try the following before forking a bug.

FWIW, I don't have a testcase, nor a reporter for this. but after checking one month of nsCOMPtr_base::~nsCOMPtr_base() | nsLDAPConnectionLoop::Run() I am waiting to hear back from  bp-41d3f181-42b2-486e-932e-175942101027 (priyank.m) 

And Mac users continue to be more prolific in reporting with their email addresses than other OS. for libxpcom_core.dylib@0x4011
bp-9a2981dc-5564-4ef7-bd78-8d7f62101019 (ken)
bp-a6cda2bb-06ac-4eea-a121-70d2e2101108 (alex)
Summary: crash [@ nsLDAPConnectionLoop::Run()] handling mPendingOperations → crash [@ nsLDAPConnectionLoop::Run()] handling mPendingOperations. [@ nsCOMPtr_base::~nsCOMPtr_base() | nsLDAPConnectionLoop::Run()], [@ libxpcom_core.dylib@0x4011] (Mac)
prev patch didn't compile. This patch compiles, but fails at runtime because nsLDAPConnection::Release grabs the lock before calling delete this, and the destructor calls Close(), which tries also to grab the lock, which generates a PR_ASSERT in the lock code, because we already have the lock. This *may* mean that we don't need the PR_Lock calls in Close, because we can only ever get there from Release().
Attachment #490041 - Attachment is obsolete: true
Attachment #490041 - Flags: review?(bienvenu)
I tried the patch w/o the lock calls in Close, and things seem to work, though there is a thread-safety assertion when the connection gets freed that I don't remember seeing before. I guess I'll attach a patch and see what standard8 thinks...
Attached patch tweaked fix (obsolete) — Splinter Review
Attachment #492337 - Attachment is obsolete: true
Attachment #492341 - Flags: review?(bugzilla)
Attached patch The fixSplinter Review
I tweaked this to take account of the recent directory -> ldap move, and to fix a review nit of using // rather than /* ... */

This has r=Standard8
Attachment #492341 - Attachment is obsolete: true
Attachment #494985 - Flags: review+
Attachment #492341 - Flags: review?(bugzilla)
Blocks: 618513
still needs checkin

I have not heard back from priyank.m about bp-41d3f181-42b2-486e-932e-175942101027.
pmed bp-6a6744bc-871c-4926-9029-7ed532101207 (sean)
Whiteboard: [tbird crash]
no version 3.1.7 crashes with this sig in the last 2 weeks - odd?

from comment #12
> pmed bp-6a6744bc-871c-4926-9029-7ed532101207 (sean)
sean doesn't know how his happened.

Alex bp-a6cda2bb-06ac-4eea-a121-70d2e2101108 writes "I am hardly using Thunderbird on Mac, although it is much better than Mac Mail for me, however, the Linux Version of Thunderbird is rock solid, and that's what I am using in daily life though."
This was set checkin-needed 6 months ago, is it still wanted?
(In reply to comment #14)
> This was set checkin-needed 6 months ago, is it still wanted?

If it still applies : yes !
applying 609585.txt
patching file ldap/xpcom/src/nsLDAPConnection.cpp
Hunk #1 succeeded at 215 with fuzz 1 (offset -45 lines).
Hunk #2 FAILED at 272
Hunk #3 FAILED at 869

Rebase didn't help.

Seems like bug 630816 and bug 343332 have rotted this considerably - eg the approach here has completely changed:
http://hg.mozilla.org/comm-central/annotate/6a05e36ee576/ldap/xpcom/src/nsLDAPConnection.cpp#l235

Clearing checkin-needed to tidy up the checkin-needed shared search (which was the main reason for comment 14), since this needs more than just a rebase before it can land - and is beyond my expertise.
Keywords: checkin-needed
nsLDAPConnectionLoop::Run() is #152 crash for v3.1.10
Crash Signature: [@ nsLDAPConnectionLoop::Run()] [@ nsCOMPtr_base::~nsCOMPtr_base() | nsLDAPConnectionLoop::Run()] [@ libxpcom_core.dylib@0x4011]
All examples on crash-stats are version 3.1.x and 3.0.x
Status: ASSIGNED → RESOLVED
Crash Signature: [@ nsLDAPConnectionLoop::Run()] [@ nsCOMPtr_base::~nsCOMPtr_base() | nsLDAPConnectionLoop::Run()] [@ libxpcom_core.dylib@0x4011] → [@ nsLDAPConnectionLoop::Run()] [@ nsCOMPtr_base::~nsCOMPtr_base() | nsLDAPConnectionLoop::Run()] [@ libxpcom_core.dylib@0x4011]
Closed: 9 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.