Closed Bug 968216 Opened 10 years ago Closed 4 months ago

API test failure in debugging mode with zealous GC

Categories

(Core :: JavaScript Engine, defect, P3)

x86
macOS
defect

Tracking

()

RESOLVED FIXED
122 Branch
Tracking Status
firefox122 --- fixed

People

(Reporter: wingo, Assigned: jonco)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Steps to reproduce:

1. Build a normal debugging-mode spidermonkey.
2. Run js/src/jsapi-tests/jsapi-tests with JS_GC_ZEAL=2,10.

Expected results: passes test

Actual results: Fails assertion

Log below:

wingo@rusty:~/src/mozilla-central/js/src/+debug/js/src/jsapi-tests$ JS_GC_ZEAL=2,10 gdb ./jsapi-tests
GNU gdb (GDB) 7.6.1 (Debian 7.6.1-1)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /hack/mozilla-central/js/src/+debug/js/src/jsapi-tests/jsapi-tests...done.
Loading JavaScript value pretty-printers; see js/src/gdb/README.
If they cause trouble, type: disable pretty-printer .* SpiderMonkey
(gdb) r
Starting program: /hack/mozilla-central/js/src/+debug/js/src/jsapi-tests/./jsapi-tests 
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
testXDR_sourceMap
[New Thread 0x7ffff6390700 (LWP 1801)]
[New Thread 0x7ffff7fcd700 (LWP 1802)]
[New Thread 0x7ffff7f4c700 (LWP 1803)]
[New Thread 0x7ffff7ecb700 (LWP 1804)]
[New Thread 0x7ffff5b8f700 (LWP 1805)]
[New Thread 0x7ffff59ff700 (LWP 1806)]
[New Thread 0x7ffff57ff700 (LWP 1807)]
[New Thread 0x7ffff55ff700 (LWP 1808)]
[New Thread 0x7ffff53ff700 (LWP 1809)]
TEST-PASS | testXDR_sourceMap | ok
[Thread 0x7ffff7fcd700 (LWP 1802) exited]
[Thread 0x7ffff7f4c700 (LWP 1803) exited]
[Thread 0x7ffff7ecb700 (LWP 1804) exited]
[Thread 0x7ffff5b8f700 (LWP 1805) exited]
[Thread 0x7ffff59ff700 (LWP 1806) exited]
[Thread 0x7ffff57ff700 (LWP 1807) exited]
[Thread 0x7ffff55ff700 (LWP 1808) exited]
[Thread 0x7ffff53ff700 (LWP 1809) exited]
[Thread 0x7ffff6390700 (LWP 1801) exited]
testXDR_source
[New Thread 0x7ffff6390700 (LWP 1810)]
[New Thread 0x7ffff53ff700 (LWP 1811)]
[New Thread 0x7ffff55ff700 (LWP 1812)]
[New Thread 0x7ffff57ff700 (LWP 1813)]
[New Thread 0x7ffff59ff700 (LWP 1814)]
[New Thread 0x7ffff5b8f700 (LWP 1815)]
[New Thread 0x7ffff7ecb700 (LWP 1816)]
[New Thread 0x7ffff7f4c700 (LWP 1817)]
[New Thread 0x7ffff7fcd700 (LWP 1818)]
TEST-PASS | testXDR_source | ok
[Thread 0x7ffff53ff700 (LWP 1811) exited]
[Thread 0x7ffff55ff700 (LWP 1812) exited]
[Thread 0x7ffff57ff700 (LWP 1813) exited]
[Thread 0x7ffff59ff700 (LWP 1814) exited]
[Thread 0x7ffff5b8f700 (LWP 1815) exited]
[Thread 0x7ffff7ecb700 (LWP 1816) exited]
[Thread 0x7ffff7f4c700 (LWP 1817) exited]
[Thread 0x7ffff7fcd700 (LWP 1818) exited]
[Thread 0x7ffff6390700 (LWP 1810) exited]
testXDR_bug516827
[New Thread 0x7ffff6390700 (LWP 1819)]
[New Thread 0x7ffff7fcd700 (LWP 1820)]
[New Thread 0x7ffff7f4c700 (LWP 1821)]
[New Thread 0x7ffff7ecb700 (LWP 1822)]
[New Thread 0x7ffff5b8f700 (LWP 1823)]
[New Thread 0x7ffff59ff700 (LWP 1824)]
[New Thread 0x7ffff57ff700 (LWP 1825)]
[New Thread 0x7ffff55ff700 (LWP 1826)]
[New Thread 0x7ffff53ff700 (LWP 1827)]
TEST-PASS | testXDR_bug516827 | ok
[Thread 0x7ffff7fcd700 (LWP 1820) exited]
[Thread 0x7ffff7f4c700 (LWP 1821) exited]
[Thread 0x7ffff7ecb700 (LWP 1822) exited]
[Thread 0x7ffff5b8f700 (LWP 1823) exited]
[Thread 0x7ffff59ff700 (LWP 1824) exited]
[Thread 0x7ffff57ff700 (LWP 1825) exited]
[Thread 0x7ffff55ff700 (LWP 1826) exited]
[Thread 0x7ffff53ff700 (LWP 1827) exited]
[Thread 0x7ffff6390700 (LWP 1819) exited]
testXDR_bug506491
[New Thread 0x7ffff6390700 (LWP 1828)]
[New Thread 0x7ffff53ff700 (LWP 1829)]
[New Thread 0x7ffff55ff700 (LWP 1830)]
[New Thread 0x7ffff57ff700 (LWP 1831)]
[New Thread 0x7ffff59ff700 (LWP 1832)]
[New Thread 0x7ffff5b8f700 (LWP 1833)]
[New Thread 0x7ffff7ecb700 (LWP 1834)]
[New Thread 0x7ffff7f4c700 (LWP 1835)]
[New Thread 0x7ffff7fcd700 (LWP 1836)]
TEST-PASS | testXDR_bug506491 | ok
[Thread 0x7ffff53ff700 (LWP 1829) exited]
[Thread 0x7ffff55ff700 (LWP 1830) exited]
[Thread 0x7ffff57ff700 (LWP 1831) exited]
[Thread 0x7ffff59ff700 (LWP 1832) exited]
[Thread 0x7ffff5b8f700 (LWP 1833) exited]
[Thread 0x7ffff7ecb700 (LWP 1834) exited]
[Thread 0x7ffff7f4c700 (LWP 1835) exited]
[Thread 0x7ffff7fcd700 (LWP 1836) exited]
[Thread 0x7ffff6390700 (LWP 1828) exited]
testXDR_principals
[New Thread 0x7ffff6390700 (LWP 1837)]
[New Thread 0x7ffff7fcd700 (LWP 1838)]
[New Thread 0x7ffff7f4c700 (LWP 1839)]
[New Thread 0x7ffff7ecb700 (LWP 1840)]
[New Thread 0x7ffff5b8f700 (LWP 1841)]
[New Thread 0x7ffff59ff700 (LWP 1842)]
[New Thread 0x7ffff57ff700 (LWP 1843)]
[New Thread 0x7ffff55ff700 (LWP 1844)]
[New Thread 0x7ffff53ff700 (LWP 1845)]
TEST-PASS | testXDR_principals | ok
[Thread 0x7ffff7fcd700 (LWP 1838) exited]
[Thread 0x7ffff7f4c700 (LWP 1839) exited]
[Thread 0x7ffff7ecb700 (LWP 1840) exited]
[Thread 0x7ffff5b8f700 (LWP 1841) exited]
[Thread 0x7ffff59ff700 (LWP 1842) exited]
[Thread 0x7ffff57ff700 (LWP 1843) exited]
[Thread 0x7ffff55ff700 (LWP 1844) exited]
[Thread 0x7ffff53ff700 (LWP 1845) exited]
[Thread 0x7ffff6390700 (LWP 1837) exited]
testUTF8_badSurrogate
[New Thread 0x7ffff6390700 (LWP 1846)]
TEST-PASS | testUTF8_badSurrogate | ok
[Thread 0x7ffff6390700 (LWP 1846) exited]
testUTF8_bigUTF8
[New Thread 0x7ffff6390700 (LWP 1847)]
TEST-PASS | testUTF8_bigUTF8 | ok
[Thread 0x7ffff6390700 (LWP 1847) exited]
testUTF8_badUTF8
[New Thread 0x7ffff6390700 (LWP 1848)]
TEST-PASS | testUTF8_badUTF8 | ok
[Thread 0x7ffff6390700 (LWP 1848) exited]
testTypedArrays
[New Thread 0x7ffff6390700 (LWP 1849)]
<no filename>:0:size and count too large
<no filename>:0:size and count too large
<no filename>:0:size and count too large
<no filename>:0:size and count too large
<no filename>:0:size and count too large
<no filename>:0:size and count too large
<no filename>:0:size and count too large
<no filename>:0:size and count too large
<no filename>:0:size and count too large
<no filename>:0:invalid arguments
<no filename>:0:invalid arguments
<no filename>:0:invalid arguments
<no filename>:0:invalid arguments
<no filename>:0:invalid arguments
<no filename>:0:invalid arguments
<no filename>:0:invalid arguments
<no filename>:0:invalid arguments
<no filename>:0:invalid arguments
TEST-PASS | testTypedArrays | ok
[Thread 0x7ffff6390700 (LWP 1849) exited]
testTrap_gc
[New Thread 0x7ffff6390700 (LWP 1850)]
[New Thread 0x7ffff53ff700 (LWP 1851)]
[New Thread 0x7ffff55ff700 (LWP 1852)]
[New Thread 0x7ffff57ff700 (LWP 1853)]
[New Thread 0x7ffff59ff700 (LWP 1854)]
[New Thread 0x7ffff5b8f700 (LWP 1855)]
[New Thread 0x7ffff7ecb700 (LWP 1856)]
[New Thread 0x7ffff7f4c700 (LWP 1857)]
[New Thread 0x7ffff7fcd700 (LWP 1858)]
TEST-PASS | testTrap_gc | ok
[Thread 0x7ffff53ff700 (LWP 1851) exited]
[Thread 0x7ffff55ff700 (LWP 1852) exited]
[Thread 0x7ffff57ff700 (LWP 1853) exited]
[Thread 0x7ffff59ff700 (LWP 1854) exited]
[Thread 0x7ffff5b8f700 (LWP 1855) exited]
[Thread 0x7ffff7ecb700 (LWP 1856) exited]
[Thread 0x7ffff7f4c700 (LWP 1857) exited]
[Thread 0x7ffff7fcd700 (LWP 1858) exited]
[Thread 0x7ffff6390700 (LWP 1850) exited]
testToUint64Large
[New Thread 0x7ffff6390700 (LWP 1859)]
TEST-PASS | testToUint64Large | ok
[Thread 0x7ffff6390700 (LWP 1859) exited]
testToUint32Large
[New Thread 0x7ffff6390700 (LWP 1860)]
TEST-PASS | testToUint32Large | ok
[Thread 0x7ffff6390700 (LWP 1860) exited]
testToInt8
[New Thread 0x7ffff6390700 (LWP 1861)]
TEST-PASS | testToInt8 | ok
[Thread 0x7ffff6390700 (LWP 1861) exited]
testToUint8TwiceUint8Range
[New Thread 0x7ffff6390700 (LWP 1862)]
TEST-PASS | testToUint8TwiceUint8Range | ok
[Thread 0x7ffff6390700 (LWP 1862) exited]
testStructuredClone_string
[New Thread 0x7ffff6390700 (LWP 1863)]
Assertion failure: !cx->isExceptionPending(), at /hack/mozilla-central/js/src/jsapi.cpp:2508

Program received signal SIGSEGV, Segmentation fault.
0x000000000070d0e2 in JS_NewGlobalObject (cx=0x18236e0, clasp=0x177fdc0 <JSAPITest::basicGlobalClass()::c>, principals=principals@entry=0x0, hookOption=hookOption@entry=JS::FireOnNewGlobalHook, options=...)
    at /hack/mozilla-central/js/src/jsapi.cpp:2508
2508	    JS_ASSERT(!cx->isExceptionPending());
(gdb) bt
#0  0x000000000070d0e2 in JS_NewGlobalObject (cx=0x18236e0, clasp=0x177fdc0 <JSAPITest::basicGlobalClass()::c>, principals=principals@entry=0x0, hookOption=hookOption@entry=JS::FireOnNewGlobalHook, options=...)
    at /hack/mozilla-central/js/src/jsapi.cpp:2508
#1  0x0000000000477ffb in JSAPITest::createGlobal (this=0x17dfc20 <cls_testStructuredClone_string_instance>, principals=0x0) at /hack/mozilla-central/js/src/jsapi-tests/tests.cpp:57
#2  0x000000000047f764 in cls_testStructuredClone_string::run (this=0x17dfc20 <cls_testStructuredClone_string_instance>, global=...) at /hack/mozilla-central/js/src/jsapi-tests/testStructuredClone.cpp:50
#3  0x000000000043cf1b in main (argc=<optimized out>, argv=<optimized out>) at /hack/mozilla-central/js/src/jsapi-tests/tests.cpp:98
(gdb) thr apply all bt

Thread 64 (Thread 0x7ffff6390700 (LWP 1863)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007ffff759ae58 in PR_WaitCondVar () from /usr/lib/x86_64-linux-gnu/libnspr4.so
#2  0x0000000000764bd7 in js::GCHelperThread::wait (this=0x180d188, which=<optimized out>) at /hack/mozilla-central/js/src/jsgc.cpp:2496
#3  0x00000000007a50fc in js::GCHelperThread::threadLoop (this=0x180d188) at /hack/mozilla-central/js/src/jsgc.cpp:2521
#4  0x00007ffff75a0161 in ?? () from /usr/lib/x86_64-linux-gnu/libnspr4.so
#5  0x00007ffff7bc6e0e in start_thread (arg=0x7ffff6390700) at pthread_create.c:311
#6  0x00007ffff66820fd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

Thread 1 (Thread 0x7ffff7fcf740 (LWP 1797)):
#0  0x000000000070d0e2 in JS_NewGlobalObject (cx=0x18236e0, clasp=0x177fdc0 <JSAPITest::basicGlobalClass()::c>, principals=principals@entry=0x0, hookOption=hookOption@entry=JS::FireOnNewGlobalHook, options=...)
    at /hack/mozilla-central/js/src/jsapi.cpp:2508
#1  0x0000000000477ffb in JSAPITest::createGlobal (this=0x17dfc20 <cls_testStructuredClone_string_instance>, principals=0x0) at /hack/mozilla-central/js/src/jsapi-tests/tests.cpp:57
#2  0x000000000047f764 in cls_testStructuredClone_string::run (this=0x17dfc20 <cls_testStructuredClone_string_instance>, global=...) at /hack/mozilla-central/js/src/jsapi-tests/testStructuredClone.cpp:50
#3  0x000000000043cf1b in main (argc=<optimized out>, argv=<optimized out>) at /hack/mozilla-central/js/src/jsapi-tests/tests.cpp:98
(gdb)
There are other tests that you can cause to fail with other JS_GC_ZEAL settings.  For example 2,1 kills testParseJSON.
Severity: normal → S3

Jon, is this something we want to support at all?

As of today testGCOutOfMemory does not seems to end after a few minutes.

Flags: needinfo?(jcoppeard)

Yes, our JSAPI tests should pass regardless of how much GC happens.

For tests where this interferes with the test itself it can be disabled with AutoLeaveZeal.

Flags: needinfo?(jcoppeard)
Severity: S3 → S4
Priority: -- → P3

This turns off zeal mode for a test that intentionally uses an unrooted hash
map, which is not expected to work if there's a GC in the middle of it.

All other tests pass nowadays.

Assignee: nobody → jcoppeard
Status: NEW → ASSIGNED
Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/20465d0fe27a
Fix JSAPI test that failes with GC zeal r=jandem
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 122 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: