Skip to content

Instantly share code, notes, and snippets.

@dckc
Last active August 5, 2021 20:49
Show Gist options
  • Save dckc/b3bf3e28946b1e6b42a67a9bfcdab827 to your computer and use it in GitHub Desktop.
Save dckc/b3bf3e28946b1e6b42a67a9bfcdab827 to your computer and use it in GitHub Desktop.
crash in xsnap heap exhaustion test
{"os":"Linux","name":"xsnap test worker","debug":true,"meteringLimit":0}
let stuff = '1234';
while (true) {
stuff = stuff + stuff;
}
(base) ~/projects/agoric/agoric-sdk/packages/xsnap
15:31 connolly@jambox$ yarn test -v test/test-xs-limits.js -m 'heap exhaustion: orderly fail-stop'
yarn run v1.22.5
$ ava -v test/test-xs-limits.js -m 'heap exhaustion: orderly fail-stop'
✖ heap exhaustion: orderly fail-stop
heap exhaustion: orderly fail-stop
Promise rejected with unexpected exception:
ExitSignal (ErrorSignal) @Error {
code: 'SIGSEGV',
message: 'xsnap test worker exited due to signal SIGSEGV',
}
Expected code to equal:
11
› ChildProcess.<anonymous> (file://src/xsnap.js:116:22)
› Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
1 test failed
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
(base) ~/projects/agoric/agoric-sdk/packages/xsnap
15:31 connolly@jambox$ file core
core: ELF 64-bit LSB core file x86-64, version 1 (SYSV), SVR4-style, from '/home/connolly/projects/agoric/agoric-sdk/packages/xsnap/xsnap-native/xsnap/bui', real uid: 1000, effective uid: 1000, real gid: 1000, effective gid: 1000, execfn: '/home/connolly/projects/agoric/agoric-sdk/packages/xsnap/xsnap-native/xsnap/build/bin/lin/debug/xsnap-worker', platform: 'x86_64'
(base) ~/projects/agoric/agoric-sdk/packages/xsnap
15:31 connolly@jambox$ gdb ./xsnap-native/xsnap/build/bin/lin/debug/xsnap-worker core
GNU gdb (Ubuntu 8.1.1-0ubuntu1) 8.1.1
Copyright (C) 2018 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".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./xsnap-native/xsnap/build/bin/lin/debug/xsnap-worker...done.
[New LWP 30274]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/home/connolly/projects/agoric/agoric-sdk/packages/xsnap/xsnap-native/xsnap/bui'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00007f25980cf8e7 in mprotect () at ../sysdeps/unix/syscall-template.S:78
78 ../sysdeps/unix/syscall-template.S: No such file or directory.
(gdb) bt
#0 0x00007f25980cf8e7 in mprotect () at ../sysdeps/unix/syscall-template.S:78
#1 0x00005615405c6467 in fxAllocateChunks (the=0x561540ce12b0, size=1094717440)
at /home/connolly/projects/agoric/agoric-sdk/packages/xsnap/xsnap-native/xsnap/makefiles/lin/../../sources/xsnapPlatform.c:212
#2 0x00005615405441b2 in fxGrowChunks (the=0x561540ce12b0, size=541065248)
at /home/connolly/projects/agoric/agoric-sdk/packages/xsnap/moddable/xs/sources/xsMemory.c:505
#3 0x00005615405440d7 in fxGrowChunk (the=0x561540ce12b0, size=536870932)
at /home/connolly/projects/agoric/agoric-sdk/packages/xsnap/moddable/xs/sources/xsMemory.c:484
#4 0x0000561540545d3a in fxNewChunk (the=0x561540ce12b0, size=536870932)
at /home/connolly/projects/agoric/agoric-sdk/packages/xsnap/moddable/xs/sources/xsMemory.c:1196
#5 0x00005615404c6d21 in fxConcatString (the=0x561540ce12b0, a=0x561540d001c0, b=0x561540d001a0)
at /home/connolly/projects/agoric/agoric-sdk/packages/xsnap/moddable/xs/sources/xsAll.c:163
#6 0x0000561540588d24 in fxRunID (the=0x561540ce12b0, generator=0x0, count=0)
at /home/connolly/projects/agoric/agoric-sdk/packages/xsnap/moddable/xs/sources/xsRun.c:3213
#7 0x0000561540592b68 in fxRunScript (the=0x561540ce12b0, script=0x561540d0e630, _this=0x7f25577cf650, _target=0x0,
closures=0x7f25577cf670, object=0x0, module=0x7f25577b3030)
at /home/connolly/projects/agoric/agoric-sdk/packages/xsnap/moddable/xs/sources/xsRun.c:4756
#8 0x0000561540529323 in fx_eval (the=0x561540ce12b0)
---Type <return> to continue, or q <return> to quit---
at /home/connolly/projects/agoric/agoric-sdk/packages/xsnap/moddable/xs/sources/xsGlobal.c:538
#9 0x0000561540575d1b in fxRunID (the=0x561540ce12b0, generator=0x0, count=1)
at /home/connolly/projects/agoric/agoric-sdk/packages/xsnap/moddable/xs/sources/xsRun.c:842
#10 0x00005615404cabb1 in fxRunCount (the=0x561540ce12b0, count=1)
at /home/connolly/projects/agoric/agoric-sdk/packages/xsnap/moddable/xs/sources/xsAPI.c:1127
#11 0x00005615405d0119 in main (argc=2, argv=0x7fff5d879a98)
at /home/connolly/projects/agoric/agoric-sdk/packages/xsnap/xsnap-native/xsnap/makefiles/lin/../../sources/xsnap-worker.c:303
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment