Issue #11930 has been updated by Felix Bnemann.

File ruby_2016-01-05-141309_galaxy.crash added

I think I'm getting the same crash in `gc_mark_ptr` with `ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15]` when using the pg 0.18.4 gem and activerecord 4.2.4:

```
(lldb) target create "/Users/felix/.rvm/rubies/ruby-2.3.0/bin/ruby"
Current executable set to '/Users/felix/.rvm/rubies/ruby-2.3.0/bin/ruby' (x86_64).
(lldb) settings set -- target.run-args  "bin/rake" "export:csv"
(lldb) r
Process 83586 launched: '/Users/felix/.rvm/rubies/ruby-2.3.0/bin/ruby' (x86_64)
Exporting data...
Process 83586 stopped Event: create_hist_info Processed: 0 / 8727   0% |                                                                                             |  ETA: ??:??:??
* thread #1: tid = 0x1a0148, 0x00000001000700e2 libruby.2.3.0.dylib`gc_mark_ptr [inlined] RVALUE_MARKED(obj=1125899906842624) + 42 at gc.c:1077, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
    frame #0: 0x00000001000700e2 libruby.2.3.0.dylib`gc_mark_ptr [inlined] RVALUE_MARKED(obj=1125899906842624) + 42 at gc.c:1077
   1074	RVALUE_MARKED(VALUE obj)
   1075	{
   1076	    check_rvalue_consistency(obj);
-> 1077	    return RVALUE_MARK_BITMAP(obj) != 0;
   1078	}
   1079
   1080	#if USE_RGENGC
(lldb) bt
* thread #1: tid = 0x1a0148, 0x00000001000700e2 libruby.2.3.0.dylib`gc_mark_ptr [inlined] RVALUE_MARKED(obj=1125899906842624) + 42 at gc.c:1077, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
  * frame #0: 0x00000001000700e2 libruby.2.3.0.dylib`gc_mark_ptr [inlined] RVALUE_MARKED(obj=1125899906842624) + 42 at gc.c:1077
    frame #1: 0x00000001000700b8 libruby.2.3.0.dylib`gc_mark_ptr [inlined] gc_mark_set at gc.c:4172
    frame #2: 0x00000001000700b8 libruby.2.3.0.dylib`gc_mark_ptr(objspace=0x0000000101800000, obj=1125899906842624) + 40 at gc.c:4294
    frame #3: 0x000000010005706b libruby.2.3.0.dylib`proc_mark(ptr=0x00000001052b0800) + 75 at proc.c:55
    frame #4: 0x000000010006d7d1 libruby.2.3.0.dylib`gc_start + 567 at gc.c:5635
    frame #5: 0x000000010006d59a libruby.2.3.0.dylib`gc_start [inlined] gc_marks_start(objspace=0x0000000101800000) + 464 at gc.c:5210
    frame #6: 0x000000010006d3ca libruby.2.3.0.dylib`gc_start [inlined] gc_marks(full_mark=<unavailable>) + 102 at gc.c:5465
    frame #7: 0x000000010006d364 libruby.2.3.0.dylib`gc_start(objspace=0x0000000101800000, full_mark=<unavailable>, immediate_mark=<unavailable>, immediate_sweep=<unavailable>, reason=<unavailable>) + 1268 at gc.c:6401
    frame #8: 0x000000010006cd44 libruby.2.3.0.dylib`newobj_slowpath [inlined] heap_prepare(objspace=0x0000000101800000, heap=<unavailable>) + 1004 at gc.c:1643
    frame #9: 0x000000010006c958 libruby.2.3.0.dylib`newobj_slowpath [inlined] heap_get_freeobj_from_next_freepage(heap=0x0000000101800028) at gc.c:1655
    frame #10: 0x000000010006c958 libruby.2.3.0.dylib`newobj_slowpath [inlined] heap_get_freeobj(objspace=0x0000000101800000, heap=0x0000000101800028) + 21 at gc.c:1689
    frame #11: 0x000000010006c943 libruby.2.3.0.dylib`newobj_slowpath(klass=4312187040, flags=5, v1=0, v2=0, v3=0, objspace=0x0000000101800000, wb_protected=<unavailable>) + 195 at gc.c:1818
    frame #12: 0x000000010006c854 libruby.2.3.0.dylib`newobj_slowpath_wb_protected(klass=<unavailable>, flags=<unavailable>, v1=<unavailable>, v2=<unavailable>, v3=<unavailable>, objspace=<unavailable>) + 20 at gc.c:1830
    frame #13: 0x000000010012519e libruby.2.3.0.dylib`str_new0 [inlined] str_alloc(klass=4312187040) + 8 at string.c:629
    frame #14: 0x0000000100125196 libruby.2.3.0.dylib`str_new0(klass=4312187040, ptr="-", len=1, termlen=1) + 54 at string.c:651
    frame #15: 0x0000000100125661 libruby.2.3.0.dylib`rb_tainted_str_new [inlined] str_new(klass=<unavailable>, ptr=<unavailable>, len=<unavailable>) + 33 at string.c:671
    frame #16: 0x0000000100125656 libruby.2.3.0.dylib`rb_tainted_str_new [inlined] rb_str_new(ptr=<unavailable>, len=<unavailable>) + 12 at string.c:677
    frame #17: 0x000000010012564a libruby.2.3.0.dylib`rb_tainted_str_new(ptr=<unavailable>, len=<unavailable>) + 10 at string.c:793
    frame #18: 0x0000000102aabe48 pg_ext.bundle`pg_text_dec_string(conv=<unavailable>, val=<unavailable>, len=<unavailable>, tuple=<unavailable>, field=<unavailable>, enc_idx=1) + 24 at pg_text_decoder.c:68
    frame #19: 0x0000000102aab461 pg_ext.bundle`pgresult_values(self=4368468480) + 209 at pg_result.c:899
    frame #20: 0x00000001001984a0 libruby.2.3.0.dylib`vm_call_cfunc [inlined] vm_call_cfunc_with_frame + 220 at vm_insnhelper.c:1638
    frame #21: 0x00000001001983c4 libruby.2.3.0.dylib`vm_call_cfunc(th=0x0000000100700000, reg_cfp=0x00000001019ff680, calling=<unavailable>, ci=<unavailable>, cc=<unavailable>) + 84 at vm_insnhelper.c:1733
    frame #22: 0x0000000100181d25 libruby.2.3.0.dylib`vm_exec_core(th=0x0000000100700000, initial=<unavailable>) + 11317 at insns.def:995
    frame #23: 0x0000000100192ed9 libruby.2.3.0.dylib`vm_exec(th=0x0000000100700000) + 121 at vm.c:1645
    frame #24: 0x000000010018e3a7 libruby.2.3.0.dylib`rb_yield [inlined] invoke_block_from_c_splattable(th=<unavailable>, block=<unavailable>, self=<unavailable>, argc=0, argv=<unavailable>, blockptr=<unavailable>, cref=<unavailable>) + 183 at vm.c:983
    frame #25: 0x000000010018e3a2 libruby.2.3.0.dylib`rb_yield [inlined] vm_yield(th=<unavailable>, argc=0) at vm.c:1018
    frame #26: 0x000000010018e3a2 libruby.2.3.0.dylib`rb_yield [inlined] rb_yield_0(argc=0) at vm_eval.c:1008
    frame #27: 0x000000010018e3a2 libruby.2.3.0.dylib`rb_yield(val=<unavailable>) + 178 at vm_eval.c:1021
    frame #28: 0x0000000100006719 libruby.2.3.0.dylib`rb_ary_each(ary=4365752440) + 41 at array.c:1815
    frame #29: 0x00000001001984a0 libruby.2.3.0.dylib`vm_call_cfunc [inlined] vm_call_cfunc_with_frame + 220 at vm_insnhelper.c:1638
    frame #30: 0x00000001001983c4 libruby.2.3.0.dylib`vm_call_cfunc(th=0x0000000100700000, reg_cfp=0x00000001019ffa40, calling=<unavailable>, ci=<unavailable>, cc=<unavailable>) + 84 at vm_insnhelper.c:1733
    frame #31: 0x0000000100181b35 libruby.2.3.0.dylib`vm_exec_core(th=0x0000000100700000, initial=<unavailable>) + 10821 at insns.def:964
    frame #32: 0x0000000100192ed9 libruby.2.3.0.dylib`vm_exec(th=0x0000000100700000) + 121 at vm.c:1645
    frame #33: 0x000000010018e3a7 libruby.2.3.0.dylib`rb_yield [inlined] invoke_block_from_c_splattable(th=<unavailable>, block=<unavailable>, self=<unavailable>, argc=0, argv=<unavailable>, blockptr=<unavailable>, cref=<unavailable>) + 183 at vm.c:983
    frame #34: 0x000000010018e3a2 libruby.2.3.0.dylib`rb_yield [inlined] vm_yield(th=<unavailable>, argc=0) at vm.c:1018
    frame #35: 0x000000010018e3a2 libruby.2.3.0.dylib`rb_yield [inlined] rb_yield_0(argc=0) at vm_eval.c:1008
    frame #36: 0x000000010018e3a2 libruby.2.3.0.dylib`rb_yield(val=<unavailable>) + 178 at vm_eval.c:1021
    frame #37: 0x000000010004e957 libruby.2.3.0.dylib`rb_ensure(b_proc=(libruby.2.3.0.dylib`rb_yield at vm_eval.c:1019), data1=4345466400, e_proc=<unavailable>, data2=<unavailable>) + 167 at eval.c:898
    frame #38: 0x00000001001984a0 libruby.2.3.0.dylib`vm_call_cfunc [inlined] vm_call_cfunc_with_frame + 220 at vm_insnhelper.c:1638
    frame #39: 0x00000001001983c4 libruby.2.3.0.dylib`vm_call_cfunc(th=0x0000000100700000, reg_cfp=0x00000001019ffb40, calling=<unavailable>, ci=<unavailable>, cc=<unavailable>) + 84 at vm_insnhelper.c:1733
    frame #40: 0x0000000100181b35 libruby.2.3.0.dylib`vm_exec_core(th=0x0000000100700000, initial=<unavailable>) + 10821 at insns.def:964
    frame #41: 0x0000000100192ed9 libruby.2.3.0.dylib`vm_exec(th=0x0000000100700000) + 121 at vm.c:1645
    frame #42: 0x00000001001916f2 libruby.2.3.0.dylib`vm_invoke_proc [inlined] invoke_block_from_c_unsplattable + 194 at vm.c:991
    frame #43: 0x00000001001916c7 libruby.2.3.0.dylib`vm_invoke_proc(th=0x0000000100700000, proc=0x0000000105eea3b0, self=4312196640, argc=2, argv=0x00007fff5fbfe090, blockptr=0x0000000000000000) + 151 at vm.c:1039
    frame #44: 0x0000000100199664 libruby.2.3.0.dylib`vm_call_opt_call [inlined] rb_vm_invoke_proc(proc=<unavailable>, argv=<unavailable>, blockptr=<unavailable>) + 228 at vm.c:1067
    frame #45: 0x000000010019961c libruby.2.3.0.dylib`vm_call_opt_call(th=0x0000000100700000, cfp=<unavailable>, calling=<unavailable>, ci=<unavailable>, cc=<unavailable>) + 156 at vm_insnhelper.c:1864
    frame #46: 0x0000000100181d25 libruby.2.3.0.dylib`vm_exec_core(th=0x0000000100700000, initial=<unavailable>) + 11317 at insns.def:995
    frame #47: 0x0000000100192ed9 libruby.2.3.0.dylib`vm_exec(th=0x0000000100700000) + 121 at vm.c:1645
    frame #48: 0x000000010018e3a7 libruby.2.3.0.dylib`rb_yield [inlined] invoke_block_from_c_splattable(th=<unavailable>, block=<unavailable>, self=<unavailable>, argc=0, argv=<unavailable>, blockptr=<unavailable>, cref=<unavailable>) + 183 at vm.c:983
    frame #49: 0x000000010018e3a2 libruby.2.3.0.dylib`rb_yield [inlined] vm_yield(th=<unavailable>, argc=0) at vm.c:1018
    frame #50: 0x000000010018e3a2 libruby.2.3.0.dylib`rb_yield [inlined] rb_yield_0(argc=0) at vm_eval.c:1008
    frame #51: 0x000000010018e3a2 libruby.2.3.0.dylib`rb_yield(val=<unavailable>) + 178 at vm_eval.c:1021
    frame #52: 0x0000000100006719 libruby.2.3.0.dylib`rb_ary_each(ary=4399107000) + 41 at array.c:1815
    frame #53: 0x00000001001984a0 libruby.2.3.0.dylib`vm_call_cfunc [inlined] vm_call_cfunc_with_frame + 220 at vm_insnhelper.c:1638
    frame #54: 0x00000001001983c4 libruby.2.3.0.dylib`vm_call_cfunc(th=0x0000000100700000, reg_cfp=0x00000001019ffc00, calling=<unavailable>, ci=<unavailable>, cc=<unavailable>) + 84 at vm_insnhelper.c:1733
    frame #55: 0x0000000100181b35 libruby.2.3.0.dylib`vm_exec_core(th=0x0000000100700000, initial=<unavailable>) + 10821 at insns.def:964
    frame #56: 0x0000000100192ed9 libruby.2.3.0.dylib`vm_exec(th=0x0000000100700000) + 121 at vm.c:1645
    frame #57: 0x000000010018e3a7 libruby.2.3.0.dylib`rb_yield [inlined] invoke_block_from_c_splattable(th=<unavailable>, block=<unavailable>, self=<unavailable>, argc=0, argv=<unavailable>, blockptr=<unavailable>, cref=<unavailable>) + 183 at vm.c:983
    frame #58: 0x000000010018e3a2 libruby.2.3.0.dylib`rb_yield [inlined] vm_yield(th=<unavailable>, argc=0) at vm.c:1018
    frame #59: 0x000000010018e3a2 libruby.2.3.0.dylib`rb_yield [inlined] rb_yield_0(argc=0) at vm_eval.c:1008
    frame #60: 0x000000010018e3a2 libruby.2.3.0.dylib`rb_yield(val=<unavailable>) + 178 at vm_eval.c:1021
    frame #61: 0x0000000100006719 libruby.2.3.0.dylib`rb_ary_each(ary=4317407240) + 41 at array.c:1815
    frame #62: 0x00000001001984a0 libruby.2.3.0.dylib`vm_call_cfunc [inlined] vm_call_cfunc_with_frame + 220 at vm_insnhelper.c:1638
    frame #63: 0x00000001001983c4 libruby.2.3.0.dylib`vm_call_cfunc(th=0x0000000100700000, reg_cfp=0x00000001019ffe00, calling=<unavailable>, ci=<unavailable>, cc=<unavailable>) + 84 at vm_insnhelper.c:1733
    frame #64: 0x0000000100181b35 libruby.2.3.0.dylib`vm_exec_core(th=0x0000000100700000, initial=<unavailable>) + 10821 at insns.def:964
    frame #65: 0x0000000100192ed9 libruby.2.3.0.dylib`vm_exec(th=0x0000000100700000) + 121 at vm.c:1645
    frame #66: 0x000000010004d9e4 libruby.2.3.0.dylib`ruby_exec_internal(n=<unavailable>) + 148 at eval.c:244
    frame #67: 0x000000010004d8f6 libruby.2.3.0.dylib`ruby_run_node [inlined] ruby_exec_node(n=<unavailable>) + 54 at eval.c:309
    frame #68: 0x000000010004d8e8 libruby.2.3.0.dylib`ruby_run_node(n=<unavailable>) + 40 at eval.c:301
    frame #69: 0x0000000100000f1f ruby`main(argc=<unavailable>, argv=<unavailable>) + 79 at main.c:36
    frame #70: 0x00007fff8105c5ad libdyld.dylib`start + 1
    frame #71: 0x00007fff8105c5ad libdyld.dylib`start + 1
(lldb) register read
General Purpose Registers:
       rax = 0x0004000000000000
       rbx = 0x0000000101800000
       rcx = 0x0000000000000000
       rdx = 0x0000000000000000
       rdi = 0x0000000101800000
       rsi = 0x0004000000000000
       rbp = 0x00007fff5fbfc7b0
       rsp = 0x00007fff5fbfc7a0
        r8 = 0x0000000000838805
        r9 = 0x0000000000000010
       r10 = 0x0000000000000000
       r11 = 0x0000000000000000
       r12 = 0x0000000000000000
       r13 = 0x0000000000000001
       r14 = 0x0004000000000000
       r15 = 0x0000000101800000
       rip = 0x00000001000700e2  libruby.2.3.0.dylib`gc_mark_ptr + 82 [inlined] RVALUE_MARKED + 42 at gc.c:4172
  libruby.2.3.0.dylib`gc_mark_ptr + 40 [inlined] gc_mark_set at gc.c:4294
  libruby.2.3.0.dylib`gc_mark_ptr + 40 at gc.c:4294
    rflags = 0x0000000000010206
        cs = 0x000000000000002b
        fs = 0x0000000000000000
        gs = 0x0000000000000000
```

And more info from another crash (see attached crash log):

```
/Users/felix/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/postgresql/database_statements.rb:168: [BUG] Segmentation fault at 0x00000000000000??
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15]

-- Control frame information -----------------------------------------------
c:0039 p:---- s:0177 e:000176 CFUNC  :values
c:0038 p:0044 s:0174 e:000171 BLOCK  /Users/felix/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/postgresql/database_statements.
c:0037 p:0042 s:0167 e:000166 METHOD /Users/felix/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/postgresql_adapter.rb:590
c:0036 p:0023 s:0159 e:000158 METHOD /Users/felix/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/postgresql/database_statements.
c:0035 p:0021 s:0153 e:000152 METHOD /Users/felix/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/abstract/database_statements.rb
c:0034 p:0044 s:0147 e:000146 METHOD /Users/felix/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/abstract/database_statements.rb
c:0033 p:0083 s:0141 e:000140 METHOD /Users/felix/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/abstract/query_cache.rb:70
c:0032 p:0032 s:0134 e:000133 METHOD /Users/felix/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.4/lib/active_record/querying.rb:39
c:0031 p:0040 s:0125 e:000124 METHOD /Users/felix/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.4/lib/active_record/relation.rb:639
c:0030 p:0014 s:0120 e:000119 METHOD /Users/felix/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.4/lib/active_record/relation.rb:515
c:0029 p:0008 s:0117 e:000116 METHOD /Users/felix/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.4/lib/active_record/relation.rb:243
c:0028 p:0267 s:0114 e:000113 METHOD /Users/felix/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.4/lib/active_record/relation/batches.rb:128
[...]

-- Ruby level backtrace information ----------------------------------------
./bin/rake:4:in `<main>'
[...]
/Users/felix/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.4/lib/active_record/relation/batches.rb:128:in `find_in_batches'
/Users/felix/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.4/lib/active_record/relation.rb:243:in `to_a'
/Users/felix/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.4/lib/active_record/relation.rb:515:in `load'
/Users/felix/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.4/lib/active_record/relation.rb:639:in `exec_queries'
/Users/felix/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.4/lib/active_record/querying.rb:39:in `find_by_sql'
/Users/felix/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/abstract/query_cache.rb:70:in `select_all'
/Users/felix/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/abstract/database_statements.rb:32:in `select_all'
/Users/felix/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/abstract/database_statements.rb:351:in `select'
/Users/felix/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/postgresql/database_statements.rb:160:in `exec_query'
/Users/felix/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/postgresql_adapter.rb:590:in `execute_and_clear'
/Users/felix/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/postgresql/database_statements.rb:168:in `block in exec_query'
/Users/felix/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/postgresql/database_statements.rb:168:in `values'

-- Machine register context ------------------------------------------------
 rax: 0x0004000000000000 rbx: 0x00007fdcc9407000 rcx: 0x0000000000000000
 rdx: 0x0000000000000000 rdi: 0x00007fdcc9407000 rsi: 0x0004000000000000
 rbp: 0x00007fff5e5fc7d0 rsp: 0x00007fff5e5fc7c0  r8: 0x0000000000802805
  r9: 0x0000000000000006 r10: 0x0000000006960641 r11: 0x000000000696d7f9
 r12: 0x0000000000000001 r13: 0x0000000000800000 r14: 0x0004000000000000
 r15: 0x00007fdcc9407000 rip: 0x00000001016710e2 rfl: 0x0000000000010206

-- C level backtrace information -------------------------------------------
0   libruby.2.3.0.dylib                 0x00000001017a32d4 rb_vm_bugreport + 388
1   libruby.2.3.0.dylib                 0x00000001016456e3 rb_bug_context + 483
2   libruby.2.3.0.dylib                 0x0000000101717e63 sigsegv + 83
3   libsystem_platform.dylib            0x00007fff937ffeaa _sigtramp + 26
4   libruby.2.3.0.dylib                 0x00000001016710e2 gc_mark_ptr + 82
5   ???                                 0x00007fdccc843a10 0x0 + 140586300750352
```

----------------------------------------
Bug #11930: Segmentation Fault in activesupport-4.2.5 gem
https://bugs.ruby-lang.org/issues/11930#change-55966

* Author: Brian Giaraffa
* Status: Feedback
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
/home/devbox/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.5/lib/active_support/core_ext/module/attribute_accessors.rb:208: [BUG] Segmentation fault at 0x00000000000000
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]

---Files--------------------------------
ruby_exception.txt (158 KB)
ruby_2016-01-05-141309_galaxy.crash (48.5 KB)


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