Closed Bug 1942183 Opened 7 months ago Closed 7 months ago

IntElement types in testSinglyLinkedList and testLinkedList can get confused

Categories

(Core :: JavaScript Engine, defect)

defect

Tracking

()

RESOLVED FIXED
136 Branch
Tracking Status
firefox136 --- fixed

People

(Reporter: bthrall, Assigned: bthrall)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Attached file MOZCONFIG.debug

IntElement and IntElement are both linked into the same executable (jsapi_test).

On my build machine, this appears to be causing confusion in the linker because testSinglyLinkedList is failing on line 36:

> ./mach jsapi-tests testSinglyLinkedList
testSinglyLinkedList
/home/bryan/src/mozilla-unified/js/src/jsapi-tests/testSinglyLinkedList.cpp:36:CHECK failed: list.first()->value == 1
...

There haven't been any other reports that this test is failing that I'm aware of.
Disabling the unified build doesn't change the behavior, nor does disabling sccache or changing the clang++ version (I tried 17 and 19). It happens in the debug build (see attached MOZCONFIG), but not release. If I enable optimizations in debug, the test starts passing again.

The simple answer here is to rename one of the instances of IntElement to avoid the problem.

It was confused at link time with IntElement in testLinkedList.cpp, causing the
tests to fail on some systems.

An alternative approach would be an anonymous namespace, but that would fail to
build if the two files accidentally ended up in the same unified build cpp
file.

Status: NEW → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → 136 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: