Public bug reported:

Title: jtdx 2.2.159+improved-3build1 segfaults at startup: LTO build
leaves copy relocations of Qt symbols (QCoreApplication::self)

Package: jtdx 2.2.159+improved-3build1 (Ubuntu 26.04 "resolute", amd64)

Symptom

jtdx segfaults every time it starts, during QApplication construction
and before any window appears. It happens under both Wayland and
XWayland (QT_QPA_PLATFORM=xcb). Other Qt5 applications on the same
system run normally, including wsjtx.

Backtrace (xcb):

The faulting instruction is mov 0x8(%rdi),%r12 with rdi=0. The sender of
screenAdded, qGuiApp (that is, QCoreApplication::self), is null as seen
from libQt5Gui, even though QtCore has already set it. Under Wayland the
same crash shows up in QWaylandDisplay::initialize.

Cause

readelf -rW /usr/bin/jtdx | grep R_X86_64_COPY shows copy relocations
for about 35 Qt data symbols, including _ZN16QCoreApplication4selfE,
QArrayData::shared_null and many staticMetaObjects. wsjtx on the same
system has no Qt copy relocations.

The jtdx compile flags do include -fPIC; Qt5's CMake usage requirements
add it to the Qt-using targets. But the package is built with LTO
(-flto=auto), so the code is generated at link time, as PIE (the
toolchain default). That brings back direct, PC-relative access to Qt's
global data, which the linker satisfies with copy relocations. The
executable then has its own copy of QCoreApplication::self, separate
from the one QtCore sets, so libQt5Gui sees null and segfaults.

Linking with -Wl,-z,nocopyreloc confirms this. The copy relocations
become text relocations, and at load time ld.so reports hundreds of
Symbol '...' causes overflow in R_X86_64_PC32 relocation for the same Qt
symbols.

Fix (tested)

Turning off LTO in debian/rules produces a working binary, with no Qt copy 
relocations and no TEXTREL:
---- debian/rules ----
#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = optimize=-lto
ifeq ($(DEB_TARGET_ARCH),armel)
    export DEB_BUILD_MAINT_OPTIONS += hardening=-stackclash
endif

%:
        dh $@

override_dh_auto_configure:
        # put documentation in /usr/share/doc/jtdx instead of .../JTDX
        # don't install HTML documentation, it's the unmodified wsjtx document 
(in 2.2.159)
        dh_auto_configure -- \
                -DCMAKE_INSTALL_DOCDIR=share/doc/jtdx \
                -DWSJT_GENERATE_DOCS=NO

ProblemType: Bug
DistroRelease: Ubuntu 26.04
Package: jtdx 2.2.159+improved-3build1
ProcVersionSignature: Ubuntu 7.0.0-38.38-generic 7.0.14
Uname: Linux 7.0.0-38-generic x86_64
ApportVersion: 2.34.1-0ubuntu0.1
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
Date: Sun Oct  4 16:56:56 2026
InstallationDate: Installed on 2022-12-16 (1388 days ago)
InstallationMedia: Ubuntu 22.04.1 LTS "Jammy Jellyfish" - Release amd64 
(20220809.1)
SourcePackage: jtdx
UpgradeStatus: Upgraded to resolute on 2026-10-04 (1 days ago)

** Affects: jtdx (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug resolute wayland-session

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

Title:
  jtdx segfaults at startup due to LTO build

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


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

Reply via email to