Avogadro crashes when trying to open Orca output files

I believe this to be a bug with Avogadro:

For some reason I am unable to open some Orca output files with Avogadro2 on my Mac. Every time I try, the program crashes without warning. This does not happen with Gaussian output files. The Orca output files I try to open are very simple opt freq calculations—nothing particularly exotic. This happens regardless of whether I use the x86 or ARM versions of Avogadro (both work on my computer). However, it does not happen for all output files (for some reason, the \ce{H2O} calculation I use to test installations opens without issue…). I genuinely don’t know what might be going wrong. I’ll attach one of the crash-inducing output files below (it does not seem to depend on whether the file ends in .out or .log).

Environment Information

Avogadro version: 1.99.0
Operating system and version: macOS Sonoma 14.3.1 (MacBook Pro, M1 Max)

Expected Behaviour

I would expect the Orca output file to open in the same way the Gaussian output file does. Gaussian output files open without any problems.

Actual Behavior

As soon as I try to open the Orca output file, Avogadro2 crashes, and a crash report is printed (attached to this post).

Steps to Reproduce

Attempt to open Orca output file.

ph3.h2o-opt-freq-ccsdt-tz3.log (684.0 KB)
Avogadro2 crash report (ARM).txt (84.9 KB)

Tried opening your log file and it also crashes (segfault) with the nightly Linux AppImage, but works perfectly with a self-compiled build, weirdly. Just to add information.

The problem is that Orca prints basis set information in a different order and the code has to shuffle everything. That seems to be the crash - since the file uses a custom basis set. (Avogadro of course should handle it.)

I’ll take a look, but it might be a while before I can clean up the orbital reordering code.

When I write my input files, I tell Orca to print the basis sets for me (just for diagnostic purposes). When I tried to open an output file where I didn’t ask for the basis sets to be printed, the file opened without issue. I guess it’s just the Print[ P_Basis ] command causing the issue…