Firefox crashes erratically when running my SDK addon (Turtl)

RESOLVED INCOMPLETE

Status

Add-on SDK
General
RESOLVED INCOMPLETE
4 years ago
4 years ago

People

(Reporter: orthecreedence, Unassigned, NeedInfo)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(crash signature)

Attachments

(1 attachment, 1 obsolete attachment)

712.89 KB, application/zip
Details
(Reporter)

Description

4 years ago
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0 (Beta/Release)
Build ID: 20131112160018

Steps to reproduce:

I install my addon (https://addons.mozilla.org/en-us/firefox/addon/turtl/) into a blank profile, sign up for an account, and leave the Turtl tab (opened on signup) open. The crash seems to happen more easily when the user is logged in (I have a suspicion this is due to its use of IndexedDB since the crashes started to happen around the time I implemented it). It also seems to happen more frequently when more data is in the profile.

Once the addon is installed and the user is logged in, it can take between 30 minutes to 2-3 hours for the crash to occur. It's very random, happening both when Firefox is in use and when it's minimized.

I'm on Windows 7 x64, Firefox 25.


Actual results:

Firefox closes, and opens the "Report a crash" window. When running the addon in cfx, no output is given prior to the crash. I have submitted several reports which may help narrow down the issue, but wanted to track it here as well. Note that this happened in Firefox 24 as well, and all releases of 25.


Expected results:

Firefox should stay open and not crash, or at least spit out some form of debug info that will help narrow down the issue.
(Reporter)

Comment 1

4 years ago
Forgot to mention, my addon is built via the addon SDK...no funny stuff! I am using the toolbarbutton-complete plugin, but somehow I doubt that's the cause since it basically just manually creates XUL and injects it into the nav bar.

Comment 2

4 years ago
Please post your relevant crash IDs here so someone can investigate the issue.
http://developer.mozilla.org/en/How_to_get_a_stacktrace_for_a_bug_report
(Reporter)

Comment 3

4 years ago
bp-a11db92b-9d5d-4fde-b14d-11b452131126
bp-18bea3aa-2847-4c05-92e9-ceffc2131126
bp-fdcbcf0b-cf30-499d-9768-d41032131126

Sorry, didn't know I could see my previous crashes. Thanks for the tip.

Comment 4

4 years ago
None of those crash reports are loading. Are you sure those are the most recent crash reports you have for this issue? Take a look through your about:crashes and see if you can find one that loads that is for this bug.
(Reporter)

Comment 5

4 years ago
Yes, I'm positive those are the crashes, they are timestamped as happening today just before I reported the bug. They are not loading for me either. Here are two from a few days ago that load:

bp-f2b0583b-e5ec-4d0c-af3c-f79ca2131124
bp-1612c989-fdad-468f-8e11-544e32131124

Comment 6

4 years ago
Ok, over to JS component based on stack and prior bugs with this signature.

Can you still reproduce this in a more recent Firefox build? Try a new profile with 28:
http://nightly.mozilla.org/
(if you need to use your main profile, back things up first)
Crash Signature: [@ MarkValueInternal ]
Component: Untriaged → JavaScript Engine
Product: Firefox → Core
Summary: Firefox crashes erratically when running my addon (Turtl) → Firefox crashes erratically when running my addon (Turtl) [@ MarkValueInternal ]
(Reporter)

Comment 7

4 years ago
Oh, one of the more recent crash reports started working as well: https://crash-stats.mozilla.com/report/index/683eaf94-9a10-4761-b467-ea3fc2131125

I'll install with 28 nightly and post any crashes.

Comment 8

4 years ago
Yeah, all the crashes in comment 3 are showing now. (maybe the crash report server is/was having issues?)

We've got another of the [@ MarkValueInternal ] to match the two in comment 5, but then we've got a few [@ sqlite3LeaveMutexAndCloseZombie ] which is a whole other thing and [@ NoteJSChildTracerShim ] which is another different JS crash. The sqlite one looks like it might be bug 924348.
(Reporter)

Comment 9

4 years ago
First crash with FF 28: bp-62c47cf9-35a7-4127-b18c-14ece2131128
(Reporter)

Comment 10

4 years ago
Second FF 28 crash: bp-f05db6c1-3a8d-4335-87ae-cde312131129
(Reporter)

Comment 12

4 years ago
Sorry, double posted. This is the new one: bp-408a70a9-f99a-47a7-ab65-cfbaa2131130

Comment 14

4 years ago
Those are a whole bunch of different looking crashes. You've also got a lot more related to sqlite there than JS. At some point, you're probably going to want to create a reduced test case that doesn't involve creating an account that triggers one of the issues here. You're going to need a simpler set of steps to reproduce here. I'm also beginning to suspect that there might be two separate crashes here, one having to do with sqlite and another JS related, maybe fallout from that? (I really don't know; you've list a lot of different crashes there)

What you've got thus far above:

JS crashes:
bp-a11db92b-9d5d-4fde-b14d-11b452131126 [@ NoteJSChildTracerShim ]
bp-fdcbcf0b-cf30-499d-9768-d41032131126 [@ MarkValueInternal ]
bp-f2b0583b-e5ec-4d0c-af3c-f79ca2131124 [@ MarkValueInternal ]
bp-1612c989-fdad-468f-8e11-544e32131124 [@ MarkValueInternal ]

sqlite crashes:
bp-18bea3aa-2847-4c05-92e9-ceffc2131126 [@ sqlite3LeaveMutexAndCloseZombie ]
bp-683eaf94-9a10-4761-b467-ea3fc2131125 [@ sqlite3LeaveMutexAndCloseZombie ]
bp-f05db6c1-3a8d-4335-87ae-cde312131129 [@ PL_DHashTableOperate ]
bp-408a70a9-f99a-47a7-ab65-cfbaa2131130 [@ sqlite3Fts3HashClear ]
bp-fe2c31ca-f0a1-4bda-9e55-b9ee02131130 [@ sqlite3DeleteTable ]

and one somewhere inside the cycle collector:
bp-62c47cf9-35a7-4127-b18c-14ece2131128 [@ CanonicalizeParticipant ] @0x13e8d05b

It's also possible that the JS ones are fixed in more recent builds if you're just hitting the others (or it manifest differently). You're going to have to narrow this down a bit, I'm afraid. :/
Crash Signature: [@ MarkValueInternal ] → [@ MarkValueInternal ] [@ NoteJSChildTracerShim ] [@ sqlite3LeaveMutexAndCloseZombie ] [@ PL_DHashTableOperate ] [@ sqlite3Fts3HashClear ] [@ sqlite3DeleteTable ] [@ CanonicalizeParticipant ]
Component: JavaScript Engine → Untriaged
Product: Core → Firefox
Summary: Firefox crashes erratically when running my addon (Turtl) [@ MarkValueInternal ] → Firefox crashes erratically when running my SDK addon (Turtl)
Version: 25 Branch → Trunk
(Reporter)

Comment 16

4 years ago
This makes sense. I'll try to come up with a test case for you guys with some sample data and running the type of queries that are normally run by the addon. This can be done in the next day or two. Thank you for the help so far.
I would guess that the sqlite issues are causing heap corruption, and that's why we're getting crashes in the JS GC and the cycle collector.
(Reporter)

Comment 18

4 years ago
Created attachment 8343210 [details]
A browser extension that attempts to crash Firefox

Ok, so I was able to duplicate most of what Turtl does in the background via a new test addon (attached). This opens IndexedDB, populates it with fake data, and runs all the normal queries on it.

Tips on using:

1. Start in a new profile
2. Click the extension icon 4-5 times (it will open a new tab each time)
3. Click "Start test" in the first tab. This will populate the DB and start running background queries.
4. Once the DB is populated (with boards *and* notes) go to the other tabs that you opened and click "Start test" as well. There will now be 4-5 separate processes querying IndexedDB at the same time.
5. Wait a bit, sometimes up to 30 minutes. It may also help to open a new blank tab and minimize the FF window.

Here are three new crashes I got on running this test extension on Windows 7 x64, Firefox 28.0a1:

bp-df6f4f4e-49d2-4386-8dc0-b67fc2131205
bp-d5d9a8ac-ccca-4bba-956f-241292131205
bp-e2a03dae-92e0-4aee-9256-8442a2131205
(Reporter)

Comment 19

4 years ago
Also note that crashes happen more frequently on my laptop, which has a regular hard disk vs my desktop, where my test profile is stored on an SSD. When I try with a profile on my desktop's regular drive (non-SSD) the crashes happen more frequently. Maybe a connection.

Also I'm noticing that the more CPU power a machine has, the more test tabs you need to open to crash it. Should help reproducing.
(Reporter)

Comment 20

4 years ago
Has anyone had any luck reproducing with the posted extension? I've had other people reporting crashes when using Turtl and I'd really like to figure out what's going on. Thanks!

Updated

4 years ago
Component: Untriaged → General
Product: Firefox → Add-on SDK
Version: Trunk → unspecified
Erik, can you try reproducing the crash?
Flags: needinfo?(evold)
(In reply to Wes Kocher (:KWierso) from comment #21)
> Erik, can you try reproducing the crash?

This looks like a `indexedDB` related bug, I'm really not the best person to investigate.
Flags: needinfo?(evold) → needinfo?(kwierso)
Dave, you'd probably have a better idea of who to pester about this.
Flags: needinfo?(kwierso) → needinfo?(dtownsend+bugmail)
Erik, I'd like you to just try to reproduce it to see if you get similar crashes. That will help us understand where to send this bug as it is almost certainly not an SDK specific issue.
Flags: needinfo?(dtownsend+bugmail) → needinfo?(evold)
(In reply to orthecreedence from comment #18)
> Created attachment 8343210 [details]
> A browser extension that attempts to crash Firefox


Hey, can you please post the source code someplace (like github) or just zip the add-on folder and attach that to this bug, instead of a package xpi which has a lot of irrelevant files included?

For some reason the xpi you attached has addon-sdk modules shipped with it which shouldn't be done.  Because of this I cannot know if the modules are the same as the ones we use (the ones that should be used, which are shipped with the browser) without checking each file individually to make sure they are not altered.
Flags: needinfo?(evold) → needinfo?(orthecreedence)
(In reply to orthecreedence from comment #18)
> Created attachment 8343210 [details]
> A browser extension that attempts to crash Firefox

Note: the xhr_wrapper.js file is unnecessary, you can use cross-domain permissions to enable the content script to make a cross domain request, https://developer.mozilla.org/en-US/Add-ons/SDK/Guides/Content_Scripts/Cross_Domain_Content_Scripts
(Reporter)

Comment 27

4 years ago
Created attachment 8398157 [details]
turtl-test.zip

Attached is the zipped version of the extension.

Also, I figured out the xhr_wrapper stuff and replaced it all with CORS, but that was after I made this extension =]. I remember reading about cross-domain content scripts, but I think it had a limitation that made it unusable to me (can't for the life of me remember what it was now).

Thanks!
Attachment #8343210 - Attachment is obsolete: true
Flags: needinfo?(orthecreedence)
(In reply to orthecreedence from comment #27)
> Created attachment 8398157 [details]
> turtl-test.zip
> 
> Attached is the zipped version of the extension.
> 
> Also, I figured out the xhr_wrapper stuff and replaced it all with CORS, but
> that was after I made this extension =]. I remember reading about
> cross-domain content scripts, but I think it had a limitation that made it
> unusable to me (can't for the life of me remember what it was now).
> 
> Thanks!

So I'm not able to reproduce the crashes, I tried on Windows 7 64-bit, with the addon-sdk master branch on Nightly.  I do see a number off errors in the browser console though:

IndexedDB UnknownErr: c:\builds\moz2_slave\m-cen-w32-ntly-000000000000000\build\dom\indexedDB\AsyncConnectionHelper.cpp:345
too much recursion db.js:21
UnknownError db.js:336
too much recursion db.js:106
Use of getAttributeNode() is deprecated. Use getAttribute() instead. mootools-core-1.4.5.js:3661
1395967238220	Services.HealthReport.HealthReporter	WARN	Saved state file does not exist.

1395967238220	Services.HealthReport.HealthReporter	WARN	No prefs data found.

value is not a non-null object browser.js:14695
docShell.QueryInterface(...).sessionHistory is null content-sessionStore.js:230
IndexedDB UnknownErr: c:\builds\moz2_slave\m-cen-w32-ntly-000000000000000\build\dom\indexedDB\AsyncConnectionHelper.cpp:345
too much recursion db.js:21
UnknownError db.js:336
too much recursion db.js:106
(In reply to Erik Vold [:erikvold] [:ztatic] from comment #28)
> (In reply to orthecreedence from comment #27)
> > Created attachment 8398157 [details]
> > turtl-test.zip
> > 
> > Attached is the zipped version of the extension.
> > 
> > Also, I figured out the xhr_wrapper stuff and replaced it all with CORS, but
> > that was after I made this extension =]. I remember reading about
> > cross-domain content scripts, but I think it had a limitation that made it
> > unusable to me (can't for the life of me remember what it was now).
> > 
> > Thanks!
> 
> So I'm not able to reproduce the crashes, I tried on Windows 7 64-bit, with
> the addon-sdk master branch on Nightly.  I do see a number off errors in the
> browser console though:
> 
> IndexedDB UnknownErr:
> c:\builds\moz2_slave\m-cen-w32-ntly-
> 000000000000000\build\dom\indexedDB\AsyncConnectionHelper.cpp:345
> too much recursion db.js:21
> UnknownError db.js:336
> too much recursion db.js:106
> Use of getAttributeNode() is deprecated. Use getAttribute() instead.
> mootools-core-1.4.5.js:3661
> 1395967238220	Services.HealthReport.HealthReporter	WARN	Saved state file
> does not exist.
> 
> 1395967238220	Services.HealthReport.HealthReporter	WARN	No prefs data found.
> 
> value is not a non-null object browser.js:14695
> docShell.QueryInterface(...).sessionHistory is null
> content-sessionStore.js:230
> IndexedDB UnknownErr:
> c:\builds\moz2_slave\m-cen-w32-ntly-
> 000000000000000\build\dom\indexedDB\AsyncConnectionHelper.cpp:345
> too much recursion db.js:21
> UnknownError db.js:336
> too much recursion db.js:106

It's really hard to debug this example since there are about 100 js files in there, it would be much easier to debug if the we had a reduced test case, with only the essential pieces needed to reproduce the issue, which I'd imagine would only be 1 or 2 js files.

Updated

4 years ago
Flags: needinfo?(orthecreedence)
Please reopen if you can post the reduced testcase.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.