Python calling D

Russel Winder russel at winder.org.uk
Sun Feb 2 07:31:08 PST 2014


On Sun, 2014-02-02 at 01:07 +0000, Ellery Newcomer wrote:
> On Saturday, 1 February 2014 at 22:02:24 UTC, Russel Winder wrote:
> >
> > My problem of the moment is segmentation faults during 
> > execution, and I
> > have no model of how to go about providing useful data to debug
> > this :-((
> 
> It wouldn't by any chance be related to
> 
> https://bitbucket.org/ariovistus/pyd/issue/17/it-seems-py_incref-missed-when-pydobject
> 
> would it?

Possibly but I am working with the trivial hello world:

        import std.stdio ;
        
        extern(C) {
            void sayHello() {
                writeln("Hello World.");
            }
        }

is compiled into a shared object and the python is:

        import ctypes
        
        if __name__ == '__main__':
            module = ctypes.cdll.LoadLibrary('lib_helloWorld.so')
            module.sayHello()
        
result is:

        |> LD_LIBRARY_PATH=. python execute.py 
        Segmentation fault

I am not sure how I should go about getting a stack trace that is
meaningful. I am on Debian Unstable the above is with a Python 2
virtualenv with PyD installed.

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder at ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel at winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder



More information about the Digitalmars-d-learn mailing list