Closed avandecreme closed 10 months ago
Thanks very much for this. As far as I know you are the first person to have used the UnitInference since I wrote it some years ago and there may well be undiscovered issues. But thank you for the detailed report this is very helpful
The following program segfault when fed the following uncompressed file
From what I gathered, it is because
tempUD1
is set toNULL
here: https://github.com/sbmlteam/libsbml/blob/49ce5b40ead6862c1a610a569d0606f03a4fb4fa/src/sbml/units/UnitFormulaFormatter.cpp#L2635 The reason for that is thatinverseFunctionOnUnits
callsUnitDefinition::divide
on twoUnitDefinition
s having different level and version (L2V4 like the original doc and L3V2 like the converted one), so we are falling in the following branch: https://github.com/sbmlteam/libsbml/blob/49ce5b40ead6862c1a610a569d0606f03a4fb4fa/src/sbml/UnitDefinition.cpp#L1467I found two ways to avoid the crash:
Having level/version conversion in between function expansion and unit inference also segfault.