100% repeatable crash when trying to save as .mol file

I believe this to be a bug with Avogadro

Environment Information

Avogadro version: Replicated on both 1.2.0 and 1.1.1
Operating system and version: Mac OSX, i have replicated this on Mojave 10.14.6 and monterey 12.6.2.

Expected Behavior

Ability to save a .mol file.

Actual Behavior

Avogadro crashes without showing a “hey avogadro just crashed” error.

Steps to Reproduce

How i replicate. Place three carbons, place a carbon farther away on the end, turn it into a double bond, turn that carbon into a oxygen. Place two carbons along the chain, turn them into oxygens. Attempt to save as .mol file.

I have reinstalled avogadro and tried it on another device, same issue occurs.
minimizing does not fix the problem.

Please upload files if appropriate here (or via file-sharing service like Dropbox or Pastebin)

Just to add some other information, i can save it as a string of three carbons without issue. I can add double bond carbon and save, no issue. turn it into propylformaldehyde, no issue.
If i add an oxygen to the #2 carbon, crash everytime
Then i checked would it save (OH)CH2C=OH, and that works.
but if i add a carbon, it crashes. So it seems to be this molecule shape that is causing the crash.
Screen Shot 2023-05-23 at 2.19.00 PM

Also, THIS saves ok.
Screen Shot 2023-05-23 at 2.19.59 PM

Ok sorry ive now gotten confused myself as to the source of the error. I was able to avoid a crash by saving it as a much larger molecule and then modifying it into the molecule that crashes without having an error. HOWEVER when I then deleted the whole molecule, and tried to do it again in the same file using the same order of steps as i had previously and attempted to save. it crashed again. So i suspect is has something not to do with the actual molecule shape but the steps used to make the molecule?

Oh last thing, after the error occurs, whichever file which was being saved into becomes corrupted and reads as zero bytes.

Maybe last thing, just got it to repeat the error when maxing a hexane ring. Replacing a hydrogen with an oxygen on the ring, no crash, replacing two hydrogens with oxygens, crash while saving.

I can actually replicate the error with the hexane ring by replacing any two hydrogens with anything, it has occured for both bromine and carbon.

This got me thinking that the error always seems to occur when i replace a hydrogen with something. And I was able to avoid a crash on the hexane ring by adding the carbons by dragging from a carbon to another. (Forming 1,2-dimethyl cyclohexane, which had crashed previously) but going back to the original formaldehyde molecule, adding the oxygens by dragging rather than clicking on a hydrogen did not fix the problem, although it seemed to fix it somewhat for the ring?? This is might confusing.

Just tried again to do the ring with carbons by dragging and this time it failed? perhaps its a stereochemistry thing?

I could do a workaround to forming the ring by making the final building step the closing of the ring rather than the ring being made first and then adding the two methyl groups. Perhaps that can shed some light on the underlying issue?

Thanks for the detailed analysis. I’m not sure what the problem is, only that we can’t fix bugs with Avogadro 1.x. (My impression is that it may be with stereochemical assignment.)

While it’s not feature complete, I would definitely suggest using Avo2 (https://two.avogadro.cc/) which I can confirm from personal experience is quite stable.

You can also try saving as a different file format, e.g. mol2 or PDB?