Skip to content

Python crash with idlist.at() #306

@luciansmith

Description

@luciansmith

The following Python program crashes Python entirely:

import libsbml

doc = libsbml.readSBMLFromFile("BIOMD0000000001_url.xml")
model = doc.getModel()
metaIdList = model.getAllElementMetaIdList()
print(metaIdList.size())
metaIdList.at(0)

Same with the similar:

import libsbml

doc = libsbml.readSBMLFromFile("BIOMD0000000001_url.xml")
model = doc.getModel()
idList = model.getAllElementIdList()
print(idList.size())
idList.at(0)

The particular model doesn't matter, but it does have many elements with both IDs and with metaids. The lists claim to be of size zero, however, so there's a couple issues:

  • Those functions should presumably return a list of all the metaids/ids in the model.
  • The 'at' function shouldn't crash Python when called with an invalid argument.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions