Forums

F.A.Q. F.A.Q.    Register Register    Login Login    Home Home
Search Search
SBML Discussions » libsbml-development » libSBML.so crashes (using java bindings)
Show: Today's Posts  :: Message Navigator
| Subscribe to topic 
Return to the default flat view Create a new topic Submit Reply
AuthorTopic
andreasb


Posts: 2
Registered:
August 2008
libSBML.so crashes (using java bindings) 08 Aug '08 02:22 Go to previous message

Hi,

I ran into some troubles using libSBML recently. I use the java binding and everything seemed to work fine. The problem I found occurs very unfrequently so I tried to create a reproducable setup that generates the error messages. The errors happen more often for certain files than for others. Do you think this might be a misuse of the java bindings, or maybe a bug in the c++ code?

The errors don't seem to be compile- or platform- or library(java-versions, etc)-specific. During testing, the same line of code can produce any of the error messages in the attached file named 'sbml.errrors'.

I hope following report can help you. It contains compiler options, lib versions, the java program generating the errors and a file with error messages:

//edit: the SBML model input file is now attached as well.

===========================================================
REPORT
===========================================================
Compiling:
---------------------------
I compiled with Xerces(2.7.0) and expat swig(1.3.33). And the java code was run on (java-1.5, java-1.6) on different platform (Ubuntu, XUbuntu, SuSE) and architectures (32 bit, 64 bit):

compiler options:

--with-expat --with-java --with-swig

--with-xerces --with-java --with-swig

---------------------------
Java-Code:
---------------------------

public class DefaultSBMLEngine {

    public static Logger logger = Logger.getRootLogger();

    static {
        try {
            System.out.println(System.getProperty("java.library.path"));
            System.loadLibrary("sbmlj");
            /* Extra check to be sure we have access to libSBML: */
            Class.forName("org.sbml.libsbml.libsbml");
        } catch (Exception e) {
            System.err.println("Error: could not load the libSBML library");
            System.exit(1);
        }
    }

    public static void main(String[] args) {

        // Initialize the logger
        try {
            Date d = new Date();
            SimpleLayout layout = new SimpleLayout();
            ConsoleAppender consoleAppender = new ConsoleAppender(layout);
            logger.addAppender(consoleAppender);
            FileAppender fileAppender =
                new FileAppender(layout, d.getTime() + "sbmlengine.log", false);
            logger.addAppender(fileAppender);
            logger.setLevel(Level.DEBUG);
            logger.info("Program started at:\t" + DateFormat.getInstance().format(d));
        } catch (Exception ex) {
            System.out.println(ex);
        }

        testLibSBML();
    }

    public static void testLibSBML() {
        // SBML Model
        String interactionType = "";
        File f = null;
        String pathId = null;
        boolean subtype = false;

        for (int i = 0; i < 1000; i++) {
            Model model = null;
            SBMLReader sbmlreader = new SBMLReader();
            ListOfSpecies listSpec = new ListOfSpecies();
            ListOfReactions listReac = new ListOfReactions();
            try {
                model = (sbmlreader.readSBMLInternal("Integrin_signalling_pathway.xml")).getModel();
                listSpec = model.getListOfSpecies();
                listReac = model.getListOfReactions();

                // get the pathname
                pathId = model.getId();

                // iterate species
                for (long count_s = 0; count_s < listSpec.size(); count_s++) {
                    Species s = new Species();
                    XMLNode notes = null;
                    s = (Species)listSpec.get(count_s);
                    notes = s.getNotes();
                    String strNotes1 = XMLNode.convertXMLNodeToString(notes);
                }
                // iterate reac
                for (long count_s = 0; count_s < listReac.size(); count_s++) {
                    Reaction r = new Reaction();
                    r = (Reaction)listReac.get(count_s);

                    XMLNode a = r.getAnnotation();

                    String annot = XMLNode.convertXMLNodeToString(a.getChild(0));
                }
                sbmlreader.delete();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}


Attachment: sbml.errors
(Size: 19.16KB, Downloaded 267 time(s))
Attachment: Integrin_signalling_pathway.xml
(Size: 199.01KB, Downloaded 301 time(s))

[Updated on: 09 Aug '08 03:07]

      

SubjectPosterDate
Read Message   libSBML.so crashes (using java bindings)  andreasb08 Aug '08 02:22
Read Message   Re: libSBML.so crashes (using java bindings) ajouraku10 Aug '08 08:19
Read Message   Re: libSBML.so crashes (using java bindings) andreasb10 Aug '08 12:55
Previous Topic:Release of libSBML-3.2.0
Next Topic:Compatibility problems with libsbml 2.3.4 on Mac OS X and Windows
Go to forum:
-=] Back to Top [=-

Powered by FUDforum. (Copyright Advanced Internet Designs Inc.)

Please use our issue tracking system for any questions or suggestions about this website.