[Bug 705425] New: ruby-bindings: YaST crash during the call of ruby method
https://bugzilla.novell.com/show_bug.cgi?id=705425 https://bugzilla.novell.com/show_bug.cgi?id=705425#c0 Summary: ruby-bindings: YaST crash during the call of ruby method Classification: openSUSE Product: openSUSE 11.4 Version: Final Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: YaST2 AssignedTo: dmacvicar@novell.com ReportedBy: jsuchome@novell.com QAContact: jsrain@novell.com Found By: Development Blocker: --- KerberosClient.rb is located under /usr/share/YaST2/modules modified Kerberos.ycp is importing KerberosClient.rb and tries to call read function from that module It crashes with these last lines in y2log: 2011-07-13 14:42:51 <1> dhcp74.suse.cz(18030) [Y2Ruby] ruby/YRuby.cc(callInner):164 Adding argument 0 of type MAP 2011-07-13 14:42:51 <1> dhcp74.suse.cz(18030) [Y2Ruby] ruby/YRuby.cc(callInner):168 Wll call function 'read' in module 'KerberosClient' with '1' arguments -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=705425 https://bugzilla.novell.com/show_bug.cgi?id=705425#c1 --- Comment #1 from Jiří Suchomel <jsuchome@novell.com> 2011-07-13 12:46:42 UTC --- Created an attachment (id=439666) --> (http://bugzilla.novell.com/attachment.cgi?id=439666) modified Kerberos.ycp -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=705425 https://bugzilla.novell.com/show_bug.cgi?id=705425#c2 --- Comment #2 from Jiří Suchomel <jsuchome@novell.com> 2011-07-13 12:47:22 UTC --- Created an attachment (id=439668) --> (http://bugzilla.novell.com/attachment.cgi?id=439668) ruby module -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=705425 https://bugzilla.novell.com/show_bug.cgi?id=705425#c3 --- Comment #3 from Jiří Suchomel <jsuchome@novell.com> 2011-07-13 12:52:56 UTC --- Created an attachment (id=439669) --> (http://bugzilla.novell.com/attachment.cgi?id=439669) backtrace -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=705425 https://bugzilla.novell.com/show_bug.cgi?id=705425#c4 --- Comment #4 from Josef Reidinger <jreidinger@novell.com> 2011-07-14 12:24:15 UTC --- We investigate that stack is broken. We expect that ruby bindings somehow break it as it works without ruby bindings. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=705425 https://bugzilla.novell.com/show_bug.cgi?id=705425#c5 Klaus Kämpf <kkaempf@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO InfoProvider| |jsuchome@novell.com --- Comment #5 from Klaus Kämpf <kkaempf@novell.com> 2011-07-14 15:10:16 UTC --- Please provide a complete description on how to reproduce the bug -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=705425 https://bugzilla.novell.com/show_bug.cgi?id=705425#c6 Jiří Suchomel <jsuchome@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW InfoProvider|jsuchome@novell.com | --- Comment #6 from Jiří Suchomel <jsuchome@novell.com> 2011-07-14 15:30:11 UTC --- 1. Download yast-- project from https://github.com/yast/yast-- 2. Follow the README to install the project. 3. YaST needs library files under YaST directory and with YaST-like name: link kerberos_client.rb (https://github.com/yast/yast--/blob/master/kerberos-client/kerberos_clientrb) to /usr/share/YaST2/modules/KerberosClient.rb (btw, there are bugs 705422, 705417 for this) 4. Run this ycp code: { import "KerberosClient"; y2internal ("read: %1", KerberosClient::read ($[])); } -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=705425 https://bugzilla.novell.com/show_bug.cgi?id=705425#c7 --- Comment #7 from Josef Reidinger <jreidinger@novell.com> 2011-07-14 15:55:12 UTC --- I simplify code much more. I extract call from ruby bindings how it does it and reproduce crash. It is at https://github.com/yast/yast-- located in directory testC -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=705425 https://bugzilla.novell.com/show_bug.cgi?id=705425#c8 --- Comment #8 from Josef Reidinger <jreidinger@novell.com> 2011-07-14 16:27:58 UTC --- well, C code actually works, my fault. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=705425 https://bugzilla.novell.com/show_bug.cgi?id=705425#c9 Klaus Kämpf <kkaempf@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO InfoProvider| |jsuchome@novell.com Severity|Normal |Major --- Comment #9 from Klaus Kämpf <kkaempf@novell.com> 2011-07-18 08:44:21 UTC --- (In reply to comment #6)
1. Download yast-- project from https://github.com/yast/yast--
2. Follow the README to install the project.
Please fix this. Testing YaST-- and reproducing bugs must not require root privileges.
3. YaST needs library files under YaST directory and with YaST-like name: link kerberos_client.rb (https://github.com/yast/yast--/blob/master/kerberos-client/kerberos_client.r...) to /usr/share/YaST2/modules/KerberosClient.rb
See above
(btw, there are bugs 705422, 705417 for this)
4. Run this ycp code:
How does one run this code ?
{ import "KerberosClient"; y2internal ("read: %1", KerberosClient::read ($[])); }
-- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=705425 https://bugzilla.novell.com/show_bug.cgi?id=705425#c10 Jiří Suchomel <jsuchome@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW InfoProvider|jsuchome@novell.com | --- Comment #10 from Jiří Suchomel <jsuchome@novell.com> 2011-07-18 08:48:35 UTC --- (In reply to comment #9)
(In reply to comment #6)
1. Download yast-- project from https://github.com/yast/yast--
2. Follow the README to install the project.
Please fix this. Testing YaST-- and reproducing bugs must not require root privileges.
You need root privileges for 'sudo rake install', which is usual for any project.
3. YaST needs library files under YaST directory and with YaST-like name: link kerberos_client.rb (https://github.com/yast/yast--/blob/master/kerberos-client/kerberos_client.r...) to /usr/share/YaST2/modules/KerberosClient.rb
See above
This is workaround for another ruby-bindings bugs, as already mentioned:
(btw, there are bugs 705422, 705417 for this)
4. Run this ycp code:
How does one run this code ?
/sbin/yast2 ./this_example.ycp -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=705425 https://bugzilla.novell.com/show_bug.cgi?id=705425#c11 --- Comment #11 from Klaus Kämpf <kkaempf@novell.com> 2011-07-18 08:58:24 UTC --- (In reply to comment #10)
(In reply to comment #9)
(In reply to comment #6)
1. Download yast-- project from https://github.com/yast/yast--
2. Follow the README to install the project.
Please fix this. Testing YaST-- and reproducing bugs must not require root privileges.
You need root privileges for 'sudo rake install', which is usual for any project.
But completely wrong for development and testing IMHO. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=705425 https://bugzilla.novell.com/show_bug.cgi?id=705425#c12 --- Comment #12 from Jiří Suchomel <jsuchome@novell.com> 2011-07-18 09:21:33 UTC --- (In reply to comment #11)
Please fix this. Testing YaST-- and reproducing bugs must not require root privileges.
You need root privileges for 'sudo rake install', which is usual for any project.
But completely wrong for development and testing IMHO.
AFAIK it's for the D-BUS stuff which needs to be in correct directory. Anyway, it is sure that the project needs improvements on all parts, including configuration. That may be point of bugs against YaST++ project, but not of this one, which shows problems in ruby-bindings. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=705425 https://bugzilla.novell.com/show_bug.cgi?id=705425#c13 --- Comment #13 from Duncan Mac-Vicar <dmacvicar@novell.com> 2011-07-18 10:05:39 UTC --- I discussed this bug with Jiri during the workshop. The reason it happens is because the bindings use Method#arity when it should probably use Method#parameters (as detailed in the ruby-doc). Method#arity returns negative numbers when there are optional parameters and this causes the crash. So YCP should always call ruby passing _all_ parameters of a ruby method with optional arguments. Sadly, the advertised Merthod#parameters (http://www.ruby-doc.org/core/classes/Method.html#M001075) does not seem to be available in the interpreter. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=705425 https://bugzilla.novell.com/show_bug.cgi?id=705425#c14 --- Comment #14 from Jiří Suchomel <jsuchome@novell.com> 2011-07-18 10:11:25 UTC --- (In reply to comment #13)
I discussed this bug with Jiri during the workshop. The reason it happens is because the bindings use Method#arity when it should probably use Method#parameters (as detailed in the ruby-doc).
No, you are referring to a different one: bug 705420 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=705425 https://bugzilla.novell.com/show_bug.cgi?id=705425#c Jiří Suchomel <jsuchome@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 - None |P3 - Medium -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=705425 https://bugzilla.novell.com/show_bug.cgi?id=705425#c15 Klaus Kämpf <kkaempf@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO InfoProvider| |jsuchome@novell.com Severity|Major |Critical --- Comment #15 from Klaus Kämpf <kkaempf@novell.com> 2011-07-25 08:33:56 UTC --- Hmm, I don't get a crash but 2011-07-25 10:30:14 <3> heron(19808) [Parser] yast--/bnc705425.ycp:3 Excessive parameter in call to KerberosClient::read(...) 2011-07-25 10:30:14 <3> heron(19808) [Parser] yast--/bnc705425.ycp:3 Bad parameter '<map> $[]' 2011-07-25 10:30:14 <1> heron(19808) [wfm] Y2CCWFM.cc(createInLevel):148 Parsing finished 2011-07-25 10:30:14 <3> heron(19808) [liby2] genericfrontend.cc(print_error):920 Error while creating client module /bnc705425.ycp -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=705425 https://bugzilla.novell.com/show_bug.cgi?id=705425#c16 Klaus Kämpf <kkaempf@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |ASSIGNED InfoProvider|jsuchome@novell.com | --- Comment #16 from Klaus Kämpf <kkaempf@novell.com> 2011-07-25 08:50:36 UTC --- The problem is arity being -1 for a 'varargs'-like parameter list. This is not handled properly by yast2-ruby-bindings. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=705425 https://bugzilla.novell.com/show_bug.cgi?id=705425#c17 --- Comment #17 from Jiří Suchomel <jsuchome@novell.com> 2011-07-25 09:07:04 UTC --- (In reply to comment #16)
The problem is arity being -1 for a 'varargs'-like parameter list. This is not handled properly by yast2-ruby-bindings.
Which is bug 705420. As a workaround, it should work to call KerberosClient::read () from example ycp code (without argument). Or remove default argument value from read function of https://github.com/yast/yast--/blob/master/kerberos-client/kerberos_client.r... -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=705425 https://bugzilla.novell.com/show_bug.cgi?id=705425#c18 --- Comment #18 from Klaus Kämpf <kkaempf@novell.com> 2011-07-25 09:08:09 UTC --- A good fix would require Ruby 1.9 (which has Method#parameters). We could make this a pre-requisite for further YaST++ development ... -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=705425 https://bugzilla.novell.com/show_bug.cgi?id=705425#c19 --- Comment #19 from Jiří Suchomel <jsuchome@novell.com> 2011-07-25 09:11:37 UTC --- We could live (and develop) with arity bug not being fixed. The real pain is this crash bug. (In reply to comment #17)
Or remove default argument value from read function of https://github.com/yast/yast--/blob/master/kerberos-client/kerberos_client.r...
I just did it in git. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=705425 https://bugzilla.novell.com/show_bug.cgi?id=705425#c20 --- Comment #20 from Klaus Kämpf <kkaempf@novell.com> 2011-07-25 09:24:06 UTC --- (In reply to comment #17)
(In reply to comment #16)
The problem is arity being -1 for a 'varargs'-like parameter list. This is not handled properly by yast2-ruby-bindings.
Which is bug 705420.
As a workaround, it should work to call KerberosClient::read () from example ycp code (without argument).
Or remove default argument value from read function of https://github.com/yast/yast--/blob/master/kerberos-client/kerberos_client.r...
Right, now I get a segfault -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=705425 https://bugzilla.novell.com/show_bug.cgi?id=705425#c21 --- Comment #21 from Klaus Kämpf <kkaempf@novell.com> 2011-07-25 09:37:43 UTC --- gdb shows: #0 0x00007f31dff9896f in jump_tag_but_local_jump (state=6, val=<value optimized out>) at eval.c:1853 1853 JUMP_TAG(state); state == 6 means 'TAG_RAISE' ?! Code is: #define JUMP_TAG(st) do { \ ruby_frame = prot_tag->frame; \ ruby_iter = prot_tag->iter; \ ruby_longjmp(prot_tag->buf,(st)); \ } while (0) and (gdb) print prot_tag $2 = (struct tag *) 0x0 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=705425 https://bugzilla.novell.com/show_bug.cgi?id=705425#c22 --- Comment #22 from Martin Vidner <mvidner@novell.com> 2011-07-25 13:30:21 CEST --- During the workshop Pepa and I found that it is trying to raise a SystemStackError. Looking into that, we found that there seems to be no particularly deep recursion. Maybe we are omitting some initialization step in the bindings. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=705425 https://bugzilla.novell.com/show_bug.cgi?id=705425#c23 --- Comment #23 from Klaus Kämpf <kkaempf@novell.com> 2011-07-25 11:40:49 UTC --- (In reply to comment #22)
During the workshop Pepa and I found that it is trying to raise a SystemStackError. Ah, this would explain the TAG_RAISE
Looking into that, we found that there seems to be no particularly deep recursion. Maybe we are omitting some initialization step in the bindings.
I was comparing the initialization with the one from cmpi-bindings-ruby and couldn't find a difference. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=705425 https://bugzilla.novell.com/show_bug.cgi?id=705425#c24 --- Comment #24 from Klaus Kämpf <kkaempf@novell.com> 2011-07-25 13:12:37 UTC --- The segfault is fixed now. Will checkin in a moment. This brought me on the right track: http://objectmix.com/ruby/749825-re-rb_require-causes-segfault.html (Bottom line: You _have_ to wrap your rb_funcall in rb_protect if the funcall might raise an exception) -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=705425 https://bugzilla.novell.com/show_bug.cgi?id=705425#c25 Klaus Kämpf <kkaempf@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |FIXED --- Comment #25 from Klaus Kämpf <kkaempf@novell.com> 2011-07-25 13:21:40 UTC --- Now I get: 2011-07-25 15:20:31 <3> heron(10453) [Y2Ruby] ruby/YRuby.cc(callInner):219 KerberosClient.read failed stack level too deep /usr/lib64/ruby/site_ruby/1.8/dbus/bus.rb:211:in `initialize' /usr/lib64/ruby/site_ruby/1.8/dbus/bus.rb:686:in `initialize' /usr/lib64/ruby/1.8/singleton.rb:94:in `new' /usr/lib64/ruby/1.8/singleton.rb:94:in `instance' /usr/lib64/ruby/vendor_ruby/1.8/dbus_clients/file_client.rb:30:in `dbus_object' /usr/lib64/ruby/vendor_ruby/1.8/dbus_clients/file_client.rb:14:in `read' /abuild/projects/yast/yast--/kerberos-client/kerberos_client.rb:10:in `read' but thats a different problem. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=705425 https://bugzilla.novell.com/show_bug.cgi?id=705425#c26 --- Comment #26 from Jiří Suchomel <jsuchome@novell.com> 2011-07-25 13:34:10 UTC --- Cool! Do you we already have a bug report for the new bug? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=705425 https://bugzilla.novell.com/show_bug.cgi?id=705425#c27 --- Comment #27 from Klaus Kämpf <kkaempf@novell.com> 2011-07-25 13:35:22 UTC --- And the 'different problem' might be this one: http://stackoverflow.com/questions/4082989/calling-ruby-function-from-c-in-a... -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=705425 https://bugzilla.novell.com/show_bug.cgi?id=705425#c Klaus Kämpf <kkaempf@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |708059 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=705425 https://bugzilla.novell.com/show_bug.cgi?id=705425#c28 --- Comment #28 from Klaus Kämpf <kkaempf@novell.com> 2011-07-25 13:39:23 UTC --- (In reply to comment #26)
Cool! Do you we already have a bug report for the new bug?
bnc#708059 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=705425 https://bugzilla.novell.com/show_bug.cgi?id=705425#c29 --- Comment #29 from Bernhard Wiedemann <bwiedemann@novell.com> 2011-07-26 17:00:36 CEST --- This is an autogenerated message for OBS integration: This bug (705425) was mentioned in https://build.opensuse.org/request/show/77099 Factory / yast2-ruby-bindings -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com