[MacPorts] #74191: Argyll 3.5.0 fails on M4max / Xcode CLT 26 --> workaround

MacPorts noreply at macports.org
Mon Jul 6 20:56:31 UTC 2026


#74191: Argyll 3.5.0 fails on M4max / Xcode CLT 26 --> workaround
--------------------------------+-----------------------------
 Reporter:  MStraeten           |      Owner:  (none)
     Type:  defect              |     Status:  new
 Priority:  Low                 |  Milestone:  MacPorts Future
Component:  ports               |    Version:  2.12.5
 Keywords:  m4max xcode clt 26  |       Port:  argyll
--------------------------------+-----------------------------
 On MacBook M4 Max, Xcode CLT 26 GenRMGam crashes with EXC_BAD_ACCESS
 during recursive tree traversal in radial_point_triang() (gamut.c around
 line 3989).

 It seems to be triggered by compiler optimization (-Os / -O2).

 Workaround: Lowering optimization to -O0 completely resolves the crash.

 {{{
 sudo port install argyll configure.optflags="-O0"
 }}}

 longterm solution: add
 {{{
 configure.optflags -O0
 }}}
 to the Portfile - but not sure, if that's appropriate when just one
 failing processor/sdk combination is known


 Background (analysis by gemini):
 When optimization flags like -Os (optimize for size) or -O2 are active,
 the compiler makes aggressive assumptions about pointer arithmetic and
 memory layouts to make the machine code as compact and fast as possible.

 In gamut.c — which heavily relies on complex tree structures and recursive
 quadtrees — the new Clang compiler erroneously optimizes away critical
 safety checks (such as if (np != NULL)) or miscalculates pointer offsets.
 It likely presumes certain memory states are "undefined behavior" or
 impossible. Because the M4 Max uses a massive, differently mapped virtual
 address space compared to older Intel or M1 chips, these bad compiler
 assumptions cause the pointers to jump to invalid addresses (e.g., jumping
 from 0x00000001... to 0x00000008...), triggering an immediate
 EXC_BAD_ACCESS crash.

-- 
Ticket URL: <https://trac.macports.org/ticket/74191>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list