[kde-edu]: kalzium molecular viewer segfaults

Benoit Jacob jacob at math.jussieu.fr
Sun Nov 18 00:06:59 CET 2007


After thinking a bit more about all that:

On Sat, 17 Nov 2007, Benoit Jacob wrote:
> to load molecules. See file kalzium/compoundviewer/openbabel2wrapper.cpp.
> From your debugging output it seems that the crash occurs at line 51 of
> that file:
>
> 	Conv.SetInAndOutFormats( inFormat,inFormat );
>
> but a full backtrace would definitely help making sure. Apparently this
> OpenBabel calls another OpenBabel function, "SetOutFormat", which
> segfaults. By the way, looking at the above line, I realize that it feels
> strange to have "inFormat" passed twice so perhaps there's also something
> to fix here. I really don't know.

I think: why the HECK are we setting at all the Out format? We only read 
molecules in Kalzium, we don't write to them (in kde 4.0) so we could (and 
probably should) only set the In format. Since your crash occurs in 
SetOutFormat, this would also quite possibly fix it!!

So please try this: on line 51 of 
kalzium/compoundviewer/openbabel2wrapper.cpp, please apply this diff:
-       Conv.SetInAndOutFormats( inFormat,inFormat );
+       Conv.SetInFormat(inFormat);

Tell me if that works,

Cheers,

Benoit


More information about the kde-edu mailing list