[Bug 289714] audio/ardour: does not start on Rel. 14.3

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 03 Feb 2026 00:26:12 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289714

--- Comment #12 from Peter Much <pmc@citylink.dinoex.sub.org> ---
I solved a couple of issues now:

1. When building with -O0 (and maybe also -O1), there are no 
   crashes and apparently no problem.
   However, compiling with -O0 is not working straightforward.
   The port Mk environment will stop configuring -02 when WITH_DEBUG
   is choosen, and the waf configurator will stop configuring -O3
   when --optimize is not selected. But without --optimize waf
   will also remove all CFLAGS and the --arch switches, and then
   compilation does fail because it doesn't find SSE functions.
   Setting waf to --keepflags preserves the CFLAGS, but not the
   --arch switches.
   Therefore the SSE switches need to go into CFLAGS, and WITH_DEBUG
   should switch from --optimize to --keepflags.

2. The actual cause for the crashes is related to math optimization.
   The waf configurator will automatically set -ffast-math when
   --optimize is choosen, and that causes the 'inf' values to get
   into the user configuration file. Then at the next program start
   crashes or hangs or other strange things will result.
   The compile already emits warnings that the settings concerning
   infinity  lead to "undefined behaviour".
   The issue can be fixed by adding -fno-finite-math-only. This one
   must go into the --arch settings, because it is only needed with
   --optimize, and it must be placed after -fmath-only (CFLAGS are
   before).

3. There is more than one crash reason on startup. The known crash
   that happens in the red-black-tree within the c++ library comes
   from 'inf' Values in the user configuration. 
   But another crash happens even before, and only when there is
   no user configuration file present yet (and only when compiler
   optimization is in effect). This crash happens at the time when
   the first connection is requested from jack, for unknown reasons.
   The user configuration is then already half written, and
   subsequently starting the program again is then successful.
   I didn't investigate what causes this, but after surrounding
   the problematic function code with #pragma optimize off, the
   problem didn't reappear.

4. There is another bug when terminating the programm: it will not
   terminate and has to be killed.
   This happens independent from optimization and is because some
   USB hotplug thread does not return and is waited for indefinitely.
   It can be avoided by adding a missing invocation of
   libusb_interrupt_event_handler(3) at the proper place.

5. Then there is another crash happening in the Routing Grid, when
   moving the mouse around, somehow appears a bogus channel number
   -1 for the highlighting.
   This one is also related to optimization and -ffast-math, and
   goes away when additionally setting -fsigned-zeros.

-- 
You are receiving this mail because:
You are the assignee for the bug.