Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

Test: crashes when running unit tests on iOS with the test app #100

Open
orangemocha opened this issue Jan 26, 2017 · 4 comments
Open

Test: crashes when running unit tests on iOS with the test app #100

orangemocha opened this issue Jan 26, 2017 · 4 comments
Assignees

Comments

@orangemocha
Copy link

When doing runs of all available unit tests using our new iOS test app, it's not uncommon to run into crashes. These happen in various random tests but they are likely the product of a corruption that happened somewhere before during the run.

Symptoms include:

  • Assertion failure: (ptrBits & 0x7) in SpiderMonkey in debug builds (indicating a GC corruption)
  • EXC_BAD_ACCESS in release builds (this could be a consequence of the above assertion failure)
  • sigabort in libuv
@enricogior enricogior self-assigned this Jan 27, 2017
@enricogior enricogior changed the title Crashes when running unit tests on iOS with the test app Test: crashes when running unit tests on iOS with the test app Jan 27, 2017
@orangemocha
Copy link
Author

On iPhone 7 plus (10.2) simulator, debug build:

In test-querystring.js and test-repl-.save.load.js, but probably random

Destroying JXcore engine
JS API usage error: found live context at 0x7fbd9155b690
JS API usage error: 1 context left in runtime upon JS_DestroyRuntime.

Assertion failure: isEmpty(), at ../deps/mozjs/incs/mozilla/LinkedList.h:305
#0	0x00000001104d1791 in mozilla::LinkedList<JSContext>::~LinkedList() at /Users/alexis/github/jxcore/out/../deps/mozjs/incs/mozilla/LinkedList.h:305
#1	0x00000001104cccf5 in mozilla::LinkedList<JSContext>::~LinkedList() at /Users/alexis/github/jxcore/out/../deps/mozjs/incs/mozilla/LinkedList.h:305
#2	0x00000001104cc7e4 in JSRuntime::~JSRuntime() at /Users/alexis/github/jxcore/out/../deps/mozjs/src/vm/Runtime.cpp:451
#3	0x00000001104ccdf5 in JSRuntime::~JSRuntime() at /Users/alexis/github/jxcore/out/../deps/mozjs/src/vm/Runtime.cpp:345
#4	0x00000001101f1c40 in void js_delete<JSRuntime>(JSRuntime*) at /Users/alexis/github/jxcore/out/../deps/mozjs/incs/js/Utility.h:519
#5	0x00000001101f1c15 in JS_DestroyRuntime(JSRuntime*) at /Users/alexis/github/jxcore/out/../deps/mozjs/src/jsapi.cpp:672
#6	0x000000010fbc6af8 in jxcore::JXEngine::Destroy() at /Users/alexis/github/jxcore/out/../src/jxcore.cc:965
#7	0x000000010fbc2912 in ::JX_StopEngine() at /Users/alexis/github/jxcore/out/../src/public/jx.cc:406
#8	0x000000010fb1214a in +[JXcore startChildEngine] at /Users/alexis/github/jxcore/tools/ios-test/iOS-Test/iOS-Test/JXcore.m:351
#9	0x000000010fb1226f in JXcoreProxy_CB at /Users/alexis/github/jxcore/tools/ios-test/iOS-Test/iOS-Test/jxcore-callback.h:17
#10	0x00000001105ab75c in nspr::Thread::ThreadRoutine(void*) at /Users/alexis/github/jxcore/out/../deps/mozjs/src/vm/PosixNSPR.cpp:45
#11	0x000000011495d99d in _pthread_body ()
#12	0x000000011495d91a in _pthread_start ()
#13	0x000000011495b351 in thread_start ()

@orangemocha
Copy link
Author

iPhone 5 (10.2) simulator, release build:

Test 590: test-tls-psk-client-noidentity-key.js
EXC_BAD_ACCESS
#0	0x00259a56 in JSObject::setGeneric(JSContext*, JS::Handle<JSObject*>, JS::Handle<JSObject*>, JS::Handle<jsid>, JS::MutableHandle<JS::Value>, bool) ()
#1	0x00259e59 in JS_SetProperty(JSContext*, JS::Handle<JSObject*>, char const*, JS::Handle<JS::Value>) ()
#2	0x000e2067 in MozJS::Value::SetProperty(char const*, JS::Handle<JS::Value>) ()
#3	0x00080be8 in node::UVException(int, char const*, char const*, char const*) ()
#4	0x0009efa5 in node::File::Stat(JSContext*, unsigned int, JS::Value*) ()
#5	0x00331d5d in js::Invoke(JSContext*, JS::CallArgs, js::MaybeConstruct) ()
#6	0x0032e6d7 in Interpret(JSContext*, js::RunState&) ()
#7	0x00328014 in js::RunScript(JSContext*, js::RunState&) ()
#8	0x00331e47 in js::Invoke(JSContext*, JS::CallArgs, js::MaybeConstruct) ()
#9	0x002817c3 in js_fun_apply(JSContext*, unsigned int, JS::Value*) ()
#10	0x00331d5d in js::Invoke(JSContext*, JS::CallArgs, js::MaybeConstruct) ()
#11	0x0032e6d7 in Interpret(JSContext*, js::RunState&) ()
#12	0x00328014 in js::RunScript(JSContext*, js::RunState&) ()
#13	0x00331e47 in js::Invoke(JSContext*, JS::CallArgs, js::MaybeConstruct) ()
#14	0x0033219b in js::Invoke(JSContext*, JS::Value const&, JS::Value const&, unsigned int, JS::Value const*, JS::MutableHandle<JS::Value>) ()
#15	0x0025d275 in JS_CallFunctionValue(JSContext*, JS::Handle<JSObject*>, JS::Handle<JS::Value>, JS::HandleValueArray const&, JS::MutableHandle<JS::Value>) ()
#16	0x000e4117 in MozJS::Value::Call(MozJS::Value const&, int, MozJS::Value*) const ()
#17	0x000c1c32 in node::Load(MozJS::Value) ()
#18	0x000b8697 in jxcore::JXEngine::Start() ()
#19	0x000b6c4a in JX_StartEngine ()
#20	0x0005bc71 in +[TestRunner startChildEngine] at /Users/alexis/github/jxcore/tools/ios-test/iOS-Test/TestRunner.m:347
#21	0x0005bdfa in JXcoreProxy_CB at /Users/alexis/github/jxcore/tools/ios-test/iOS-Test/jxcore-callback.h:17
#22	0x0037a4e7 in nspr::Thread::ThreadRoutine(void*) ()
#23	0x03526780 in _pthread_body ()
#24	0x035266f6 in _pthread_start ()
#25	0x03523f7a in thread_start ()

@orangemocha
Copy link
Author

iPhone 6s plus (9.3) simulator, release build:

2017-01-30 16:52:51.933 iOS-Test[65145:4894196] Test 389: test-net-write-slow.js
Starting JXcore engine
JXcore engine is started
AssertionError: "flushed: 5, received: 393216/2000000" undefined "undefined" ( 0:0)
    at server</< (/Users/enrico/Library/Developer/CoreSimulator/Devices/FF95A09A-F897-4D10-ACEB-53D0F74A1AEF/data/Containers/Bundle/Application/596A1BA4-E789-4242-B377-44709D827D9D/iOS-Test.app/test/simple/test-net-write-slow.js:19:1)
    at emit (events.js:79:1)
    at $f.prototype._onTimeout (net.js:
Assertion failed: (buf.base != NULL), function uv__read, file ../deps/uv/src/unix/stream.c, line 925.


#0    0x000000010c6c9dd6 in __pthread_kill ()
#1    0x000000010c68e787 in pthread_kill ()
#2    0x000000010c417cec in abort ()
#3    0x000000010c3dfbdc in __assert_rtn ()
#4    0x00000001098466c0 in uv__stream_io ()
#5    0x000000010984c319 in uv__io_poll_jx ()
#6    0x0000000109840349 in uv_run_jx ()
#7    0x00000001093b3917 in +[TestRunner startChildEngine] at /Users/enrico/github/jxcore/tools/ios-test/iOS-Test/TestRunner.m:350
#8    0x00000001093b3a6f in JXcoreProxy_CB at /Users/enrico/github/jxcore/tools/ios-test/iOS-Test/jxcore-callback.h:17
#9    0x00000001096e45e7 in nspr::Thread::ThreadRoutine(void*) ()
#10    0x000000010c68baab in _pthread_body ()
#11    0x000000010c68b9f7 in _pthread_start ()
#12    0x000000010c68b1fd in thread_start ()

@orangemocha
Copy link
Author

On iPhone 5s (9.3) simulator and iPhone 7 plus (10.2) simulator, release build:

EXC_BAD_ACCESS
#0	0x000000010f8877cc in MozJS::Isolate::GetRaw() at /Users/alexis/github/jxcore/src/jx/Proxy/Mozilla_340/MozJS/Isolate.h:65
#1	0x000000010f84542d in node::Buffer::Replace(char*, unsigned long, void (*)(char*, void*), void*) at /Users/alexis/github/jxcore/src/wrappers/node_buffer.cc:152
#2	0x000000010f845dcb in node::Buffer::~Buffer() at /Users/alexis/github/jxcore/src/wrappers/node_buffer.cc:142
#3	0x000000010f845ef5 in node::Buffer::~Buffer() at /Users/alexis/github/jxcore/src/wrappers/node_buffer.cc:135
#4	0x000000010f845f19 in node::Buffer::~Buffer() at /Users/alexis/github/jxcore/src/wrappers/node_buffer.cc:135
#5	0x000000010f88aefd in node::ObjectWrap::WeakCallback(JSFreeOp*, JSObject*) at /Users/alexis/github/jxcore/src/jx/Proxy/Mozilla_340/node_object_wrap.h:77
#6	0x000000010f8d0d1f in MozJS::Value::empty_finalize(JSFreeOp*, JSObject*) at /Users/alexis/github/jxcore/src/jx/Proxy/Mozilla_340/MozJS/MozValue.cc:1090
#7	0x000000010fa726ff in unsigned long js::gc::Arena::finalize<JSObject>(js::FreeOp*, js::gc::AllocKind, unsigned long) ()
#8	0x000000010fa6b126 in FinalizeArenas(js::FreeOp*, js::gc::ArenaHeader**, js::gc::SortedArenaList&, js::gc::AllocKind, js::SliceBudget&) ()
#9	0x000000010fa6c040 in js::gc::ArenaLists::queueObjectsForSweep(js::FreeOp*) ()
#10	0x000000010fa6f6f4 in js::gc::GCRuntime::beginSweepingZoneGroup() ()
#11	0x000000010fa6fcd5 in js::gc::GCRuntime::beginSweepPhase(bool) ()
#12	0x000000010fa70e9a in js::gc::GCRuntime::incrementalCollectSlice(long long, JS::gcreason::Reason) ()
#13	0x000000010fa71356 in js::gc::GCRuntime::gcCycle(bool, long long, js::JSGCInvocationKind, JS::gcreason::Reason) ()
#14	0x000000010fa7166d in js::gc::GCRuntime::collect(bool, long long, js::JSGCInvocationKind, JS::gcreason::Reason) ()
#15	0x000000010fb1eb81 in JSRuntime::~JSRuntime() ()
#16	0x000000010fa3c8cd in JS_DestroyRuntime(JSRuntime*) ()
#17	0x000000010f88c698 in jxcore::JXEngine::Destroy() at /Users/alexis/github/jxcore/src/jxcore.cc:965
#18	0x000000010f888482 in ::JX_StopEngine() at /Users/alexis/github/jxcore/src/public/jx.cc:406
#19	0x000000010f7f05ac in +[JXcore startChildEngine] at /Users/alexis/github/jxcore/tools/ios-test/iOS-Test/iOS-Test/JXcore.m:379
#20	0x000000010f7f06df in JXcoreProxy_CB at /Users/alexis/github/jxcore/tools/ios-test/iOS-Test/iOS-Test/jxcore-callback.h:17
#21	0x000000010fb5bffb in nspr::Thread::ThreadRoutine(void*) ()
#22	0x0000000112ba599d in _pthread_body ()
#23	0x0000000112ba591a in _pthread_start ()
#24	0x0000000112ba3351 in thread_start ()

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants