V Mon, 2 Oct 2017 09:34:27 -0600
David Mulder <[email protected]> napsáno:

> I've written a yast module in python (can be found here:
> https://github.com/dmulder/yast-gpmc ), and have encountered some
> issues.
> 
> * When exiting the module, it always crashes, with a backtrace. It
> appears that yast is crashing in a destructor somewhere.
> <main>: [BUG] Segmentation fault at 0x000000000017f0
> ruby 2.2.6p396 (2016-11-15 revision 56800) [x86_64-linux-gnu]
> 
> -- Control frame information
> ----------------------------------------------- c:0001 p:0000 s:0002
> E:0025e0 TOP    [FINISH]
> 
> 
> -- Machine register context
> ------------------------------------------------ RIP:
> 0x00000000000017f0 RBP: 0x00007f69a34388c0 RSP: 0x00007f699f6b9a98
> RAX: 0x00007f69983cff90 RBX: 0x00007f69980eb2a0 RCX:
> 0x00007f6998002e80 RDX: 0x00007f699f6b9cf0 RDI: 0x00007f69980eb2a0
> RSI: 0x00007f69980eb2a0 R8: 0x00007f69984dadc8  R9:
> 0x00007f69984dada0 R10: 0x000055efbe7e7660 R11: 0x0000000000040614
> R12: 0x00007f699f6b9cf0 R13: 0x00007f6998002150 R14:
> 0x00007f69980eb2a0 R15: 0x00007f699f6b9cf0 EFL: 0x0000000000010206
> 
> -- C level backtrace information
> -------------------------------------------

output is not much helpful, can you debug it with gdb and valgrind and
print where it is badly accessed?

> 
> 
> * Yast doesn't recognize python modules that are installed, and
> doesn't add them to the menu.
> > l /usr/local/share/YaST2/clients/gpmc.py  
> -rw-r--r-- 1 root root 2057 Sep 28 09:03
> /usr/local/share/YaST2/clients/gpmc.py
> > sudo yast2 gpmc  
> No such client module gpmc
> 

It is known limitation of python bindings. Perl and python bindings
does not have support for clients. Only ruby bindings have it and it
was a bit tricky to add it.
If you want to add it to python, check how ruby ones are done: 

https://github.com/yast/yast-ruby-bindings/blob/master/src/binary/Y2CCRubyClient.h
https://github.com/yast/yast-ruby-bindings/blob/master/src/binary/Y2RubyClientComponent.h

actual call of client
https://github.com/yast/yast-ruby-bindings/blob/master/src/binary/Y2RubyClientComponent.cc#L53
https://github.com/yast/yast-ruby-bindings/blob/master/src/binary/YRuby.cc#L237

so in short. You have to have Component creator for clients, then
client component which do then actual call of python method that
somehow invoke python code.
--
To unsubscribe, e-mail: [email protected]
To contact the owner, e-mail: [email protected]

Reply via email to