Index | Thread | Search

From:
Greg Steuck <gnezdo@openbsd.org>
Subject:
Re: -current Haskell ports aborting with SIGILL
To:
James Cook <falsifian@falsifian.org>
Cc:
Evan Silberman <evan@jklol.net>, Stuart Henderson <stu@spacehopper.org>, Greg Steuck <greg@nest.cx>, ports@openbsd.org, Antoine Jacoutot <ajacoutot@bsdfrog.org>
Date:
Fri, 19 Apr 2024 17:58:18 -0700

Download raw body.

Thread
James Cook <falsifian@falsifian.org> writes:

> Here are some results of debugging with lldb.
>
>
> With cabal-bundler and pandoc, it seems to be the xgetbv instruction
> itself:
>
>
> $ lldb /usr/local/bin/cabal-bundler
> (lldb) target create "/usr/local/bin/cabal-bundler"
> Current executable set to '/usr/local/bin/cabal-bundler' (x86_64).
> (lldb) run
> Process 90738 launched: '/usr/local/bin/cabal-bundler' (x86_64)
> Process 90738 stopped
> * thread #1, stop reason = signal SIGILL
>     frame #0: 0x00000000004c12ba cabal-bundler`___lldb_unnamed_symbol522 + 90
> cabal-bundler`___lldb_unnamed_symbol522:
> ->  0x4c12ba <+90>: xgetbv

Unless I'm missing something, xgetvb is not available in your CPU.

cpu0: AMD Phenom(tm) II X3 710 Processor, 2611.95 MHz, 10-04-02, patch 010000db
cpu0: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,MWAIT,CX16,POPCNT,NXE,MMXX,FFXSR,PAGE1GB,RDTSCP,LONG,3DNOW2,3DNOW,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,SKINIT,HWPSTATE,ITSC

XGETBV1 is missing in the above and my cursory reading of
https://en.wikipedia.org/wiki/X86-64#AMD64 supports this conclusion.

Somebody will have to adapt the checking code to be conditional on this
instruction presence if it's deemed important enough to support this CPU.

Thanks
Greg