sbmlteam / libCombine

a C++ library for working with the COMBINE Archive format

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

metadata problems with python-libsbml and python-libcombine

matthiaskoenig opened this issue · comments

Reading the metadata with libcombine alone works.
But in combination with python-libsbml (which I use in the project) it looks like symbols are overwritten (libcombine.Date with libsbml.Date) and I get segmentation faults (see below).

I think it depends on the order of the import of the python packages, but could not find out in which order these must be imported (and difficult to control because projects I import also use python-libsbml and python-libsedml)

/home/mkoenig/git/tellurium-web/teweb/media/archives/CombineArchiveShowCase_cUbCtPq.omex
./manifest.xml
master: False
None
created: <libsbml.Date proxy of <Swig Object of type 'Date *' at 0x7f0ae8440ed0> > <class 'libsbml.Date'>
modified: <libsbml.Date proxy of <Swig Object of type 'Date *' at 0x7f0ae8440f30> > <class 'libsbml.Date'>
modified: <libsbml.Date proxy of <Swig Object of type 'Date *' at 0x7f0ae8440f90> > <class 'libsbml.Date'>
./README.md
master: False
None
*** Error in `/home/mkoenig/envs/tellurium-web/bin/python': corrupted double-linked list: 0x00007f0ae0010720 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f0b2dabe7e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x7e6ed)[0x7f0b2dac56ed]
/lib/x86_64-linux-gnu/libc.so.6(+0x81cde)[0x7f0b2dac8cde]
/home/mkoenig/git/tellurium-web/teweb/media/archives/CombineArchiveShowCase_cUbCtPq.omex
./manifest.xml
master: False
None
created: <libsbml.Date proxy of <Swig Object of type 'Date *' at 0x7f9561f17ed0> > <class 'libsbml.Date'>
modified: <libsbml.Date proxy of <Swig Object of type 'Date *' at 0x7f9561f17f30> > <class 'libsbml.Date'>
modified: <libsbml.Date proxy of <Swig Object of type 'Date *' at 0x7f9561f17f90> > <class 'libsbml.Date'>
./README.md
master: False
None
created: <libsbml.Date proxy of <Swig Object of type 'Date *' at 0x7f9561f17f60> > <class 'libsbml.Date'>
modified: <libsbml.Date proxy of <Swig Object of type 'Date *' at 0x7f9561f17ed0> > <class 'libsbml.Date'>
modified: <libsbml.Date proxy of <Swig Object of type 'Date *' at 0x7f9561f17f30> > <class 'libsbml.Date'>
modified: <libsbml.Date proxy of <Swig Object of type 'Date *' at 0x7f9561f17ed0> > <class 'libsbml.Date'>
modified: <libsbml.Date proxy of <Swig Object of type 'Date *' at 0x7f9561f17f30> > <class 'libsbml.Date'>
modified: <libsbml.Date proxy of <Swig Object of type 'Date *' at 0x7f9561f17ed0> > <class 'libsbml.Date'>
modified: <libsbml.Date proxy of <Swig Object of type 'Date *' at 0x7f9561f17f30> > <class 'libsbml.Date'>
modified: <libsbml.Date proxy of <Swig Object of type 'Date *' at 0x7f9561f17ed0> > <class 'libsbml.Date'>
modified: <libsbml.Date proxy of <Swig Object of type 'Date *' at 0x7f9561f17f30> > <class 'libsbml.Date'>
modified: <libsbml.Date proxy of <Swig Object of type 'Date *' at 0x7f9561f17ed0> > <class 'libsbml.Date'>
modified: <libsbml.Date proxy of <Swig Object of type 'Date *' at 0x7f9561f17f30> > <class 'libsbml.Date'>
modified: <libsbml.Date proxy of <Swig Object of type 'Date *' at 0x7f9561f17ed0> > <class 'libsbml.Date'>
modified: <libsbml.Date proxy of <Swig Object of type 'Date *' at 0x7f9561f17f30> > <class 'libsbml.Date'>
modified: <libsbml.Date proxy of <Swig Object of type 'Date *' at 0x7f9561f17ed0> > <class 'libsbml.Date'>
./model/BIOMD0000000144.xml
master: False
None
created: <libsbml.Date proxy of <Swig Object of type 'Date *' at 0x7f9561f17ed0> > <class 'libsbml.Date'>
modified: <libsbml.Date proxy of <Swig Object of type 'Date *' at 0x7f9561f17f60> > <class 'libsbml.Date'>
./model/calzone_2007.ai
master: False
None
created: <libsbml.Date proxy of <Swig Object of type 'Date *' at 0x7f9561f17f60> > <class 'libsbml.Date'>
modified: <libsbml.Date proxy of <Swig Object of type 'Date *' at 0x7f9561f17ed0> > <class 'libsbml.Date'>
./model/calzone_2007.png
master: False
None
created: <libsbml.Date proxy of <Swig Object of type 'Date *' at 0x7f9561f17ed0> > <class 'libsbml.Date'>
modified: <libsbml.Date proxy of <Swig Object of type 'Date *' at 0x7f9561f17f60> > <class 'libsbml.Date'>
./model/calzone_2007.svg
master: False
None
created: <libsbml.Date proxy of <Swig Object of type 'Date *' at 0x7f9561f17f60> > <class 'libsbml.Date'>
Segmentation fault (core dumped)

Yes, is definitely the order of imports.
If libsbml is imported after libcombine libcombine breaks, i.e. something like

from libcombine import *
import libsbml

This is the same issue like libsedml and libsbml imports at
fbergmann/libSEDML#21

not entirely sure what I can do about that at this point ... it is also not quite the same issue, as libsedml would not crash afterwards ... i'm having to prepare for a workshop and will try to get back to this end of next week

Hi Frank,
no problem. Just posted this to let you know.
The workaround I found is to reload the module when I am using it to make sure the symbols are correct

import importlib
importlib.reload(libcombine)

Works fine for now.
Thanks for all the fixes.
M