Closed Bug 766269 Opened 12 years ago Closed 12 years ago

Permanent orange: TEST_UNEXPECTED_FAIL | test_0030_general.js | test failed (with xpcshell return code: -2147483645) - application crashed ###!!! ASSERTION: mTempFile not equal to mTargetFile

Categories

(Toolkit :: Application Update, defect)

All
Windows XP
defect
Not set
critical

Tracking

()

RESOLVED FIXED
mozilla16
Tracking Status
firefox15 --- fixed

People

(Reporter: standard8, Assigned: standard8)

References

Details

(Keywords: intermittent-failure)

Attachments

(3 files, 1 obsolete file)

Since the background updates (bug 307181) landed, we've been seeing this assertion on our debug Windows XP tests. It has been covered up a bit until now. Possibly related to bug 766264.

https://tbpl.mozilla.org/php/getParsedLog.php?id=12798852&tree=Thunderbird-Trunk#error0

TEST-UNEXPECTED-FAIL | c:\talos-slave\test\build\xpcshell\tests\toolkit\mozapps\update\test\unit\test_0030_general.js | test failed (with xpcshell return code: -2147483645), see following log:
>>>>>>>
### XPCOM_MEM_LEAK_LOG defined -- logging leaks to c:\docume~1\cltbld\locals~1\temp\tmpd9mc_v\runxpcshelltests_leaks.log

TEST-INFO | (xpcshell/head.js) | test 1 pending

TEST-INFO | (xpcshell/head.js) | test 2 pending
TEST-INFO | c:/talos-slave/test/build/xpcshell/tests/toolkit/mozapps/update/test/unit/head_update.js | [setUpdateURLOverride : 773] setting app.update.url.override to http://localhost:4444/update.xml

TEST-INFO | (xpcshell/head.js) | test 3 pending

TEST-INFO | (xpcshell/head.js) | test 3 finished

TEST-INFO | (xpcshell/head.js) | running event loop
TEST-INFO | c:/talos-slave/test/build/xpcshell/tests/toolkit/mozapps/update/test/unit/test_0030_general.js | [run_test_pt1 : 90] mar download with a valid MD5 hash
*** AUS:SVC Checker:getUpdateURL - update URL: http://localhost:4444/update.xml?force=1
*** AUS:SVC gCanCheckForUpdates - able to check for updates
*** AUS:SVC Checker:checkForUpdates - sending request to: http://localhost:4444/update.xml?force=1

TEST-INFO | (xpcshell/head.js) | test 3 pending

TEST-INFO | (xpcshell/head.js) | test 3 finished
*** AUS:SVC Checker:onLoad - request completed downloading document
*** AUS:SVC Checker:getUpdateURL - update URL: http://localhost:4444/update.xml?force=1
*** AUS:SVC Checker:onLoad - number of updates available: 1
TEST-INFO | c:/talos-slave/test/build/xpcshell/tests/toolkit/mozapps/update/test/unit/head_update.js | [UCL_onCheckComplete : 2422] url = http://localhost:4444/update.xml?force=1, request.status = 400, update.statusText = undefined, updateCount = 1

TEST-INFO | (xpcshell/head.js) | test 3 pending

TEST-INFO | (xpcshell/head.js) | test 3 finished

TEST-PASS | c:/talos-slave/test/build/xpcshell/tests/toolkit/mozapps/update/test/unit/test_0030_general.js | [check_test_helper_pt1_1 : 65] 1 == 1
*** AUS:SVC readStringFromFile - file doesn't exist: C:\Documents and Settings\cltbld\Local Settings\Application Data\\\thunderbird\updates\0\update.status
*** AUS:SVC readStatusFile - status: null, path: C:\Documents and Settings\cltbld\Local Settings\Application Data\\\thunderbird\updates\0\update.status
*** AUS:SVC UpdateManager:_loadXMLFileIntoArray: XML file does not exist
*** AUS:SVC UpdateManager:_loadXMLFileIntoArray: XML file does not exist
*** AUS:SVC UpdateManager:_loadXMLFileIntoArray: XML file does not exist
*** AUS:SVC Downloader:downloadUpdate - downloading from http://localhost:4444/data/simple_no_pib.mar to C:\Documents and Settings\cltbld\Local Settings\Application Data\\\thunderbird\updates\0\update.mar
###!!! ASSERTION: mTempFile not equal to mTargetFile: 'Error', file e:/builds/moz2_slave/tb-comm-cen-w32-dbg/build/mozilla/netwerk/base/src/nsFileStreams.cpp, line 759
Is there a stack for this assertion?
Attached file Stack of assertion
Yes, but it is all js basically.
If you have some time to debug this, it would be great if you can instrument a build to call DumpJSStack() when that NS_ERROR is reached, and get to the JS stack there, so that we can start to figure out what's going on here.
Whiteboard: [tb-orange]
Ok, I did a try server run today, with a patched nsFileStream, here's the interesting stuff...

The NS_ERROR is:

###!!! ASSERTION: mTempFile not equal to mTargetFile: 'Error', file e:/builds/moz2_slave/tb-try-c-cen-w32-dbg/build/mozilla/netwerk/base/src/nsFileStreams.cpp, line 769

The two files it is talking about have paths:

Target File Path: C:\Users\cltbld\AppData\Local\\\thunderbird\updates\0\update.status
Temp File Path: C:\Users\cltbld\AppData\Local\thunderbird\updates\0\update.status

Hence Target file isn't normalised :-(

JS Stack:

0 FileUtils_closeSafeFileOutputStream() ["resource://gre/modules/FileUtils.jsm":120]
1 <TOP LEVEL> ["<unknown>":0]
2 writeStringToFile() ["jar:file:///c:/talos-slave/test/build/thunderbird/omni.ja!/components/nsUpdateService.js":841]
3 writeStatusFile() ["jar:file:///c:/talos-slave/test/build/thunderbird/omni.ja!/components/nsUpdateService.js":610]
4 Downloader_downloadUpdate() ["jar:file:///c:/talos-slave/test/build/thunderbird/omni.ja!/components/nsUpdateService.js":2960]
5 AUS_downloadUpdate() ["jar:file:///c:/talos-slave/test/build/thunderbird/omni.ja!/components/nsUpdateService.js":2094]
6 <TOP LEVEL> ["<unknown>":0]
7 check_test_helper_pt1_1() ["c:/talos-slave/test/build/xpcshell/tests/toolkit/mozapps/update/test/unit/test_0030_general.js":68]
8 anonymous() ["c:\talos-slave\test\build\xpcshell\head.js":407]
Just for historical purposes, here's the patch I used to debug nsFileStream.
Attached patch Potential fix (obsolete) — Splinter Review
So what I think is going on here is that xpcshell isn't taking account of the fact that Thunderbird doesn't have a vendor id or basename when setting the update directory. This gives us the strange \\\ path, which the test obviously doesn't like.

The patch will hopefully fix that.

I'm not sure if it'll fix bug 766264 as well, but at least it would be a step forward.
Attached patch The fixSplinter Review
This fixes this issue (it doesn't fix bug 766264) - by only adding the vendor and base name when they are set, then we get the correct path. I did consider using normalize, but I wasn't sure if that would deal with the \\\ correctly - especially as that was happening in the sprintf part, and appending it and letting nsIFile do the job seemed much more appropriate.

I've pushed this to Firefox try here:

https://tbpl.mozilla.org/?noignore=1&tree=Try&rev=bc0ad78976da

The Thunderbird try server run is here:

https://tbpl.mozilla.org/?tree=Thunderbird-Try&noignore=1&rev=d4c39f9435b0
Assignee: nobody → mbanner
Attachment #637527 - Attachment is obsolete: true
Attachment #637674 - Flags: review?(ehsan)
Comment on attachment 637674 [details] [diff] [review]
The fix

Review of attachment 637674 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good, thanks for figuring it out!
Attachment #637674 - Flags: review?(ehsan) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/c7da6936a2c8
Flags: in-testsuite+
Target Milestone: --- → mozilla16
https://hg.mozilla.org/mozilla-central/rev/c7da6936a2c8
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Comment on attachment 637674 [details] [diff] [review]
The fix

[Approval Request Comment]
Bug caused by (feature/regressing bug #): Bug 307181
User impact if declined: None, test-only fix
Testing completed (on m-c, etc.): Landed on inbound, central
Risk to taking this patch (and alternatives if risky): Test-only, so none
String or UUID changes made by this patch: None

This is a test-only fix that takes account of Thunderbird not having the vendor/basename set (and possibly other apps using gecko) and avoids permanent orange due to assertions in debug mode.
Attachment #637674 - Flags: approval-mozilla-aurora?
Comment on attachment 637674 [details] [diff] [review]
The fix

low risk, fixes orange test, totally approved.
Attachment #637674 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Whiteboard: [tb-orange]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: