Issue #14734 has been updated by shyouhei (Shyouhei Urabe).

Status changed from Open to Third Party's Issue

OK, could reproduce without ruby.  Filed an issue in GCC bugzilla.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85644

----------------------------------------
Bug #14734: trunk + gcc-8 + mac SEGV
https://bugs.ruby-lang.org/issues/14734#change-71834

* Author: shyouhei (Shyouhei Urabe)
* Status: Third Party's Issue
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.6.0dev (2018-05-03 trunk 63333) [x86_64-darwin15]
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
- ruby 2.6.0dev (2018-05-03 trunk 63333) [x86_64-darwin15]
- gcc-8 (Homebrew GCC 8.1.0) 8.1.0
- Mac OS X 10.11.6 Build 15G20015

Might perhaps be a gcc issue but report here anyways.  I see this immediate SEGV at process startup:

```
zsh % lldb -- ./miniruby -v
(lldb) target create "./miniruby"
Current executable set to './miniruby' (x86_64).
(lldb) settings set -- target.run-args  "-v"
(lldb) run
Process 57317 launched: './miniruby' (x86_64)
Process 57317 stopped
* thread #1: tid = 0x14d3fc, 0x00000001001d5b6e miniruby`rb_intern3(name="__autoload__", len=12, enc=0x00000001007028e0) + 20 at symbol.c:592, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    frame #0: 0x00000001001d5b6e miniruby`rb_intern3(name="__autoload__", len=12, enc=0x00000001007028e0) + 20 at symbol.c:592
   589
   590  ID
   591  rb_intern3(const char *name, long len, rb_encoding *enc)
-> 592  {
   593      VALUE sym;
   594      struct RString fake_str;
   595      VALUE str = rb_setup_fake_str(&fake_str, name, len, enc);
(lldb) bt
* thread #1: tid = 0x14d3fc, 0x00000001001d5b6e miniruby`rb_intern3(name="__autoload__", len=12, enc=0x00000001007028e0) + 20 at symbol.c:592, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
  * frame #0: 0x00000001001d5b6e miniruby`rb_intern3(name="__autoload__", len=12, enc=0x00000001007028e0) + 20 at symbol.c:592
    frame #1: 0x00000001001d5d51 miniruby`rb_intern2(name="__autoload__", len=12) + 43 at symbol.c:643
    frame #2: 0x00000001002001a8 miniruby`Init_var_tables + 50 at variable.c:55
    frame #3: 0x00000001000a8e38 miniruby`rb_call_inits + 24 at inits.c:22
    frame #4: 0x000000010007ea77 miniruby`ruby_setup + 229 at eval.c:72
    frame #5: 0x000000010007eac4 miniruby`ruby_init + 13 at eval.c:89
    frame #6: 0x0000000100000f2c miniruby`main(argc=2, argv=0x00007fff5fbfdbf8) + 88 at main.c:41
    frame #7: 0x00007fff966975ad libdyld.dylib`start + 1
    frame #8: 0x00007fff966975ad libdyld.dylib`start + 1
(lldb) disassemble -n rb_intern3
miniruby`rb_intern3:
    0x1001d5b5a <+0>:   pushq  %rbp
    0x1001d5b5b <+1>:   movq   %rsp, %rbp
    0x1001d5b5e <+4>:   subq   $0x60, %rsp
    0x1001d5b62 <+8>:   movq   %rdi, -0x48(%rbp)
    0x1001d5b66 <+12>:  movq   %rsi, -0x50(%rbp)
    0x1001d5b6a <+16>:  movq   %rdx, -0x58(%rbp)
->  0x1001d5b6e <+20>:  movq   %fs:0x0, %rax
    0x1001d5b77 <+29>:  movq   %rax, -0x8(%rbp)
    0x1001d5b7b <+33>:  xorl   %eax, %eax
    0x1001d5b7d <+35>:  movq   -0x58(%rbp), %rcx
    0x1001d5b81 <+39>:  movq   -0x50(%rbp), %rdx
    0x1001d5b85 <+43>:  movq   -0x48(%rbp), %rsi
    0x1001d5b89 <+47>:  leaq   -0x30(%rbp), %rax
    0x1001d5b8d <+51>:  movq   %rax, %rdi
    0x1001d5b90 <+54>:  callq  0x1001b1a62               ; rb_setup_fake_str at string.c:372
    0x1001d5b95 <+59>:  movq   %rax, -0x40(%rbp)
    0x1001d5b99 <+63>:  movq   -0x40(%rbp), %rax
    0x1001d5b9d <+67>:  movq   %rax, %rdi
    0x1001d5ba0 <+70>:  callq  0x1001d3978               ; rb_obj_freeze_inline at ruby.h:1316
    0x1001d5ba5 <+75>:  movq   -0x40(%rbp), %rax
    0x1001d5ba9 <+79>:  movq   %rax, %rdi
    0x1001d5bac <+82>:  callq  0x1001d5abd               ; lookup_str_sym at symbol.c:569
    0x1001d5bb1 <+87>:  movq   %rax, -0x38(%rbp)
    0x1001d5bb5 <+91>:  cmpq   $0x0, -0x38(%rbp)
    0x1001d5bba <+96>:  je     0x1001d5bca               ; <+112> at symbol.c:600
    0x1001d5bbc <+98>:  movq   -0x38(%rbp), %rax
    0x1001d5bc0 <+102>: movq   %rax, %rdi
    0x1001d5bc3 <+105>: callq  0x1001d5f14               ; rb_sym2id at symbol.c:736
    0x1001d5bc8 <+110>: jmp    0x1001d5bf6               ; <+156> at symbol.c:602
    0x1001d5bca <+112>: movq   -0x58(%rbp), %rdx
    0x1001d5bce <+116>: movq   -0x50(%rbp), %rcx
    0x1001d5bd2 <+120>: movq   -0x48(%rbp), %rax
    0x1001d5bd6 <+124>: movq   %rcx, %rsi
    0x1001d5bd9 <+127>: movq   %rax, %rdi
    0x1001d5bdc <+130>: callq  0x1001b2aeb               ; rb_enc_str_new at string.c:783
    0x1001d5be1 <+135>: movq   %rax, -0x40(%rbp)
    0x1001d5be5 <+139>: movq   -0x40(%rbp), %rax
    0x1001d5be9 <+143>: movl   $0x1, %esi
    0x1001d5bee <+148>: movq   %rax, %rdi
    0x1001d5bf1 <+151>: callq  0x1001d5c4e               ; intern_str at symbol.c:620
    0x1001d5bf6 <+156>: movq   -0x8(%rbp), %rcx
    0x1001d5bfa <+160>: xorq   %fs:0x0, %rcx
    0x1001d5c03 <+169>: je     0x1001d5c0a               ; <+176> at symbol.c:602
    0x1001d5c05 <+171>: callq  0x100239c70               ; symbol stub for: __stack_chk_fail
    0x1001d5c0a <+176>: leave
    0x1001d5c0b <+177>: retq

(lldb) register read
General Purpose Registers:
       rax = 0x0000000100256ef0  "__autoload__"
       rbx = 0x0000000000000000
       rcx = 0x000000000000000c
       rdx = 0x00000001007028e0
       rdi = 0x0000000100256ef0  "__autoload__"
       rsi = 0x000000000000000c
       rbp = 0x00007fff5fbfda30
       rsp = 0x00007fff5fbfd9d0
        r8 = 0x0000000000000001
        r9 = 0x0000000000000030
       r10 = 0x0000000100700000
       r11 = 0x0000000000000000
       r12 = 0x0000000000000000
       r13 = 0x0000000000000000
       r14 = 0x0000000000000000
       r15 = 0x0000000000000000
       rip = 0x00000001001d5b6e  miniruby`rb_intern3 + 20 at symbol.c:592
    rflags = 0x0000000000010202
        cs = 0x000000000000002b
        fs = 0x0000000000000000
        gs = 0x0000000000000000

(lldb)
```



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>