Tcl Source Code

View Ticket
Login
Ticket UUID: 8d71525c18790b56123a186efd19500b80ac387c
Title: expect 5.45.4 + tcl 8.6.13 segfault on macOS 13 (Ventura)
Type: Bug Created on: 2023-02-17 13:27:38
Submitter: fxcoudert Assigned to: nobody
Subsystem: 45. Parsing and Eval Severity: Severe
Priority: 5 Medium Last modified: 2023-02-17 13:27:38
Status: Open Closed by: nobody
Resolution: None Closed on:
Version: 8.6.13
Description:
The crash was observed within Homebrew testing: https://github.com/Homebrew/homebrew-core/issues/122541 and https://github.com/Homebrew/homebrew-core/pull/123513

It occurs only on macOS 13 (not earlier versions) and for ARM processors.

$ expect -v                                   
expect version 5.45.4
$ echo "exec true; puts Done" | expect                  
child killed: segmentation violation
    while executing
"exec true"


The backtrace is the following:

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x03c9039c00840081 -> 0xffff839c00840081 (possible pointer authentication failure)
Exception Codes:       0x0000000000000001, 0x03c9039c00840081

Termination Reason:    Namespace SIGNAL, Code 11 Segmentation fault: 11
Terminating Process:   exc handler [91230]

VM Region Info: 0xffff839c00840081 is not in any region.  Bytes after previous region: 18446501751126491266  
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      MALLOC_NANO (reserved)   600018000000-600020000000 [128.0M] rw-/rwx SM=NUL  ...(unallocated)
--->  
      UNUSED SPACE AT END

Application Specific Information:
crashed on child side of fork pre-exec


Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   dyld                          	       0x1a9536dc8 dyld4::APIs::_dyld_fork_child() + 48
1   dyld                          	       0x1a9536db0 dyld4::APIs::_dyld_fork_child() + 24
2   libSystem.B.dylib             	       0x1b4ee1a50 libSystem_atfork_child + 44
3   libsystem_c.dylib             	       0x1a970f9f0 fork + 112
4   libtcl8.6.dylib               	       0x10444566c TclpCreateProcess + 212
5   libtcl8.6.dylib               	       0x10441a744 TclCreatePipeline + 2332
6   libtcl8.6.dylib               	       0x10441aaa8 Tcl_OpenCommandChannel + 80
7   libtcl8.6.dylib               	       0x1043fbecc Tcl_ExecObjCmd + 460
8   libtcl8.6.dylib               	       0x104363104 TclNRRunCallbacks + 80
9   libtcl8.6.dylib               	       0x104364124 TclEvalEx + 1640
10  libtcl8.6.dylib               	       0x104364a58 Tcl_Eval + 40
11  libexpect5.45.4.dylib         	       0x1041c4ad4 exp_interpret_cmdfile + 188
12  expect                        	       0x1040efe0c main + 168
13  dyld                          	       0x1a94ffe50 start + 2544