> Penguin: > > Can you try building bash with AddressSanitizer and provide the crash report > printed to the terminal from such a build? > > Build bash as follows: > > git clone --single-branch --depth=1 git://git.savannah.gnu.org/bash.git > cd bash > ./configure -C --without-bash-malloc CFLAGS='-g -O0 -fsanitize=address > -fno-omit-frame-pointer -fno-optimize-sibling-calls' > make -j > > Then run: > > ./bash —norc
Since you said we should move the conversions into here. I’m going to post the full crash report in here (which is very long). (Let me know if you want only which part of the report and I’ll only cut to that part in the future) Crash Report using `./configure -C --without-bash-malloc CFLAGS='-g -O0 -fsanitize=address -fno-o…` ``` ------------------------------------- Translated Report (Full Report Below) ------------------------------------- Process: bash [78048] Path: /Users/USER/*/bash Identifier: bash Version: ??? Code Type: ARM-64 (Native) Parent Process: zsh [70066] Responsible: Terminal [1632] User ID: 501 Date/Time: 2025-08-18 01:58:03.1402 +0800 OS Version: macOS 15.6 (24G84) Report Version: 12 Anonymous UUID: 875DC121-765D-3C39-DDC3-46AD44E82C87 Sleep/Wake UUID: ABAC6246-B22F-4508-B550-F56095E7B65F Time Awake Since Boot: 50000 seconds Time Since Wake: 175 seconds System Integrity Protection: enabled Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000 Exception Codes: 0x0000000000000001, 0x0000000000000000 Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11 Terminating Process: bash [78048] VM Region Info: 0 is not in any region. Bytes before following region: 4305174528 REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL UNUSED SPACE AT START ---> __TEXT 1009bc000-100d84000 [ 3872K] r-x/r-x SM=COW bash Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libsystem_kernel.dylib 0x18eb45da4 __kill + 8 1 bash 0x100b1409c kill_shell + 308 (sig.c:661) 2 bash 0x100b14b70 termsig_handler + 1916 (sig.c:643) 3 bash 0x100b127b0 termsig_sighandler + 816 (sig.c:570) 4 libsystem_platform.dylib 0x18ebb96a4 _sigtramp + 56 5 bash 0x100ca36e8 update_line + 9096 (display.c:2133) 6 bash 0x100c9b2dc rl_redisplay + 27264 (display.c:1368) 7 bash 0x100ca8924 rl_clear_message + 128 (display.c:3194) 8 bash 0x100c93ab0 _rl_isearch_fini + 2396 (isearch.c:311) 9 bash 0x100c930ec _rl_isearch_cleanup + 68 (isearch.c:893) 10 bash 0x100cad22c _rl_state_sigcleanup + 180 (signals.c:599) 11 bash 0x100cad388 rl_free_line_state + 92 (signals.c:616) 12 bash 0x100cabbd8 _rl_handle_signal + 824 (signals.c:221) 13 bash 0x100cab890 _rl_signal_handler + 340 (signals.c:152) 14 bash 0x100cad500 _rl_release_sigint + 156 (signals.c:680) 15 bash 0x100c9d340 rl_redisplay + 35556 (display.c:1712) 16 bash 0x100ca8924 rl_clear_message + 128 (display.c:3194) 17 bash 0x100c93ab0 _rl_isearch_fini + 2396 (isearch.c:311) 18 bash 0x100c930ec _rl_isearch_cleanup + 68 (isearch.c:893) 19 bash 0x100c8a330 rl_search_history + 516 (isearch.c:936) 20 bash 0x100c8a120 rl_reverse_search_history + 40 (isearch.c:135) 21 bash 0x100c43f90 _rl_dispatch_subseq + 1736 (readline.c:941) 22 bash 0x100c42d38 _rl_dispatch + 112 (readline.c:876) 23 bash 0x100c426f8 readline_internal_char + 1880 (readline.c:690) 24 bash 0x100c47948 readline_internal_charloop + 148 (readline.c:737) 25 bash 0x100c4142c readline_internal + 16 (readline.c:749) 26 bash 0x100c41238 readline + 236 (readline.c:387) 27 bash 0x1009d3ddc yy_readline_get + 560 (parse.y:1680) 28 bash 0x1009e88d4 yy_getc + 84 (parse.y:1610) 29 bash 0x1009e5e74 shell_getc + 2324 (parse.y:2551) 30 bash 0x1009e3690 read_token + 888 (parse.y:3612) 31 bash 0x1009d2814 yylex + 952 (parse.y:3078) 32 bash 0x1009c7d94 yyparse + 1688 (y.tab.c:1912) 33 bash 0x1009c7188 parse_command + 996 (eval.c:369) 34 bash 0x1009c66f4 read_command + 844 (eval.c:414) 35 bash 0x1009c58b4 reader_loop + 1736 (eval.c:147) 36 bash 0x1009be8e0 main + 7856 (shell.c:834) 37 dyld 0x18e7deb98 start + 6076 Thread 0 crashed with ARM Thread State (64-bit): x0: 0x0000000000000000 x1: 0x0000000000000000 x2: 0x0000000000000001 x3: 0x000000016f439770 x4: 0x000000016f4397d8 x5: 0x155052575a68fed1 x6: 0x0000000000000000 x7: 0x0000000000000000 x8: 0x0000000000000000 x9: 0x00000001fcb1c6d8 x10: 0x000000016f439380 x11: 0x000000702dea7274 x12: 0x000000702dea7278 x13: 0x000000016f439388 x14: 0x000000016f439380 x15: 0x0000000000000062 x16: 0x0000000000000025 x17: 0x00000001fdb695b8 x18: 0x0000000000000000 x19: 0x000000016f4394e0 x20: 0x000000016f4397d8 x21: 0x00000001fcb25000 x22: 0x0fffffff0009d71d x23: 0x00000001fc894018 x24: 0x00000001fc894150 x25: 0x000000016f443400 x26: 0x0000000000000000 x27: 0x0000000000000000 x28: 0x0000000000000000 fp: 0x000000016f4395f0 lr: 0x0000000100b1409c sp: 0x000000016f4394a0 pc: 0x000000018eb45da4 cpsr: 0x00001000 far: 0x0000000000000000 esr: 0x56000080 Address size fault Binary Images: 0x1009bc000 - 0x100d83fff bash (*) <1e2a8fb3-e579-491b-b00f-06c327eeade2> */bash 0x1013f8000 - 0x10149bfff libclang_rt.asan_osx_dynamic.dylib (*) <b21b5046-5980-3245-8be2-be3e327acbef> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/lib/darwin/libclang_rt.asan_osx_dynamic.dylib 0x18eb3d000 - 0x18eb78653 libsystem_kernel.dylib (*) <6e4a96ad-04b8-3e8a-b91d-087e62306246> /usr/lib/system/libsystem_kernel.dylib 0x18ebb6000 - 0x18ebbde0b libsystem_platform.dylib (*) <fd19a599-8750-31f9-924f-c2810c938371> /usr/lib/system/libsystem_platform.dylib 0x18e7d8000 - 0x18e873577 dyld (*) <3247e185-ced2-36ff-9e29-47a77c23e004> /usr/lib/dyld 0x0 - 0xffffffffffffffff ??? (*) <00000000-0000-0000-0000-000000000000> ??? External Modification Summary: Calls made by other processes targeting this process: task_for_pid: 0 thread_create: 0 thread_set_state: 0 Calls made by this process: task_for_pid: 0 thread_create: 0 thread_set_state: 0 Calls made by all processes on this machine: task_for_pid: 0 thread_create: 0 thread_set_state: 0 VM Region Summary: ReadOnly portion of Libraries: Total=851.4M resident=0K(0%) swapped_out_or_unallocated=851.4M(100%) Writable regions: Total=14.0T written=3228K(0%) resident=3228K(0%) swapped_out=0K(0%) unallocated=14.0T(100%) VIRTUAL REGION REGION TYPE SIZE COUNT (non-coalesced) =========== ======= ======= Activity Tracing 256K 1 Kernel Alloc Once 32K 1 MALLOC 144K 6 MALLOC guard page 96K 6 STACK GUARD 56.0M 1 Sanitizer 6.0T 283 Sanitizer (reserved) 14.0T 70 reserved VM address space (unallocated) Stack 8176K 1 __AUTH 822K 162 __AUTH_CONST 12.8M 296 __DATA 13.5M 279 __DATA_CONST 10.7M 298 __DATA_DIRTY 453K 88 __FONT_DATA 2352 1 __LINKEDIT 618.1M 3 __OBJC_RO 61.4M 1 __OBJC_RW 2396K 1 __TEXT 233.3M 307 __TPRO_CONST 128K 2 mapped file 80K 1 page table in kernel 3228K 1 shared memory 48K 2 =========== ======= ======= TOTAL 20.0T 1811 TOTAL, minus reserved VM space 6.0T 1811 ----------- Full Report ----------- {"app_name":"bash","timestamp":"2025-08-18 01:58:04.00 +0800","app_version":"","slice_uuid":"1e2a8fb3-e579-491b-b00f-06c327eeade2","build_version":"","platform":1,"share_with_app_devs":1,"is_first_party":1,"bug_type":"309","os_version":"macOS 15.6 (24G84)","roots_installed":0,"incident_id":"C02BE0F7-CC11-4C28-97D8-B792E670BF01","name":"bash"} { "uptime" : 50000, "procRole" : "Unspecified", "version" : 2, "userID" : 501, "deployVersion" : 210, "modelCode" : "Mac13,1", "coalitionID" : 1352, "osVersion" : { "train" : "macOS 15.6", "build" : "24G84", "releaseType" : "User" }, "captureTime" : "2025-08-18 01:58:03.1402 +0800", "codeSigningMonitor" : 1, "incident" : "C02BE0F7-CC11-4C28-97D8-B792E670BF01", "pid" : 78048, "translated" : false, "cpuType" : "ARM-64", "roots_installed" : 0, "bug_type" : "309", "procLaunch" : "2025-08-18 01:58:01.7124 +0800", "procStartAbsTime" : 1206474311547, "procExitAbsTime" : 1206508568460, "procName" : "bash", "procPath" : "\/Users\/USER\/*\/bash", "parentProc" : "zsh", "parentPid" : 70066, "coalitionName" : "com.apple.Terminal", "crashReporterKey" : "875DC121-765D-3C39-DDC3-46AD44E82C87", "appleIntelligenceStatus" : {"state":"available"}, "responsiblePid" : 1632, "responsibleProc" : "Terminal", "codeSigningID" : "bash", "codeSigningTeamID" : "", "codeSigningFlags" : 570556929, "codeSigningValidationCategory" : 10, "codeSigningTrustLevel" : 4294967295, "codeSigningAuxiliaryInfo" : 0, "instructionByteStream" : {"beforePC":"9ldHqfhfRqn6Z0Wp\/G9Eqf+DApH\/D1\/WIgCAUgEAABSwBIDSARAA1A==","atPC":"AwEAVH8jA9X9e7+p\/QMAkQni\/5e\/AwCR\/XvBqP8PX9bAA1\/WUASA0g=="}, "bootSessionUUID" : "0A1FB993-4F1C-4CE9-86E4-091D764C7DDE", "wakeTime" : 175, "sleepWakeUUID" : "ABAC6246-B22F-4508-B550-F56095E7B65F", "sip" : "enabled", "vmRegionInfo" : "0 is not in any region. Bytes before following region: 4305174528\n REGION TYPE START - END [ VSIZE] PRT\/MAX SHRMOD REGION DETAIL\n UNUSED SPACE AT START\n---> \n __TEXT 1009bc000-100d84000 [ 3872K] r-x\/r-x SM=COW bash", "exception" : {"codes":"0x0000000000000001, 0x0000000000000000","rawCodes":[1,0],"type":"EXC_BAD_ACCESS","signal":"SIGSEGV","subtype":"KERN_INVALID_ADDRESS at 0x0000000000000000"}, "termination" : {"flags":0,"code":11,"namespace":"SIGNAL","indicator":"Segmentation fault: 11","byProc":"bash","byPid":78048}, "vmregioninfo" : "0 is not in any region. Bytes before following region: 4305174528\n REGION TYPE START - END [ VSIZE] PRT\/MAX SHRMOD REGION DETAIL\n UNUSED SPACE AT START\n---> \n __TEXT 1009bc000-100d84000 [ 3872K] r-x\/r-x SM=COW bash", "extMods" : {"caller":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"system":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"targeted":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"warnings":0}, "faultingThread" : 0, "threads" : [{"triggered":true,"id":1468507,"threadState":{"x":[{"value":0},{"value":0},{"value":1},{"value":6161667952},{"value":6161668056},{"value":1535818008065801937},{"value":0},{"value":0},{"value":0},{"value":8534476504,"symbolLocation":0,"symbol":"_current_pid"},{"value":6161666944},{"value":481806676596},{"value":481806676600},{"value":6161666952},{"value":6161666944},{"value":98},{"value":37},{"value":8551568824},{"value":0},{"value":6161667296},{"value":6161668056},{"value":8534511616,"symbolLocation":4040,"symbol":"_pthread_keys"},{"value":1152921500312524573},{"value":8531820568,"symbolLocation":0,"symbol":"lsl::sMemoryManagerBuffer"},{"value":8531820880,"symbolLocation":96,"symbol":"lsl::sPoolBytes"},{"value":6161708032},{"value":0},{"value":0},{"value":0}],"flavor":"ARM_THREAD_STATE64","lr":{"value":4306583708},"cpsr":{"value":4096},"fp":{"value":6161667568},"sp":{"value":6161667232},"esr":{"value":1442840704,"description":" Address size fault"},"pc":{"value":6689152420,"matchesCrashFrame":1},"far":{"value":0}},"queue":"com.apple.main-thread","frames":[{"imageOffset":36260,"symbol":"__kill","symbolLocation":8,"imageIndex":2},{"imageOffset":1409180,"sourceLine":661,"sourceFile":"sig.c","symbol":"kill_shell","imageIndex":0,"symbolLocation":308},{"imageOffset":1411952,"sourceLine":643,"sourceFile":"sig.c","symbol":"termsig_handler","imageIndex":0,"symbolLocation":1916},{"imageOffset":1402800,"sourceLine":570,"sourceFile":"sig.c","symbol":"termsig_sighandler","imageIndex":0,"symbolLocation":816},{"imageOffset":13988,"symbol":"_sigtramp","symbolLocation":56,"imageIndex":3},{"imageOffset":3045096,"sourceLine":2133,"sourceFile":"display.c","symbol":"update_line","imageIndex":0,"symbolLocation":9096},{"imageOffset":3011292,"sourceLine":1368,"sourceFile":"display.c","symbol":"rl_redisplay","imageIndex":0,"symbolLocation":27264},{"imageOffset":3066148,"sourceLine":3194,"sourceFile":"display.c","symbol":"rl_clear_message","imageIndex":0,"symbolLocation":128},{"imageOffset":2980528,"sourceLine":311,"sourceFile":"isearch.c","symbol":"_rl_isearch_fini","imageIndex":0,"symbolLocation":2396},{"imageOffset":2978028,"sourceLine":893,"sourceFile":"isearch.c","symbol":"_rl_isearch_cleanup","imageIndex":0,"symbolLocation":68},{"imageOffset":3084844,"sourceLine":599,"sourceFile":"signals.c","symbol":"_rl_state_sigcleanup","imageIndex":0,"symbolLocation":180},{"imageOffset":3085192,"sourceLine":616,"sourceFile":"signals.c","symbol":"rl_free_line_state","imageIndex":0,"symbolLocation":92},{"imageOffset":3079128,"sourceLine":221,"sourceFile":"signals.c","symbol":"_rl_handle_signal","imageIndex":0,"symbolLocation":824},{"imageOffset":3078288,"sourceLine":152,"sourceFile":"signals.c","symbol":"_rl_signal_handler","imageIndex":0,"symbolLocation":340},{"imageOffset":3085568,"sourceLine":680,"sourceFile":"signals.c","symbol":"_rl_release_sigint","imageIndex":0,"symbolLocation":156},{"imageOffset":3019584,"sourceLine":1712,"sourceFile":"display.c","symbol":"rl_redisplay","imageIndex":0,"symbolLocation":35556},{"imageOffset":3066148,"sourceLine":3194,"sourceFile":"display.c","symbol":"rl_clear_message","imageIndex":0,"symbolLocation":128},{"imageOffset":2980528,"sourceLine":311,"sourceFile":"isearch.c","symbol":"_rl_isearch_fini","imageIndex":0,"symbolLocation":2396},{"imageOffset":2978028,"sourceLine":893,"sourceFile":"isearch.c","symbol":"_rl_isearch_cleanup","imageIndex":0,"symbolLocation":68},{"imageOffset":2941744,"sourceLine":936,"sourceFile":"isearch.c","symbol":"rl_search_history","imageIndex":0,"symbolLocation":516},{"imageOffset":2941216,"sourceLine":135,"sourceFile":"isearch.c","symbol":"rl_reverse_search_history","imageIndex":0,"symbolLocation":40},{"imageOffset":2654096,"sourceLine":941,"sourceFile":"readline.c","symbol":"_rl_dispatch_subseq","imageIndex":0,"symbolLocation":1736},{"imageOffset":2649400,"sourceLine":876,"sourceFile":"readline.c","symbol":"_rl_dispatch","imageIndex":0,"symbolLocation":112},{"imageOffset":2647800,"sourceLine":690,"sourceFile":"readline.c","symbol":"readline_internal_char","imageIndex":0,"symbolLocation":1880},{"imageOffset":2668872,"sourceLine":737,"sourceFile":"readline.c","symbol":"readline_internal_charloop","imageIndex":0,"symbolLocation":148},{"imageOffset":2642988,"sourceLine":749,"sourceFile":"readline.c","symbol":"readline_internal","imageIndex":0,"symbolLocation":16},{"imageOffset":2642488,"sourceLine":387,"sourceFile":"readline.c","symbol":"readline","imageIndex":0,"symbolLocation":236},{"imageOffset":97756,"sourceLine":1680,"sourceFile":"parse.y","symbol":"yy_readline_get","imageIndex":0,"symbolLocation":560},{"imageOffset":182484,"sourceLine":1610,"sourceFile":"parse.y","symbol":"yy_getc","imageIndex":0,"symbolLocation":84},{"imageOffset":171636,"sourceLine":2551,"sourceFile":"parse.y","symbol":"shell_getc","imageIndex":0,"symbolLocation":2324},{"imageOffset":161424,"sourceLine":3612,"sourceFile":"parse.y","symbol":"read_token","imageIndex":0,"symbolLocation":888},{"imageOffset":92180,"sourceLine":3078,"sourceFile":"parse.y","symbol":"yylex","imageIndex":0,"symbolLocation":952},{"imageOffset":48532,"sourceLine":1912,"sourceFile":"y.tab.c","symbol":"yyparse","imageIndex":0,"symbolLocation":1688},{"imageOffset":45448,"sourceLine":369,"sourceFile":"eval.c","symbol":"parse_command","imageIndex":0,"symbolLocation":996},{"imageOffset":42740,"sourceLine":414,"sourceFile":"eval.c","symbol":"read_command","imageIndex":0,"symbolLocation":844},{"imageOffset":39092,"sourceLine":147,"sourceFile":"eval.c","symbol":"reader_loop","imageIndex":0,"symbolLocation":1736},{"imageOffset":10464,"sourceLine":834,"sourceFile":"shell.c","symbol":"main","imageIndex":0,"symbolLocation":7856},{"imageOffset":27544,"symbol":"start","symbolLocation":6076,"imageIndex":4}]}], "usedImages" : [ { "source" : "P", "arch" : "arm64", "base" : 4305174528, "size" : 3964928, "uuid" : "1e2a8fb3-e579-491b-b00f-06c327eeade2", "path" : "*\/bash", "name" : "bash" }, { "source" : "P", "arch" : "arm64e", "base" : 4315906048, "size" : 671744, "uuid" : "b21b5046-5980-3245-8be2-be3e327acbef", "path" : "\/Applications\/Xcode.app\/Contents\/Developer\/Toolchains\/XcodeDefault.xctoolchain\/usr\/lib\/clang\/17\/lib\/darwin\/libclang_rt.asan_osx_dynamic.dylib", "name" : "libclang_rt.asan_osx_dynamic.dylib" }, { "source" : "P", "arch" : "arm64e", "base" : 6689116160, "size" : 243284, "uuid" : "6e4a96ad-04b8-3e8a-b91d-087e62306246", "path" : "\/usr\/lib\/system\/libsystem_kernel.dylib", "name" : "libsystem_kernel.dylib" }, { "source" : "P", "arch" : "arm64e", "base" : 6689611776, "size" : 32268, "uuid" : "fd19a599-8750-31f9-924f-c2810c938371", "path" : "\/usr\/lib\/system\/libsystem_platform.dylib", "name" : "libsystem_platform.dylib" }, { "source" : "P", "arch" : "arm64e", "base" : 6685556736, "size" : 636280, "uuid" : "3247e185-ced2-36ff-9e29-47a77c23e004", "path" : "\/usr\/lib\/dyld", "name" : "dyld" }, { "size" : 0, "source" : "A", "base" : 0, "uuid" : "00000000-0000-0000-0000-000000000000" } ], "sharedCache" : { "base" : 6684721152, "size" : 5040898048, "uuid" : "032c7bce-a479-35b8-97bc-ce7f8f80ccab" }, "vmSummary" : "ReadOnly portion of Libraries: Total=851.4M resident=0K(0%) swapped_out_or_unallocated=851.4M(100%)\nWritable regions: Total=14.0T written=3228K(0%) resident=3228K(0%) swapped_out=0K(0%) unallocated=14.0T(100%)\n\n VIRTUAL REGION \nREGION TYPE SIZE COUNT (non-coalesced) \n=========== ======= ======= \nActivity Tracing 256K 1 \nKernel Alloc Once 32K 1 \nMALLOC 144K 6 \nMALLOC guard page 96K 6 \nSTACK GUARD 56.0M 1 \nSanitizer 6.0T 283 \nSanitizer (reserved) 14.0T 70 reserved VM address space (unallocated)\nStack 8176K 1 \n__AUTH 822K 162 \n__AUTH_CONST 12.8M 296 \n__DATA 13.5M 279 \n__DATA_CONST 10.7M 298 \n__DATA_DIRTY 453K 88 \n__FONT_DATA 2352 1 \n__LINKEDIT 618.1M 3 \n__OBJC_RO 61.4M 1 \n__OBJC_RW 2396K 1 \n__TEXT 233.3M 307 \n__TPRO_CONST 128K 2 \nmapped file 80K 1 \npage table in kernel 3228K 1 \nshared memory 48K 2 \n=========== ======= ======= \nTOTAL 20.0T 1811 \nTOTAL, minus reserved VM space 6.0T 1811 \n", "legacyInfo" : { "threadTriggered" : { "queue" : "com.apple.main-thread" } }, "logWritingSignature" : "ce6592b4350898d9ee20cd4d66981038ed21830e", "trialInfo" : { "rollouts" : [ { "rolloutId" : "64b21a7351cbb02ce3442e4e", "factorPackIds" : { "REMINDERS_GROCERY" : "6647f0f7b6a75d3dc32993e7" }, "deploymentId" : 240000042 }, { "rolloutId" : "6246d6a916a70b047e454124", "factorPackIds" : { }, "deploymentId" : 240000010 } ], "experiments" : [ { "treatmentId" : "f18344bb-554f-48ae-8449-e108a8813a55", "experimentId" : "6685b5584477001000e8c6c9", "deploymentId" : 400000009 } ] } } ```