[PATCH] python bindings stability by going without guile
Christoph Holtermann
c.holtermann at gmx.de
Sun Jun 27 09:10:31 EDT 2010
Hello !
Am 16.06.2010 17:20, schrieb Mark Jenkins:
> Attached is a patch that appears to improve stability for the python
> bindings.
>
> Instead of initializing guile and using the gnucash module loading
> mechanisms, I directly link to all needed modules and just use the
> direct initialization functions in pretty much the same way that
> Cutecash does.
>
> I've been doing some work with the bindings for business objects
> (invoice creation), for which I'll be submitting additional patches
> later today. Applying this stability patch has made the difference
> between seg faulting and things actually working.
>
> Christoph, I wonder if this helps with the stack blow out problems
> you've been having?
>
Just now I tried applying the patch. I am not familiar with doing that.
Shortly : It seems to work. I didn´t get a crash until now ( without
excessive
testing).
I´d like to know if I did things halfway correctly :
I tried
patch -i python_bindings_stability_without_guile.patch
in the gnucash directory of Rev 19255.
It did not find the file "src/optional/python-bindings/gnucash_core.i". When
I told it to use "./src/optional/python-bindings/gnucash_core.i" it did
though.
I couldn´t make it to accept Makefile.am in the same way. I applied the
changes by vim then.
In the directory of the python-bindings I did
make clean
make
sudo make install
It seemed to work. It´s surely not completely the right way, is it ?
I didn´t understand Rev 533 in the patchfile for I only know of Rev 19255.
Could you explain ?
Thanks and Goodby,
Christoph Holtermann
> I also had a similar problem with a more complex python application and
> even ended up kludging things to the point where I was moving my "from
> gnucash import" statements to the inside of functions instead of at the
> top of programs to avoid similar trouble. I'll get around to testing if
> this patch helps that at some point, it will take me awhile because I'll
> to port my application to use python bindings in gnucash trunk instead
> of my 2.2 python bindings patches. [the api has changed]
>
> The following earlier patch (/python bindings and lost business data/)
> can be disregarded:
> http://lists.gnucash.org/pipermail/gnucash-devel/2010-June/028760.html
> This current patch also addresses the same lack of module init/load for
> writing business objects that the above patch addressed.
>
> The crazy part here is that I can't actually pin down why things were so
> unstable before and what improvement this makes. We can guess:
> * That linking and running guile from a python module that is loaded
> by the python interpreter is bad for some reason, possibly due to some
> bug in guile or python
>
> * That I was linking to or initializing guile improperly before
>
>
> The downside to this patch is the warnings it causes:
> """
> *** Warning: Linking the shared library _gnucash_core_c.la against the
> loadable module
> *** libgncmod-backend-xml.so is not portable!
>
> *** Warning: Linking the shared library _gnucash_core_c.la against the
> loadable module
> *** libgncmod-business-backend-xml.so is not portable!
>
> *** Warning: Linking the shared library _gnucash_core_c.la against the
> loadable module
> *** libgncmod-backend-dbi.so is not portable!
>
> *** Warning: Linking the shared library _gnucash_core_c.la against the
> loadable module
> *** libgncmod-business-backend-sql.so is not portable!
> """
>
> Christian elaborates on this and suggests that these should become
> normal shared libraries or part of one larger one
> http://lists.gnucash.org/pipermail/gnucash-devel/2010-June/028790.html
>
> (Thanks by the way for adding gnc_module_init_business_core_sql_init() !)
>
>
> Mark Jenkins
> ParIT Worker Co-op
>
> cc Christoph Holtermann
> cc Christian Stimming
> cc fellow ParITistas
> bcc friendly funder of all this
>
>
> p.s. in addition to finding them posted here, all my python bindings
> patches can be accessed by pointing your svn client at:
> http://svn.parit.ca/gnucash/branches/python-bindings/
>
> and you can get all of them as a full patch against trunk by
> svn diff http://svn.parit.ca/gnucash/trunk/
> http://svn.parit.ca/gnucash/branches/python-bindings/
>
>
More information about the gnucash-devel
mailing list