Issue #12396 has been updated by Carla Curtis.


I am also having this issue.  
Ruby 2.1.9
HP-UX B.11.31 U ia64 4067183464
cc: HP C/aC++ B3910B A.06.28 [Nov 21 2013]

I rebuilt replacing +O2 with -g, and gdb tells me:

#0  0x423b1f0:1 in mark_locations_array (objspace=0x40046500, x=0x1000, n=499120527) at gc.c:3297

3293    mark_locations_array(rb_objspace_t *objspace, register VALUE *x, register long n)
3294    {
3295        VALUE v;
3296        while (n--) {
3297            v = *x;
3298            gc_mark_maybe(objspace, v);
3299            x++;
3300        }
3301    }


----------------------------------------
Bug #12396: Compilation crashes with segmentation fault in HP-UX 11.31
https://bugs.ruby-lang.org/issues/12396#change-60302

* Author: Michael Osipov
* Status: Open
* Priority: Normal
* Assignee: 
* ruby -v: 
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
Trying to compile Ruby 2.3.1 from source tarball on "HP-UX blnn724x B.11.31 U ia64 HP-UX" with `export CC=/opt/aCC/bin/aCC` where `aCC` is `aCC: HP C/aC++ B3910B A.06.25.01 [May 17 2010]` and `./configure --prefix=$HOME/ruby`. During compilation I receive the following:


    compiling ./missing/isinf.c
    compiling ./missing/setproctitle.c
    compiling ./missing/strlcat.c
    compiling ./missing/strlcpy.c
    /opt/aCC/bin/aCC -Ae  -g   -c ia64.s
    compiling addr2line.c
    compiling dmyenc.c
    linking miniruby
    generating encdb.h
    ./tool/generic_erb.rb:2: [BUG] Segmentation fault at 0x001000
    ruby 2.3.1p112 (2016-04-26 revision 54768) [ia64-hpux11.31]
    
    -- Control frame information -----------------------------------------------
    c:0003 p:---- s:0025 e:000024 CFUNC  :require
    c:0002 p:0008 s:0021 E:001d4c EVAL   ./tool/generic_erb.rb:2 [FINISH]
    c:0001 p:0000 s:0002 E:001d98 (none) [FINISH]
    
    -- Ruby level backtrace information ----------------------------------------
    ./tool/generic_erb.rb:2:in `<main>'
    ./tool/generic_erb.rb:2:in `require'
    
    -- Other runtime information -----------------------------------------------
    
    * Loaded script: ./tool/generic_erb.rb
    
    * Loaded features:
    
        0 enumerator.so
        1 thread.rb
        2 rational.so
        3 complex.so
    
    [NOTE]
    You may have encountered a bug in the Ruby interpreter or extension libraries.
    Bug reports are welcome.
    For details: http://www.ruby-lang.org/bugreport.html
    
    Makefile:1374: recipe for target 'encdb.h' failed
    gmake: *** [encdb.h] IOT trap (core dumped)


Loading the core dump says:

    Reading symbols from miniruby...done.
    Core was generated by `miniruby'.
    Program terminated with signal 6, Aborted.
    
    #0  0x60000000c020f6d0:0 in _lwp_kill+0x30 ()
       from /usr/lib/hpux32/libpthread.so.1
    (gdb) where
    #0  0x60000000c020f6d0:0 in _lwp_kill+0x30 ()
       from /usr/lib/hpux32/libpthread.so.1
    #1  0x60000000c0174be0:0 in pthread_kill+0x9f0 ()
       from /usr/lib/hpux32/libpthread.so.1
    #2  0x60000000c0403460:0 in raise+0xe0 () from /usr/lib/hpux32/libc.so.1
    #3  0x60000000c05277b0:0 in abort+0x170 () from /usr/lib/hpux32/libc.so.1
    #4  0x42379b0:0 in die () at error.c:407
    #5  0x4237ce0:0 in rb_bug_context (ctx=0x20000000401afc00,
        fmt=0x411f760 "Segmentation fault at %p") at error.c:437
    #6  0x446ab60:0 in sigsegv (sig=11, info=0x20000000401afa10,
        ctx=0x20000000401afc00) at signal.c:890
    #7  <signal handler called>
    #8  0x4294a60:1 in mark_locations_array (objspace=0x2000000040036a10,
        x=0x1000, n=532675795) at gc.c:3909
    #9  0x4294c30:0 in gc_mark_locations (objspace=0x2000000040036a10, start=0x0,
        end=0x200000007f000350) at gc.c:3922
    #10 0x4295850:0 in mark_current_machine_context (objspace=0x2000000040036a10,
        th=0x2000000040035de0) at gc.c:4110
    #11 0x42987c0:0 in gc_mark_roots (objspace=0x2000000040036a10, categoryp=0x0)
        at gc.c:4651
    #12 0x4299d50:0 in gc_marks_start (objspace=0x2000000040036a10, full_mark=0)
        at gc.c:5204
    #13 0x429b3d0:0 in gc_marks (objspace=0x2000000040036a10, full_mark=0)
    #14 0x428a130:0 in gc_start (objspace=0x2000000040036a10, full_mark=0,
        immediate_mark=0, immediate_sweep=0, reason=256) at gc.c:6242
    #15 0x4289360:0 in heap_prepare (objspace=0x2000000040036a10,
        heap=0x2000000040036a24) at gc.c:1631
    #16 0x428a1e0:0 in heap_get_freeobj_from_next_freepage (
        objspace=0x2000000040036a10, heap=0x2000000040036a24) at gc.c:1645
    #17 0x428a3f0:0 in heap_get_freeobj (objspace=0x2000000040036a10,
        heap=0x2000000040036a24) at gc.c:1679
    #18 0x428aa40:0 in newobj_slowpath (klass=0, flags=27, v1=0, v2=0,
        v3=1076481296, objspace=0x2000000040036a10, wb_protected=0) at gc.c:1808
    #19 0x428ac50:0 in newobj_slowpath_wb_unprotected (klass=0, flags=27, v1=0,
        v2=0, v3=1076481296, objspace=0x2000000040036a10) at gc.c:1826
    #20 0x428ae50:0 in newobj_of (klass=0, flags=27, v1=0, v2=0, v3=1076481296,
        wb_protected=0) at gc.c:1851
    #21 0x428b170:0 in rb_node_newnode (type=NODE_ARGS, a0=0, a1=0, a2=1076481296)
        at gc.c:1888
    #22 0x436eaa0:0 in node_newnode (parser=0x2000000040225410, type=NODE_ARGS,
        a0=0, a1=0, a2=1076481296) at parse.y:8798
    #23 0x43734a0:0 in new_args_tail_gen (parser=0x2000000040225410, k=0x0, kr=0,
        b=0) at parse.y:10071
    #24 0x436b530:0 in ruby_yyparse (parser=0x2000000040225410) at parse.y:4574
    #25 0x43773b0:0 in yycompile0 (arg=1075991568) at parse.y:5542
    #26 0x45e4830:0 in rb_suppress_tracing (func=0x4377180:0 <yycompile0>,
        arg=1075991568) at vm_trace.c:407
    #27 0x43779b0:0 in yycompile (parser=0x2000000040225410, fname=1074887136,
        line=1) at parse.y:5572
    #28 0x4378630:0 in rb_parser_compile_file_path (vparser=1074887016,
        fname=1074887136, file=1074886992, start=1) at parse.y:5712
    #29 0x445f0a0:0 in load_file_internal (argp_v=2147470080) at ruby.c:1758
    #30 0x424b290:0 in rb_ensure (b_proc=0x445e240:0 <load_file_internal>,
        data1=2147470080, e_proc=0x445f7c0:0 <restore_load_file>, data2=2147470080)
        at eval.c:901
    #31 0x445e220:0 in load_file (parser=1074887016, fname=1074887136, script=0,
        opt=0x200000007fffcb20) at ruby.c:1878
    #32 0x445f9f0:0 in rb_load_file_str (fname_v=1074887136) at ruby.c:1894
    #33 0x4256120:0 in rb_load_internal0 (th=0x2000000040035de0, fname=1074887136,
        wrap=0) at load.c:615
    #34 0x4258ab0:0 in rb_require_internal (fname=1074887520, safe=0) at load.c:998
    #35 0x42572a0:0 in rb_require_safe (fname=1074887568, safe=0) at load.c:1043
    #36 0x4257250:0 in rb_f_require (obj=1075366488, fname=1074887568)
        at load.c:824
    #37 0x4599070:0 in call_cfunc_1 (func=0x4257200:0 <rb_f_require>,
        recv=1075366488, argc=1, argv=0x200000004005e798) at vm_insnhelper.c:1471
    #38 0x459a1a0:0 in vm_call_cfunc_with_frame (th=0x2000000040035de0,
        reg_cfp=0x20000000400de700, calling=0x200000007fffd6d0,
        ci=0x200000004027a470, cc=0x2000000040285380) at vm_insnhelper.c:1638
    #39 0x459a950:0 in vm_call_cfunc (th=0x2000000040035de0,
        reg_cfp=0x20000000400de700, calling=0x200000007fffd6d0,
        ci=0x200000004027a470, cc=0x2000000040285380) at vm_insnhelper.c:1733
    #40 0x459c560:0 in vm_call_method_each_type (th=0x2000000040035de0,
        cfp=0x20000000400de700, calling=0x200000007fffd6d0, ci=0x200000004027a470,
        cc=0x2000000040285380) at vm_insnhelper.c:2022
    #41 0x459b8b0:0 in vm_call_method (th=0x2000000040035de0,
        cfp=0x20000000400de700, calling=0x200000007fffd6d0, ci=0x200000004027a470,
        cc=0x2000000040285380) at vm_insnhelper.c:2157
    #42 0x4593030:0 in vm_call_general (th=0x2000000040035de0,
        reg_cfp=0x20000000400de700, calling=0x200000007fffd6d0,
        ci=0x200000004027a470, cc=0x2000000040285380) at vm_insnhelper.c:2189
    #43 0x45a6430:0 in vm_exec_core (th=0x2000000040035de0, initial=0)
        at insns.def:995
    #44 0x45bb0d0:0 in vm_exec (th=0x2000000040035de0) at vm.c:1650
    #45 0x45cab90:0 in rb_iseq_eval_main (iseq=0x20000000401206e0) at vm.c:1893
    #46 0x4247df0:0 in ruby_exec_internal (n=0x20000000401206e0) at eval.c:245
    #47 0x42480f0:0 in ruby_exec_node (n=0x20000000401206e0) at eval.c:310
    #48 0x4248040:0 in ruby_run_node (n=0x20000000401206e0) at eval.c:302
    #49 0x418fe50:0 in main (argc=11, argv=0x200000007ffff210) at main.c:36

Ideas welcome..



-- 
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>