From: Jiri Zajpt Date: 2009-09-10T00:25:54+09:00 Subject: [ruby-core:25501] [Bug #2069] Segfault in rb_enc_associate() Bug #2069: Segfault in rb_enc_associate() http://redmine.ruby-lang.org/issues/show/2069 Author: Jiri Zajpt Status: Open, Priority: High ruby -v: ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-darwin10] I am having problem with using mysql-ruby driver on Snow Leopard. It segfaults in rb_enc_associate() used by rb_external_str_new_with_enc() function, so I came up with following short example (it also segfaults): example source code --------------------------------------------------------------------- #include void Init_jzexp() { const char* c_str = "test"; VALUE string = rb_external_str_new_with_enc(c_str, strlen(c_str), rb_utf8_encoding()); } - example source code ------------------------------------------------------------------- gdb output --------------------------------------------------------------------- Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_INVALID_ADDRESS at address: 0x0000000000301f98 0x0000000100006a9b in rb_enc_associate () (gdb) where #0 0x0000000100006a9b in rb_enc_associate () #1 0x00000001000ce236 in rb_external_str_new_with_enc () #2 0x0000000100004654 in dln_load () #3 0x00000001000fcba4 in rb_vm_call_cfunc () #4 0x00000001000309c3 in rb_require_safe () #5 0x00000001000fca01 in vm_call_cfunc () #6 0x00000001000fe2b0 in vm_call_method () #7 0x00000001000ff1ec in vm_exec_core () #8 0x00000001001043fe in vm_exec () #9 0x0000000100104540 in rb_iseq_eval_main () #10 0x000000010002df02 in ruby_exec_node () #11 0x000000010002f434 in ruby_run_node () #12 0x0000000100000ecf in main () - gdb output ------------------------------------------------------------------- ---------------------------------------- http://redmine.ruby-lang.org