On Tue, Jul 6, 2010 at 3:52 PM, Noel O'Boyle <baoille...@gmail.com> wrote:
> Hi Tim,
>
> I recently updated to latest trunk and I'm getting a segfault which
> seems to be due to some problem in ring.cpp (but I could be wrong).
> The segfault is triggered by GetParent() Line 606 in ring.cpp which
> does not return a valid molecule. I'd appreciate if you could look
> into it.
>
> Here's the code to reproduce it:
>
>  OBConversion conv;
>  OB_REQUIRE( conv.SetInFormat("sdf") );
>
>  OBMol mol;
>  OB_REQUIRE( conv.ReadFile(&mol, GetFilename("tmp.sdf")) );
>
>  OBBuilder builder;
>  builder.Build(mol);
>
>  mol.AddHydrogens();

  mol.UnsetFlag(OB_SSSR_MOL);
  mol.UnsetFlag(OB_LSSR_MOL);
  mol.UnsetFlag(OB_RINGFLAGS_MOL);
  mol.UnsetFlag(OB_AROMATIC_MOL);
  mol.UnsetFlag(OB_KEKULE_MOL);
  mol.UnsetFlag(OB_CLOSURE_MOL);
  mol.UnsetFlag(OB_AROM_CORRECTED_MOL);
  mol.UnsetFlag(OB_RINGTYPES_MOL);

This fixes the problem. :-) I still have to find out which one it is
though. One of these lines should probably go in Builder or
AddHydrogens...

>  OBForceField* pff = OBForceField::FindType("mmff94");
>  OB_REQUIRE(pff->Setup(mol)); // Segfault
>
> This passes with r3799 (prior to all of the LSSR changes, etc.), but
> segfaults with the HEAD. If the builder lines are commented out,
> there's no segfault.
>
> The test case is attached.
>
> - Noel
>

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel

Reply via email to