Bug #1364: /usr/local/lib/ruby/1.9.1/rexml/text.rb:375: [BUG] Segmentation fault
http://redmine.ruby-lang.org/issues/show/1364

Author: Kevin Murray
Status: Open, Priority: Normal
ruby -v: 1.9.1p0

ruby 1.9.1p0 with mysql-ruby-2.8.1 running on SuSE Linux Enterprise Server 10 SP1 running Ruby program oddbod.rb http://community.elgg.org/pg/plugins/codebrane/read/60964/migration-09-gt-15-plugin-for-all-data

Just before crash
Mem:    354208k total,   349180k used,     5028k free,     1732k buffers
Swap:   530104k total,   301580k used,   228524k free,     8032k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
27839 elgg      18   0  346m 284m  716 D  2.3 82.4  11:05

OddBod README says
To use the Oddbod exporter you need Ruby, at least version 1.9.1p0 as previous versions
have a REXML issue which prevents data being written to XML files in some circumstances.

/usr/local/lib/ruby/1.9.1/rexml/text.rb:375: [BUG] Segmentation fault
ruby 1.9.1p0 (2009-01-30 revision 21907) [i686-linux]

-- control frame ----------
c:0029 p:---- s:0136 b:0136 l:000135 d:000135 CFUNC  :gsub
c:0028 p:0036 s:0131 b:0131 l:000122 d:000130 BLOCK  /usr/local/lib/ruby/1.9.1/rexml/text.rb:375
c:0027 p:---- s:0128 b:0128 l:000127 d:000127 FINISH
c:0026 p:---- s:0126 b:0126 l:000125 d:000125 CFUNC  :each_value
c:0025 p:0078 s:0123 b:0123 l:000122 d:000122 METHOD /usr/local/lib/ruby/1.9.1/rexml/text.rb:374
c:0024 p:0050 s:0116 b:0116 l:000115 d:000115 METHOD /usr/local/lib/ruby/1.9.1/rexml/text.rb:224
c:0023 p:0029 s:0113 b:0113 l:000104 d:000112 BLOCK  /usr/local/lib/ruby/1.9.1/rexml/formatters/pretty.rb:75
c:0022 p:---- s:0110 b:0110 l:000109 d:000109 FINISH
c:0021 p:---- s:0108 b:0108 l:000107 d:000107 CFUNC  :each
c:0020 p:0256 s:0105 b:0105 l:000104 d:000104 METHOD /usr/local/lib/ruby/1.9.1/rexml/formatters/pretty.rb:74
c:0019 p:0393 s:0097 b:0097 l:000096 d:000096 METHOD /usr/local/lib/ruby/1.9.1/rexml/formatters/default.rb:31
c:0018 p:0062 s:0092 b:0092 l:000083 d:000091 BLOCK  /usr/local/lib/ruby/1.9.1/rexml/formatters/pretty.rb:76
c:0017 p:---- s:0089 b:0089 l:000088 d:000088 FINISH
c:0016 p:---- s:0087 b:0087 l:000086 d:000086 CFUNC  :each
c:0015 p:0256 s:0084 b:0084 l:000083 d:000083 METHOD /usr/local/lib/ruby/1.9.1/rexml/formatters/pretty.rb:74
c:0014 p:0393 s:0076 b:0076 l:000075 d:000075 METHOD /usr/local/lib/ruby/1.9.1/rexml/formatters/default.rb:31
c:0013 p:0148 s:0071 b:0071 l:000062 d:000070 BLOCK  /usr/local/lib/ruby/1.9.1/rexml/formatters/pretty.rb:118
c:0012 p:---- s:0068 b:0068 l:000067 d:000067 FINISH
c:0011 p:---- s:0066 b:0066 l:000065 d:000065 CFUNC  :each
c:0010 p:0018 s:0063 b:0063 l:000062 d:000062 METHOD /usr/local/lib/ruby/1.9.1/rexml/formatters/pretty.rb:112
c:0009 p:0377 s:0058 b:0058 l:000057 d:000057 METHOD /usr/local/lib/ruby/1.9.1/rexml/formatters/default.rb:28
c:0008 p:0204 s:0053 b:0053 l:000052 d:000052 METHOD /usr/local/lib/ruby/1.9.1/rexml/document.rb:197
c:0007 p:0015 s:0045 b:0045 l:000034 d:000044 BLOCK  /home/elgg/oddbod-0.9.0/export/generators/genericbod.rb:38
c:0006 p:---- s:0042 b:0042 l:000041 d:000041 FINISH
c:0005 p:---- s:0040 b:0040 l:000039 d:000039 CFUNC  :open
c:0004 p:0038 s:0035 b:0035 l:000034 d:000034 METHOD /home/elgg/oddbod-0.9.0/export/generators/genericbod.rb:38
c:0003 p:0576 s:0031 b:0031 l:00193c d:0016e0 EVAL   oddbod.rb:59
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:00193c d:00193c TOP    <main>:17
---------------------------
/usr/local/lib/ruby/1.9.1/rexml/text.rb:375: [BUG] object allocation during garbage collection phase
ruby 1.9.1p0 (2009-01-30 revision 21907) [i686-linux]

-- control frame ----------
c:0029 p:---- s:0136 b:0136 l:000135 d:000135 CFUNC  :gsub
c:0028 p:0036 s:0131 b:0131 l:000122 d:000130 BLOCK  /usr/local/lib/ruby/1.9.1/rexml/text.rb:375
c:0027 p:---- s:0128 b:0128 l:000127 d:000127 FINISH
c:0026 p:---- s:0126 b:0126 l:000125 d:000125 CFUNC  :each_value
c:0025 p:0078 s:0123 b:0123 l:000122 d:000122 METHOD /usr/local/lib/ruby/1.9.1/rexml/text.rb:374
c:0024 p:0050 s:0116 b:0116 l:000115 d:000115 METHOD /usr/local/lib/ruby/1.9.1/rexml/text.rb:224
c:0023 p:0029 s:0113 b:0113 l:000104 d:000112 BLOCK  /usr/local/lib/ruby/1.9.1/rexml/formatters/pretty.rb:75
c:0022 p:---- s:0110 b:0110 l:000109 d:000109 FINISH
c:0021 p:---- s:0108 b:0108 l:000107 d:000107 CFUNC  :each
c:0020 p:0256 s:0105 b:0105 l:000104 d:000104 METHOD /usr/local/lib/ruby/1.9.1/rexml/formatters/pretty.rb:74
c:0019 p:0393 s:0097 b:0097 l:000096 d:000096 METHOD /usr/local/lib/ruby/1.9.1/rexml/formatters/default.rb:31
c:0018 p:0062 s:0092 b:0092 l:000083 d:000091 BLOCK  /usr/local/lib/ruby/1.9.1/rexml/formatters/pretty.rb:76
c:0017 p:---- s:0089 b:0089 l:000088 d:000088 FINISH
c:0016 p:---- s:0087 b:0087 l:000086 d:000086 CFUNC  :each
c:0015 p:0256 s:0084 b:0084 l:000083 d:000083 METHOD /usr/local/lib/ruby/1.9.1/rexml/formatters/pretty.rb:74
c:0014 p:0393 s:0076 b:0076 l:000075 d:000075 METHOD /usr/local/lib/ruby/1.9.1/rexml/formatters/default.rb:31
c:0013 p:0148 s:0071 b:0071 l:000062 d:000070 BLOCK  /usr/local/lib/ruby/1.9.1/rexml/formatters/pretty.rb:118
c:0012 p:---- s:0068 b:0068 l:000067 d:000067 FINISH
c:0011 p:---- s:0066 b:0066 l:000065 d:000065 CFUNC  :each
c:0010 p:0018 s:0063 b:0063 l:000062 d:000062 METHOD /usr/local/lib/ruby/1.9.1/rexml/formatters/pretty.rb:112
c:0009 p:0377 s:0058 b:0058 l:000057 d:000057 METHOD /usr/local/lib/ruby/1.9.1/rexml/formatters/default.rb:28
c:0008 p:0204 s:0053 b:0053 l:000052 d:000052 METHOD /usr/local/lib/ruby/1.9.1/rexml/document.rb:197
c:0007 p:0015 s:0045 b:0045 l:000034 d:000044 BLOCK  /home/elgg/oddbod-0.9.0/export/generators/genericbod.rb:38
c:0006 p:---- s:0042 b:0042 l:000041 d:000041 FINISH
c:0005 p:---- s:0040 b:0040 l:000039 d:000039 CFUNC  :open
c:0004 p:0038 s:0035 b:0035 l:000034 d:000034 METHOD /home/elgg/oddbod-0.9.0/export/generators/genericbod.rb:38
c:0003 p:0576 s:0031 b:0031 l:00193c d:0016e0 EVAL   oddbod.rb:59
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:00193c d:00193c TOP    <main>:17
---------------------------
-- Ruby level backtrace information-----------------------------------------
/usr/local/lib/ruby/1.9.1/rexml/text.rb:375:in `gsub'
/usr/local/lib/ruby/1.9.1/rexml/text.rb:375:in `block in normalize'
/usr/local/lib/ruby/1.9.1/rexml/text.rb:374:in `each_value'
/usr/local/lib/ruby/1.9.1/rexml/text.rb:374:in `normalize'
/usr/local/lib/ruby/1.9.1/rexml/text.rb:224:in `to_s'
/usr/local/lib/ruby/1.9.1/rexml/formatters/pretty.rb:75:in `block in write_element'
/usr/local/lib/ruby/1.9.1/rexml/formatters/pretty.rb:74:in `each'
/usr/local/lib/ruby/1.9.1/rexml/formatters/pretty.rb:74:in `write_element'
/usr/local/lib/ruby/1.9.1/rexml/formatters/default.rb:31:in `write'
/usr/local/lib/ruby/1.9.1/rexml/formatters/pretty.rb:76:in `block in write_element'
/usr/local/lib/ruby/1.9.1/rexml/formatters/pretty.rb:74:in `each'
/usr/local/lib/ruby/1.9.1/rexml/formatters/pretty.rb:74:in `write_element'
/usr/local/lib/ruby/1.9.1/rexml/formatters/default.rb:31:in `write'
/usr/local/lib/ruby/1.9.1/rexml/formatters/pretty.rb:118:in `block in write_document'
/usr/local/lib/ruby/1.9.1/rexml/formatters/pretty.rb:112:in `each'
/usr/local/lib/ruby/1.9.1/rexml/formatters/pretty.rb:112:in `write_document'
/usr/local/lib/ruby/1.9.1/rexml/formatters/default.rb:28:in `write'
/usr/local/lib/ruby/1.9.1/rexml/document.rb:197:in `write'
/home/elgg/oddbod-0.9.0/export/generators/genericbod.rb:38:in `block in odd_file'
/home/elgg/oddbod-0.9.0/export/generators/genericbod.rb:38:in `open'
/home/elgg/oddbod-0.9.0/export/generators/genericbod.rb:38:in `odd_file'
oddbod.rb:59:in `<main>'

-- C level backtrace information -------------------------------------------
0x811b308 ruby(rb_vm_bugreport+0x48) [0x811b308]
0x8146e68 ruby [0x8146e68]
0x8146eeb ruby(rb_bug+0x2b) [0x8146eeb]
0x806252c ruby [0x806252c]
0x81254bc ruby [0x81254bc]
0x812571e ruby [0x812571e]
0x8125c62 ruby(rb_ary_new+0x12) [0x8125c62]
0x810d5a9 ruby(rb_make_backtrace+0x29) [0x810d5a9]
0x811b2ea ruby(rb_vm_bugreport+0x2a) [0x811b2ea]
0x8146e68 ruby [0x8146e68]
0x8146eeb ruby(rb_bug+0x2b) [0x8146eeb]
0x80cf0a6 ruby [0x80cf0a6]
0xffffe440 [0xffffe440]
0x8061747 ruby [0x8061747]
0x80d4866 ruby(st_foreach+0x96) [0x80d4866]
0x805f067 ruby [0x805f067]
0x80613da ruby [0x80613da]
0x80615b7 ruby [0x80615b7]
0x806149e ruby [0x806149e]
0x80615b7 ruby [0x80615b7]
0x806149e ruby [0x806149e]
0x80615b7 ruby [0x80615b7]
0x80615b7 ruby [0x80615b7]
0x8061859 ruby [0x8061859]
0x810b6b6 ruby [0x810b6b6]
0x8061392 ruby [0x8061392]
0x8061392 ruby [0x8061392]
0x8061796 ruby [0x8061796]
0x80d4866 ruby(st_foreach+0x96) [0x80d4866]
0x805f0e7 ruby [0x805f0e7]
0x80615df ruby [0x80615df]
0x8061796 ruby [0x8061796]
0x80d4810 ruby(st_foreach+0x40) [0x80d4810]
0x805f0e7 ruby [0x805f0e7]
0x80615df ruby [0x80615df]
0x8061796 ruby [0x8061796]
0x80d4810 ruby(st_foreach+0x40) [0x80d4810]
0x805f0e7 ruby [0x805f0e7]
0x80615df ruby [0x80615df]
0x8061106 ruby [0x8061106]
0x8061106 ruby [0x8061106]
0x8061796 ruby [0x8061796]
0x80d4810 ruby(st_foreach+0x40) [0x80d4810]
0x805f0e7 ruby [0x805f0e7]
0x80615df ruby [0x80615df]
0x8061796 ruby [0x8061796]
0x80d4810 ruby(st_foreach+0x40) [0x80d4810]
0x805f0e7 ruby [0x805f0e7]
0x80615df ruby [0x80615df]
0x8061106 ruby [0x8061106]
0x8061106 ruby [0x8061106]
0x8061106 ruby [0x8061106]
0x8061106 ruby [0x8061106]
0x8061b0d ruby [0x8061b0d]
0x8062695 ruby [0x8062695]
0x80dd20e ruby(rb_str_buf_new+0x8e) [0x80dd20e]
0x80b2b8b ruby [0x80b2b8b]
0x80b308b ruby [0x80b308b]
0x80b34d4 ruby [0x80b34d4]
0x80b37d8 ruby(rb_reg_new_str+0x58) [0x80b37d8]
0x80b3885 ruby(rb_reg_regcomp+0x85) [0x80b3885]
0x80d8210 ruby [0x80d8210]
0x80e2060 ruby [0x80e2060]
0x810c476 ruby [0x810c476]
0x810e705 ruby [0x810e705]
0x8110e44 ruby [0x8110e44]
0x81150b5 ruby [0x81150b5]
0x81156d8 ruby [0x81156d8]
0x8115e57 ruby(rb_yield+0x47) [0x8115e57]
0x8064427 ruby [0x8064427]
0x8064c0e ruby [0x8064c0e]
0x80d4866 ruby(st_foreach+0x96) [0x80d4866]
0x8066892 ruby [0x8066892]
0x8059df1 ruby(rb_ensure+0x51) [0x8059df1]
0x8065ce2 ruby(rb_hash_foreach+0x42) [0x8065ce2]
0x806635c ruby [0x806635c]
0x810e705 ruby [0x810e705]
0x8110e44 ruby [0x8110e44]
0x81150b5 ruby [0x81150b5]
0x81156d8 ruby [0x81156d8]
0x8115e57 ruby(rb_yield+0x47) [0x8115e57]
0x812525a ruby(rb_ary_each+0x3a) [0x812525a]
0x810e705 ruby [0x810e705]
0x8110e44 ruby [0x8110e44]
0x81150b5 ruby [0x81150b5]
0x81156d8 ruby [0x81156d8]
0x8115e57 ruby(rb_yield+0x47) [0x8115e57]
0x812525a ruby(rb_ary_each+0x3a) [0x812525a]
0x810e705 ruby [0x810e705]
0x8110e44 ruby [0x8110e44]
0x81150b5 ruby [0x81150b5]
0x81156d8 ruby [0x81156d8]
0x8115e57 ruby(rb_yield+0x47) [0x8115e57]
0x812525a ruby(rb_ary_each+0x3a) [0x812525a]
0x810e705 ruby [0x810e705]
0x8110e44 ruby [0x8110e44]
0x81150b5 ruby [0x81150b5]
0x81156d8 ruby [0x81156d8]
0x8115e57 ruby(rb_yield+0x47) [0x8115e57]
0x8059df1 ruby(rb_ensure+0x51) [0x8059df1]
0x8068d57 ruby [0x8068d57]
0x810c476 ruby [0x810c476]
0x810e705 ruby [0x810e705]
0x8110e44 ruby [0x8110e44]
0x81150b5 ruby [0x81150b5]
0x8115245 ruby(rb_iseq_eval_main+0x95) [0x8115245]
0x805a42f ruby(ruby_exec_node+0x9f) [0x805a42f]
0x805bb42 ruby(ruby_run_node+0x42) [0x805bb42]
0x80593e0 ruby(main+0x60) [0x80593e0]
0xb7e1887c /lib/libc.so.6(__libc_start_main+0xdc) [0xb7e1887c]
0x80592f1 ruby [0x80592f1]


----------------------------------------
http://redmine.ruby-lang.org