[webkit-dev] jsc bus error EXC_BAD_ACCESS with jsc-only build on Mac

Michael Saboff msaboff at apple.com
Tue Mar 28 08:13:55 PDT 2023


Laurence,

When you try to run the jsc command, are you setting DYLD_FRAMEWORK_PATH to the location of the built frameworks?  You can either set it and export it in your shell environment, e.g.

 % export DYLD_FRAMEWORK_PATH=/Users/lrowe/scratch/WebKit/WebKitBuild/Release

Or prepend the setting of it in your command string:

 % DYLD_FRAMEWORK_PATH=/Users/lrowe/scratch/WebKit/WebKitBuild/Release lldb ./WebKitBuild/Release/bin/jsc

I that doesn’t work, a backtrace at the time of the crash and the output of the lldb command “image list” would be helpful.

- Michael


> On Mar 27, 2023, at 11:11 PM, Laurence Rowe via webkit-dev <webkit-dev at lists.webkit.org> wrote:
> 
> Hi, I’m trying to build jsc on my M1 Mac following the instructions at https://trac.webkit.org/wiki/JSCOnly and https://webkit.org/getting-started/ . However when I run the built binary it exits immediately with a bus error which lldb shows to be EXC_BAD_ACCESS.
> 
> lrowe at Laurences-MacBook-Air WebKit % git reset --hard origin/main
> HEAD is now at b2362a5d6b [UI-side compositing] Safari occasionally crashes when scrolling underneath `NSScrollerImpPair` https://bugs.webkit.org/show_bug.cgi?id=254484 rdar://107139674
> lrowe at Laurences-MacBook-Air WebKit % git clean -Xf
> lrowe at Laurences-MacBook-Air WebKit % sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
> lrowe at Laurences-MacBook-Air WebKit % Tools/Scripts/build-jsc --jsc-only
> # build log below
> lrowe at Laurences-MacBook-Air WebKit % ./WebKitBuild/Release/bin/jsc     
> zsh: bus error  ./WebKitBuild/Release/bin/jsc
> 
> lrowe at Laurences-MacBook-Air WebKit % lldb ./WebKitBuild/Release/bin/jsc
> (lldb) target create "./WebKitBuild/Release/bin/jsc"
> Current executable set to '/Users/lrowe/scratch/WebKit/WebKitBuild/Release/bin/jsc' (arm64).
> (lldb) run
> Process 73062 launched: '/Users/lrowe/scratch/WebKit/WebKitBuild/Release/bin/jsc' (arm64)
> Process 73062 stopped
> * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=2, address=0x10d5ac000)
>     frame #0: 0x00000001a1b43f78 libsystem_platform.dylib`_platform_memmove + 168
> libsystem_platform.dylib`:
> ->  0x1a1b43f78 <+168>: stp    q2, q3, [x0]
>     0x1a1b43f7c <+172>: subs   x2, x2, #0x40
>     0x1a1b43f80 <+176>: b.ls <http://b.ls/>   0x1a1b43f9c               ; <+204>
>     0x1a1b43f84 <+180>: stp    q0, q1, [x3]
> Target 0: (jsc) stopped.
> 
> Versions:
> WebKit main (b2362a5d6b)
> Xcode 14.2 (14C18)
> macOS 13.2.1
> CMake.app 3.26.1 (not mentioned at https://webkit.org/build-tools/ but required)
> 
> I’ve also tried variously with Xcode command line tools, homebrew cmake, WebKit tag WebKit-7615.1.26.10.23, and adding the —debug flag to the build but I see the same error.
> 
> Is there anything else I should be doing to build jsc?
> 
> Thanks,
> 
> Laurence Rowe
> 
> 
> # build log
> +  cmake --build /Users/lrowe/scratch/WebKit/WebKitBuild/Release --config Release -- jsc testb3 testair testapi testmasm testdfg -j8
> [  0%] Built target JavaScriptCore_CopyHeaders
> [  1%] Built target JavaScriptCoreSharedScripts
> [  1%] Built target JSCBuiltins
> [  1%] Built target Bytecodes
> [ 35%] Built target WTF_CopyHeaders
> [ 38%] Built target bmalloc_CopyHeaders
> [ 46%] Built target bmalloc
> [ 53%] Built target WTF
> [ 53%] Built target LLIntSettingsExtractor
> [ 53%] Building CXX object Source/JavaScriptCore/CMakeFiles/LLIntOffsetsExtractor.dir/llint/LLIntOffsetsExtractor.cpp.o
> [ 53%] Linking CXX executable ../../bin/LLIntOffsetsExtractor
> [ 53%] Built target LLIntOffsetsExtractor
> [ 53%] Generating ../../JavaScriptCore/DerivedSources/LLIntAssembly.h
> [ 53%] Building CXX object Source/JavaScriptCore/CMakeFiles/LowLevelInterpreterLib.dir/llint/LowLevelInterpreter.cpp.o
> [ 53%] Built target LowLevelInterpreterLib
> [ 53%] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-f0a787a9-7.cpp.o
> [ 53%] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-f0a787a9-11.cpp.o
> [ 53%] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-bfc896e1-4.cpp.o
> [ 53%] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-bfc896e1-3.cpp.o
> [ 53%] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-bfc896e1-9.cpp.o
> [ 53%] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/dfg/DFGSpeculativeJIT.cpp.o
> [ 54%] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/dfg/DFGSpeculativeJIT32_64.cpp.o
> [ 54%] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/dfg/DFGSpeculativeJIT64.cpp.o
> [ 54%] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-bfc896e1-14.cpp.o
> [ 54%] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-02aa2997-1.cpp.o
> [ 54%] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/ftl/FTLLowerDFGToB3.cpp.o
> [ 54%] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-ee8a7a7a-3.cpp.o
> [ 54%] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-0e543b66-1.cpp.o
> [ 54%] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-3a3c4ec0-1.cpp.o
> [ 54%] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-f2e18ffc-21.cpp.o
> [ 54%] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-f2e18ffc-34.cpp.o
> [ 54%] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-f2e18ffc-42.cpp.o
> [ 54%] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/wasm/WasmAirIRGenerator32_64.cpp.o
> [ 54%] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/wasm/WasmAirIRGenerator64.cpp.o
> [ 54%] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-0284c6ac-1.cpp.o
> [ 55%] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/wasm/WasmBBQJIT.cpp.o
> [ 55%] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-15db4ad9-1.cpp.o
> [ 55%] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-15db4ad9-2.cpp.o
> [ 55%] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-15db4ad9-3.cpp.o
> [ 55%] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-15db4ad9-4.cpp.o
> [ 55%] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-15db4ad9-5.cpp.o
> [ 55%] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-15db4ad9-6.cpp.o
> [ 55%] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-15db4ad9-7.cpp.o
> [ 55%] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-15db4ad9-8.cpp.o
> [ 55%] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-15db4ad9-9.cpp.o
> [ 55%] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-15db4ad9-10.cpp.o
> [ 55%] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-15db4ad9-11.cpp.o
> [ 55%] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-15db4ad9-12.cpp.o
> [ 55%] Linking CXX shared library ../../lib/JavaScriptCore.framework/JavaScriptCore
> [ 66%] Built target JavaScriptCore
> [ 66%] Generating ../../JavaScriptCore/PrivateHeaders/JavaScriptCore/WasmCallee.h
> [100%] Built target JavaScriptCore_CopyPrivateHeaders
> [100%] Building CXX object Source/JavaScriptCore/shell/CMakeFiles/jsc.dir/__/jsc.cpp.o
> [100%] Linking CXX executable ../../../bin/jsc
> [100%] Built target jsc
> [  0%] Built target Bytecodes
> [  1%] Built target JavaScriptCoreSharedScripts
> [  1%] Built target JavaScriptCore_CopyHeaders
> [  1%] Built target JSCBuiltins
> [ 21%] Built target WTF_CopyHeaders
> [ 38%] Built target bmalloc_CopyHeaders
> [ 46%] Built target bmalloc
> [ 53%] Built target WTF
> [ 53%] Built target LLIntSettingsExtractor
> [ 53%] Built target LLIntOffsetsExtractor
> [ 53%] Built target LowLevelInterpreterLib
> [ 66%] Built target JavaScriptCore
> [100%] Built target JavaScriptCore_CopyPrivateHeaders
> [100%] Linking CXX executable ../../../bin/testb3
> [100%] Built target testb3
> [  1%] Built target JavaScriptCoreSharedScripts
> [  1%] Built target JavaScriptCore_CopyHeaders
> [  1%] Built target Bytecodes
> [ 18%] Built target WTF_CopyHeaders
> [ 18%] Built target JSCBuiltins
> [ 38%] Built target bmalloc_CopyHeaders
> [ 46%] Built target bmalloc
> [ 53%] Built target WTF
> [ 53%] Built target LLIntSettingsExtractor
> [ 53%] Built target LLIntOffsetsExtractor
> [ 53%] Built target LowLevelInterpreterLib
> [ 66%] Built target JavaScriptCore
> [100%] Built target JavaScriptCore_CopyPrivateHeaders
> [100%] Linking CXX executable ../../../bin/testair
> [100%] Built target testair
> [  0%] Built target Bytecodes
> [  0%] Built target JavaScriptCore_CopyHeaders
> [  1%] Built target JavaScriptCoreSharedScripts
> [  1%] Built target JSCBuiltins
> [ 37%] Built target WTF_CopyHeaders
> [ 38%] Built target bmalloc_CopyHeaders
> [ 45%] Built target bmalloc
> [ 53%] Built target WTF
> [ 53%] Built target LLIntSettingsExtractor
> [ 53%] Built target LLIntOffsetsExtractor
> [ 53%] Built target LowLevelInterpreterLib
> [ 65%] Built target JavaScriptCore
> [ 98%] Built target JavaScriptCore_CopyPrivateHeaders
> [ 98%] Linking CXX executable ../../../bin/testapi
> [100%] Built target testapi
> [  1%] Built target JavaScriptCoreSharedScripts
> [  1%] Built target JavaScriptCore_CopyHeaders
> [  1%] Built target JSCBuiltins
> [  1%] Built target Bytecodes
> [ 21%] Built target bmalloc_CopyHeaders
> [ 38%] Built target WTF_CopyHeaders
> [ 45%] Built target bmalloc
> [ 53%] Built target WTF
> [ 53%] Built target LLIntSettingsExtractor
> [ 53%] Built target LLIntOffsetsExtractor
> [ 53%] Built target LowLevelInterpreterLib
> [ 65%] Built target JavaScriptCore
> [ 98%] Built target JavaScriptCore_CopyPrivateHeaders
> [100%] Linking CXX executable ../../../bin/testmasm
> [100%] Built target testmasm
> [  1%] Built target JavaScriptCoreSharedScripts
> [  1%] Built target JavaScriptCore_CopyHeaders
> [  1%] Built target JSCBuiltins
> [  1%] Built target Bytecodes
> [ 36%] Built target WTF_CopyHeaders
> [ 38%] Built target bmalloc_CopyHeaders
> [ 46%] Built target bmalloc
> [ 53%] Built target WTF
> [ 53%] Built target LLIntSettingsExtractor
> [ 53%] Built target LLIntOffsetsExtractor
> [ 53%] Built target LowLevelInterpreterLib
> [ 66%] Built target JavaScriptCore
> [100%] Built target JavaScriptCore_CopyPrivateHeaders
> [100%] Linking CXX executable ../../../bin/testdfg
> [100%] Built target testdfg
> 
> ====================================================================
>  JavaScriptCore is now built (01m:00s). 
> ====================================================================
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> https://lists.webkit.org/mailman/listinfo/webkit-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20230328/59882e69/attachment.htm>


More information about the webkit-dev mailing list