ws-tcp-relay icon indicating copy to clipboard operation
ws-tcp-relay copied to clipboard

Segmentation fault in AMD64 and Intel X86 on OSX M1 chip

Open thetrebor opened this issue 3 years ago • 2 comments

Darwin x86 on M1 (run via: arch -x86_64 ./ws-tcp-relay -p 4222 nats.messaging:4222)

Process:               ws-tcp-relay [21401]
Path:                  /Users/USER/*/ws-tcp-relay
Identifier:            ws-tcp-relay
Version:               ???
Code Type:             X86-64 (Translated)
Parent Process:        zsh [19543]
Responsible:           iTerm2 [535]
User ID:               502

Date/Time:             2021-04-12 15:05:39.982 -0400
OS Version:            macOS 11.2.3 (20D91)
Report Version:        12
Anonymous UUID:        DDCA91AB-B8CA-98E1-CCD5-DFD5664B2528


Time Awake Since Boot: 82000 seconds

System Integrity Protection: enabled

Crashed Thread:        0

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000018
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [21401]

VM Regions Near 0x18:
--> 
    __TEXT                        1000000-1413000      [ 4172K] r-x/rwx SM=COW  /Users/*

Application Specific Information:
dyld2 mode

Thread 0 Crashed:
0   runtime                       	0x00007ffdffed0bb0 0x7ffdffebf000 + 72624
1   ws-tcp-relay                  	0x00000000010579cd runtime.bsdthread_register + 29 (sys_darwin_amd64.s:392)
2   ws-tcp-relay                  	0x000000000102bfb1 runtime.schedinit + 161 (proc.go:482)

Thread 1:: com.apple.rosetta.exceptionserver
0   runtime                       	0x00007ffdffec1238 0x7ffdffebf000 + 8760
1   runtime                       	0x00007ffdffecb354 0x7ffdffebf000 + 50004
2   runtime                       	0x00007ffdffecc1f8 0x7ffdffebf000 + 53752

Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x800000010000fb90   x1: 0x0000000001057970   x2: 0x0000000000000000   x3: 0x0000000000000000
    x4: 0x0000000000000000   x5: 0x0000000000000000   x6: 0x0000000000000000   x7: 0x000000c42000e000
    x8: 0x00007ffdfff34a00   x9: 0x00007ffdfff34a08  x10: 0x0000000000000000  x11: 0x0000000000000080
   x12: 0x0055555555555555  x13: 0x00000000000000f5  x14: 0x0000000000000075  x15: 0x0000000000000028
   x16: 0x000000000000016e  x17: 0x0000000000000000  x18: 0x800000010000fb90  x19: 0x0000000100000000
   x20: 0x00000000000007ff  x21: 0x0000000100014fc0  x22: 0x00000002058bbbf8  x23: 0x00000000018ad224
   x24: 0x0000000001026e60  x25: 0x00000000015041ec  x26: 0x00000000014f9ad4  x27: 0x0000000000000000
   x28: 0x00000000010579cd   fp: 0x00007ffdffed0b98   lr: 0x00000000018ad254
    sp: 0x000000010000fb90   pc: 0x00007ffdffed0bb0 cpsr: 0x80000000
   far: 0x0000000000000018  esr: 0x92000006


Binary Images:
         0x1000000 -          0x1412fff +ws-tcp-relay (???) /Users/USER/*/ws-tcp-relay
       0x1017a5000 -        0x101840fff  dyld (832.7.3) <0D4EA85F-7E30-338B-9215-314A5A5539B6> /usr/lib/dyld
    0x7ffdffebf000 -     0x7ffdfff32fff +runtime (203.30) <C98E75A6-BDC8-3D5C-B95B-6422005E96D8> /Library/Apple/*/runtime

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: 8534930
    thread_create: 0
    thread_set_state: 0

VM Region Summary:
ReadOnly portion of Libraries: Total=5860K resident=0K(0%) swapped_out_or_unallocated=5860K(100%)
Writable regions: Total=150.7M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=150.7M(100%)
 
                                VIRTUAL   REGION 
REGION TYPE                        SIZE    COUNT (non-coalesced) 
===========                     =======  ======= 
Rosetta Arena                     2048K        1 
Rosetta Generic                    584K      143 
Rosetta IndirectBranch              32K        1 
Rosetta JIT                      128.0M        1 
Rosetta Return Stack                20K        2 
Rosetta Thread Context              20K        2 
VM_ALLOCATE                      528.5G        9 
VM_ALLOCATE (reserved)               8K        2         reserved VM address space (unallocated)
__DATA                             640K        6 
__DATA_CONST                        32K        1 
__LINKEDIT                         636K        5 
__TEXT                            5260K        3 
mapped file                        4.7G       12 
===========                     =======  ======= 
TOTAL                            533.3G      188 
TOTAL, minus reserved VM space   533.3G      188 


Darwin amd64

Process:               ws-tcp-relay_darwin_amd64 [21270]
Path:                  /Users/USER/*/ws-tcp-relay_darwin_amd64
Identifier:            ws-tcp-relay_darwin_amd64
Version:               ???
Code Type:             X86-64 (Translated)
Parent Process:        zsh [19543]
Responsible:           iTerm2 [535]
User ID:               502

Date/Time:             2021-04-12 14:58:42.889 -0400
OS Version:            macOS 11.2.3 (20D91)
Report Version:        12
Anonymous UUID:        DDCA91AB-B8CA-98E1-CCD5-DFD5664B2528


Time Awake Since Boot: 82000 seconds

System Integrity Protection: enabled

Crashed Thread:        0

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000018
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [21270]

VM Regions Near 0x18:
--> 
    __TEXT                        1000000-1413000      [ 4172K] r-x/rwx SM=COW  /Users/*

Application Specific Information:
dyld2 mode

Thread 0 Crashed:
0   runtime                       	0x00007ffdffe99bb0 0x7ffdffe88000 + 72624
1   ws-tcp-relay_darwin_amd64     	0x00000000010579cd runtime.bsdthread_register + 29 (sys_darwin_amd64.s:392)
2   ws-tcp-relay_darwin_amd64     	0x000000000102bfb1 runtime.schedinit + 161 (proc.go:482)

Thread 1:: com.apple.rosetta.exceptionserver
0   runtime                       	0x00007ffdffe8a238 0x7ffdffe88000 + 8760
1   runtime                       	0x00007ffdffe94354 0x7ffdffe88000 + 50004
2   runtime                       	0x00007ffdffe951f8 0x7ffdffe88000 + 53752

Thread 0 crashed with unknown flavor: 7, state_count: 4


Binary Images:
         0x1000000 -          0x1412fff +ws-tcp-relay_darwin_amd64 (???) /Users/USER/*/ws-tcp-relay_darwin_amd64
       0x1016ba000 -        0x101755fff  dyld (832.7.3) <0D4EA85F-7E30-338B-9215-314A5A5539B6> /usr/lib/dyld
    0x7ffdffe88000 -     0x7ffdffefbfff +runtime (203.30) <C98E75A6-BDC8-3D5C-B95B-6422005E96D8> /Library/Apple/*/runtime

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: 8479265
    thread_create: 0
    thread_set_state: 0

VM Region Summary:
ReadOnly portion of Libraries: Total=5860K resident=0K(0%) swapped_out_or_unallocated=5860K(100%)
Writable regions: Total=150.7M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=150.7M(100%)
 
                                VIRTUAL   REGION 
REGION TYPE                        SIZE    COUNT (non-coalesced) 
===========                     =======  ======= 
Rosetta Arena                     2048K        1 
Rosetta Generic                    584K      143 
Rosetta IndirectBranch              32K        1 
Rosetta JIT                      128.0M        1 
Rosetta Return Stack                20K        2 
Rosetta Thread Context              20K        2 
VM_ALLOCATE                      528.5G        9 
VM_ALLOCATE (reserved)               8K        2         reserved VM address space (unallocated)
__DATA                             640K        6 
__DATA_CONST                        32K        1 
__LINKEDIT                         636K        5 
__TEXT                            5260K        3 
mapped file                        4.7G       12 
===========                     =======  ======= 
TOTAL                            533.3G      188 
TOTAL, minus reserved VM space   533.3G      188 

thetrebor avatar Apr 12 '21 19:04 thetrebor

Darwin Mac-mini 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:06:51 PST 2021; root:xnu-7195.81.3~1/RELEASE_ARM64_T8101 x86_64

thetrebor avatar Apr 12 '21 19:04 thetrebor

Note: it works if you build from source so this is an issue with the precompiled binaries on this arch. Cheers, thanks for the great tool!

thetrebor avatar Apr 12 '21 20:04 thetrebor