Closed Bug 960544 Opened 10 years ago Closed 10 years ago

GenerationalGC: New failures in cppunittests that link to JS

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla29

People

(Reporter: jonco, Assigned: jonco)

References

Details

Attachments

(2 files, 1 obsolete file)

The following cppunittest failures have started appearing in generational GC browser builds:

Assertion failure: initialized(), at ../../../../dist/include/mozilla/ThreadLocal.h:123
cppunittests TEST-UNEXPECTED-FAIL | test_IHistory | test failed with return code -11
Assertion failure: initialized(), at ../../../../dist/include/mozilla/ThreadLocal.h:123
cppunittests TEST-UNEXPECTED-FAIL | sdp_unittests | test failed with return code -11
Assertion failure: initialized(), at ../../../../dist/include/mozilla/ThreadLocal.h:123
cppunittests TEST-UNEXPECTED-FAIL | mediapipeline_unittest | test failed with return code -11
Return code: 1

I suspect this is fallout from bug 951743 as these tests all end up linking to the JS library.
Right, so this is the problem mentioned in bug 951743 comment 6.

Now that JS_FRIEND_API always exports, we can use that for the relocation functions that these test programs need and stop linking them twice against the JS library.
Assignee: nobody → jcoppeard
Attachment #8361167 - Flags: review?(mh+mozilla)
Comment on attachment 8361167 [details] [diff] [review]
bug960544-linking-unittests

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

Thank you
Attachment #8361167 - Flags: review?(mh+mozilla) → review+
It looks like this change breaks GGC builds on windows, which can't find the relocation functions:

test_IHistory.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl JS::HeapCellRelocate(struct js::gc::Cell * *)" (__imp_?HeapCellRelocate@JS@@YAXPAPAUCell@gc@js@@@Z) referenced in function "public: static void __cdecl js::GCMethods<class JSObject *>::relocate(class JSObject * *)" (?relocate@?$GCMethods@PAVJSObject@@@js@@SAXPAPAVJSObject@@@Z)

test_IHistory.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl JS::HeapCellPostBarrier(struct js::gc::Cell * *)" (__imp_?HeapCellPostBarrier@JS@@YAXPAPAUCell@gc@js@@@Z) referenced in function "public: static void __cdecl js::GCMethods<class JSObject *>::postBarrier(class JSObject * *)" (?postBarrier@?$GCMethods@PAVJSObject@@@js@@SAXPAPAVJSObject@@@Z)

test_IHistory.exe : fatal error LNK1120: 2 unresolved externals
Whiteboard: [leave open]
Blocks: 764882
Ok, so I don't really understand what's going on here.  My guess would be that these functions are not being exported on Windows for some reason.

I seem to recall that linking is done differently on Windows though, is that true?  If you've got time to explain to me how all this works that would be much appreciated.
Flags: needinfo?(mh+mozilla)
I can't really tell without looking, and i can't build m-c with generational gc enabled, it fails to build well before your failure.
Flags: needinfo?(mh+mozilla)
My tree might have been too old (less than 2 days old)... it's building now.
Ah I see what's going on. The test is using symbols from the js library, but on windows, it's *not* in libxul. Patch incoming.
With a more appropriate message.
Attachment #8363536 - Flags: review?(gps)
Attachment #8363534 - Attachment is obsolete: true
Attachment #8363534 - Flags: review?(gps)
(In reply to Mike Hommey [:glandium] from comment #9)
Great, thank you for looking into this!
Attachment #8363536 - Flags: review?(gps) → review+
Whiteboard: [leave open]
https://hg.mozilla.org/mozilla-central/rev/dd6721572000
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: