** Description changed:

+ [Info]
+ Ghostty, a terminal emulator written in Zig, was first packaged for resolute. 
By default, the Zig compiler builds an application binary using all the 
available native CPU features. This means Ghostty binaries built on Launchpad 
builders include AVX and AVX2 instructions, making them incompatible with older 
x86_64 variants that do not include AVX. This manifests as a SIGILL crash on 
startup on those variants. This is a serious impediment to Ubuntu users wanting 
to install and use Ghostty on non-AVX variants.
+ 
+ A simple solution to this problem is the use of the Zig compiler option
+ “-Dcpu=baseline”, which instructs Zig to compile for the architecture
+ baseline.
+ 
+ 
+ [Test plan]
+ A user running Ubuntu 26.04 on an older, non-AVX variant, should simply be 
able to install the Ghostty package ( version 1.3.0~us1-0ubuntu1) and reproduce 
the issue by simply clicking on the desktop launcher, or by invoking it from 
resolute’s default ptyxis terminal:
+ 
+ $ sudo apt update && sudo apt install ghostty
+ …
+ …
+ $ ghostty
+ Illegal instruction (core dumped) ghostty
+ 
+ One may also use qemu-x86_64 with a non-AVX cpu emulation to reproduce
+ the crash. For example:
+ 
+ # Nehalem is a cpu model without AVX support
+ $ qemu-x86_64 -cpu Nehalem /usr/bin/ghostty +version
+ qemu: uncaught target signal 4 (Illegal instruction) - core dumped
+ 
+ # Haswell has AVX, but we can disable it to reproduce
+ $ qemu-x86_64 -cpu Haswell,-avx,-avx2 /usr/bin/ghostty +version
+ qemu: uncaught target signal 4 (Illegal instruction) - core dumped
+ Illegal instruction        (core dumped) qemu-x86_64 -cpu 
+ 
+ 
+ [Where problems could occur]
+ 
+ Functional regression possibility #1
+ —
+ Zig is a new programming language; the compiler hasn’t stabilized into a 
version 1.X yet. The number of real-world Zig applications/deployments is quite 
less, and these applications are likely to be built for, and deployed on, 
modern CPU models. As a result, compiling for the baseline will exercise 
relatively colder/infrequent code paths in the Zig compiler that are not  
tested enough on modern hardware. In the best case, this may lead to compiler 
failures. In the worst case, silent bugs may slip into the binary.
+ 
+ Functional regression possibility #2
+ —
+ Zig is LLVM-based, and LLVM is a battle-tested compiler framework. However, 
the Zig community has a strategy to eventually move away from LLVM altogether. 
Such a move would further amplify the chances of possibility #1.
+ 
+ Functional regression possibility #3
+ —
+ Zig code can actually test for CPU features and take a certain path if they 
are available vis-a-vis another path if they are not. As of version 1.3, 
Ghostty has no such checks for AVX,AVX2. However, if any such checks are 
introduced in the future, the Ubuntu binaries are likely to exercise the rare, 
cold paths; the upstream binaries are more likely to exercise and test the hot 
paths. This increases the possibility of finding regressions that upstream 
binaries cannot reproduce.
+ 
+ Performance regression possibility #1
+ —
+ Using SSE instructions on AVX-enabled architectures amounts to 
underutilization of the available CPU features. Unique, performance-intensive 
workloads on the terminal emulator may see a performance drop due to the 
compilation for baseline. 
+ 
+ Functional/performance regression possibility #2
+ —
+ The effect of -Dcpu=baseline for amd64v3 and arm64 is not fully understood, 
and it can have unforeseen consequences.
+ 
+ [Other info]
+ 
+ Enforcing baseline compilation is something a future “debhelper for Zig”
+ must do. As of today there is no dh_zig in the archive.
+ 
+ The baseline for amd64 is different from the baseline for amd64v3. The
+ latter includes AVX, the former does not. The amd64v3 builds with
+ -Dcpu=baseline still contain AVX instructions. Consequently we had to
+ disable the dep8 test added for this fix on amd64v3 (LP: #2155110).
+ 
+ ----
+ 
  Ghostty on resolute crashes on start. Possibly zig uses all instruction
  sets available on the build machine by default? My machine here is a few
  years old and does not support some modern instructions (e.g. avx).
  
  Before the upgrade to resolute, I've been using a ghostty, which I had
  built from source on this exact machine. Worked fine.
  
  ~$ ghostty
  Illegal instruction        (core dumped) ghostty
  
  $ sudo dmesg | tail -1
  [70260.702796] traps: ghostty[20368] trap invalid opcode ip:5dc88ab52daa 
sp:7ffccb4a7590 error:0 in ghostty[1387daa,5dc88a9f2000+854000]
  
  $ apt policy ghostty
  ghostty:
-   Installed: 1.3.0~us1-0ubuntu1
-   Candidate: 1.3.0~us1-0ubuntu1
-   Version table:
-  *** 1.3.0~us1-0ubuntu1 500
-         500 http://de.archive.ubuntu.com/ubuntu resolute/universe amd64 
Packages
-         100 /var/lib/dpkg/status
+   Installed: 1.3.0~us1-0ubuntu1
+   Candidate: 1.3.0~us1-0ubuntu1
+   Version table:
+  *** 1.3.0~us1-0ubuntu1 500
+         500 http://de.archive.ubuntu.com/ubuntu resolute/universe amd64 
Packages
+         100 /var/lib/dpkg/status
  
- $ cat /proc/cpuinfo 
+ $ cat /proc/cpuinfo
  processor       : 0
  vendor_id       : GenuineIntel
  cpu family      : 6
  model           : 60
  model name      : Intel(R) Pentium(R) CPU G3220 @ 3.00GHz
  stepping        : 3
  microcode       : 0x28
  cpu MHz         : 2095.320
  cache size      : 3072 KB
  physical id     : 0
  siblings        : 2
  core id         : 0
  cpu cores       : 2
  apicid          : 0
  initial apicid  : 0
  fpu             : yes
  fpu_exception   : yes
  cpuid level     : 13
  wp              : yes
  flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca 
cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx 
pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology 
nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 
ssse3 sdbg cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_deadline_timer 
xsave rdrand lahf_lm abm cpuid_fault epb pti ssbd ibrs ibpb stibp tpr_shadow 
flexpriority ept vpid ept_ad fsgsbase tsc_adjust erms invpcid xsaveopt dtherm 
arat pln pts vnmi md_clear flush_l1d
  vmx flags       : vnmi preemption_timer invvpid ept_x_only ept_ad ept_1gb 
flexpriority tsc_offset vtpr mtf vapic ept vpid unrestricted_guest ple
  bugs            : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf 
mds swapgs itlb_multihit srbds spectre_v2_user vmscape
  bogomips        : 5986.67
  clflush size    : 64
  cache_alignment : 64
  address sizes   : 39 bits physical, 48 bits virtual
  power management:
  
  ProblemType: Bug
  DistroRelease: Ubuntu 26.04
  Package: ghostty 1.3.0~us1-0ubuntu1
  ProcVersionSignature: Ubuntu 7.0.0-14.14-generic 7.0.0
  Uname: Linux 7.0.0-14-generic x86_64
  NonfreeKernelModules: zfs
  ApportVersion: 2.34.0-0ubuntu2
  Architecture: amd64
  CasperMD5CheckResult: unknown
  CurrentDesktop: ubuntu:GNOME
  Date: Sun Apr 19 11:45:01 2026
  InstallationDate: Installed on 2019-05-24 (2522 days ago)
  InstallationMedia: Ubuntu 19.04 "Disco Dingo" - Release amd64 (20190416)
  SourcePackage: ghostty
  UpgradeStatus: Upgraded to resolute on 2026-04-18 (1 days ago)

** Summary changed:

- ghostty does not start: Illegal instruction
+ [sru] ghostty does not start: Illegal instruction

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2148769

Title:
  [sru] ghostty does not start: Illegal instruction

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ghostty/+bug/2148769/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to