[opensuse-ruby] Problem with segfaulting ruby C bindings in factory (1.9)
Hi, when I port of yast2-ruby-bindings to ruby 1.9 as we use in factory I face segfault when require string from C api. When I attach gdb I don't see anything special. I pass common c string to rb_require method and it segfault. Program received signal SIGSEGV, Segmentation fault. 0x00007ffff5527858 in __longjmp_chk () from /lib64/libc.so.6 (gdb) up #1 0x00007ffff3dd9a5c in rb_require_safe () from /usr/lib64/libruby1.9.so.1.9 (gdb) up #2 0x00007ffff4199e9c in YRuby::loadModule (argList=...) at /home/abuild/rpmbuild/BUILD/yast2-ruby-bindings-0.3.10/src/ruby/YRuby.cc:145 145 VALUE result = rb_require(module_path.c_str()); (gdb) p module_path $1 = "/home/abuild/rpmbuild/BUILD/yast2-ruby-bindings-0.3.10/tests/ycp/URI" To play with it do local osc build and then chroot into it with osc chroot ( I have extra packages for osc vim and gdb ). then if you rebuild package with make DEBUG=1 and make DIST=/home/abuild/rpmbuild/BUILDROOT/yast2-ruby-bindings-0.3.11/ then simple do this: cd /home/abuild/rpmbuild/BUILD/yast2-ruby-bindings-0.3.11/tests export Y2DIR=/home/abuild/rpmbuild/BUILDROOT/yast2-ruby-bindings-0.3.11/usr/lib64/YaST2/ gdb /usr/lib/YaST2/bin/y2base run -l - -M . ./ruby_object.ycp UI and you face also segfault. Do you have any hints what could be wrong? Josef -- To unsubscribe, e-mail: opensuse-ruby+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-ruby+owner@opensuse.org
On Thu, Jun 07, 2012 at 05:54:51PM +0200, Josef Reidinger wrote:
Hi, when I port of yast2-ruby-bindings to ruby 1.9 as we use in factory I face segfault when require string from C api.
When I attach gdb I don't see anything special. I pass common c string to rb_require method and it segfault.
Program received signal SIGSEGV, Segmentation fault. 0x00007ffff5527858 in __longjmp_chk () from /lib64/libc.so.6 (gdb) up #1 0x00007ffff3dd9a5c in rb_require_safe () from /usr/lib64/libruby1.9.so.1.9 (gdb) up #2 0x00007ffff4199e9c in YRuby::loadModule (argList=...) at /home/abuild/rpmbuild/BUILD/yast2-ruby-bindings-0.3.10/src/ruby/YRuby.cc:145 145 VALUE result = rb_require(module_path.c_str()); (gdb) p module_path $1 = "/home/abuild/rpmbuild/BUILD/yast2-ruby-bindings-0.3.10/tests/ycp/URI"
[...] Do you have any hints what could be wrong?
I suspect Ruby memory management, but I am prejudiced by an earlier bug: https://bugzilla.novell.com/show_bug.cgi?id=708059 Have you tried valgrind? -- Martin Vidner, YaST developer http://en.opensuse.org/User:Mvidner Kuracke oddeleni v restauraci je jako fekalni oddeleni v bazenu
Am 08.06.2012 15:10, schrieb Martin Vidner:
I suspect Ruby memory management, but I am prejudiced by an earlier bug: https://bugzilla.novell.com/show_bug.cgi?id=708059
Have you tried valgrind?
ruby 1.9 is much harder on the C extensions on how they track their references to global variables, I had to add quite some more calls to rb_global_variable than it was necessary with 1.8. Greetings, Stephan -- To unsubscribe, e-mail: opensuse-ruby+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-ruby+owner@opensuse.org
On Fri, 08 Jun 2012 15:17:39 +0200 Stephan Kulow <coolo@suse.de> wrote:
Am 08.06.2012 15:10, schrieb Martin Vidner:
I suspect Ruby memory management, but I am prejudiced by an earlier bug: https://bugzilla.novell.com/show_bug.cgi?id=708059
Have you tried valgrind?
ruby 1.9 is much harder on the C extensions on how they track their references to global variables, I had to add quite some more calls to rb_global_variable than it was necessary with 1.8.
Greetings, Stephan
Thanks for ideas. I try to debug it when I have time ( I am just worry that I don't have it in time for 12.2 ). Josef -- To unsubscribe, e-mail: opensuse-ruby+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-ruby+owner@opensuse.org
On 08.06.2012 16:03, Josef Reidinger wrote:
On Fri, 08 Jun 2012 15:17:39 +0200 Stephan Kulow <coolo@suse.de> wrote:
Am 08.06.2012 15:10, schrieb Martin Vidner:
I suspect Ruby memory management, but I am prejudiced by an earlier bug: https://bugzilla.novell.com/show_bug.cgi?id=708059
Have you tried valgrind?
ruby 1.9 is much harder on the C extensions on how they track their references to global variables, I had to add quite some more calls to rb_global_variable than it was necessary with 1.8.
Greetings, Stephan
Thanks for ideas. I try to debug it when I have time ( I am just worry that I don't have it in time for 12.2 ).
Hi, I dared to commit right into Yast:HEAD, please pick up for your $VCS Ruby 1.9 makes it pretty hard to embed due to obvious lack of documentation ;( Greetings, Stephan -- To unsubscribe, e-mail: opensuse-ruby+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-ruby+owner@opensuse.org
On Tue, 12 Jun 2012 15:36:00 +0200 Stephan Kulow <coolo@suse.de> wrote:
On 08.06.2012 16:03, Josef Reidinger wrote:
On Fri, 08 Jun 2012 15:17:39 +0200 Stephan Kulow <coolo@suse.de> wrote:
Am 08.06.2012 15:10, schrieb Martin Vidner:
I suspect Ruby memory management, but I am prejudiced by an earlier bug: https://bugzilla.novell.com/show_bug.cgi?id=708059
Have you tried valgrind?
ruby 1.9 is much harder on the C extensions on how they track their references to global variables, I had to add quite some more calls to rb_global_variable than it was necessary with 1.8.
Greetings, Stephan
Thanks for ideas. I try to debug it when I have time ( I am just worry that I don't have it in time for 12.2 ).
Hi,
I dared to commit right into Yast:HEAD, please pick up for your $VCS
Ruby 1.9 makes it pretty hard to embed due to obvious lack of documentation ;(
Greetings, Stephan
Thanks for investigation and patch, I will pick it up ASAP. BTW current VCS for yast is there - https://github.com/yast/yast-ruby-bindings ( yes we move to github ). Josef -- To unsubscribe, e-mail: opensuse-ruby+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-ruby+owner@opensuse.org
participants (3)
-
Josef Reidinger
-
Martin Vidner
-
Stephan Kulow