Bug#1117592: libgc1 fails with pthread_atfork when trying to start on hurd

Peter Van Eynde <[email protected]>
Newsgroups gmane.linux.debian.ports.hurd
Message-ID <175991288230.7372.13464263877944770508.reportbug__22283.6464572296$1759913012$gmane$org@exodar.debian.net>
Package: libgc1
Version: 1:8.2.8-1
Severity: normal
X-Debbugs-Cc: [email protected], [email protected]
User: [email protected]
Usertags: hurd-amd64 hurd-i386

Hello,

While investigating a FTBFS for ecl on the hurd platforms I noticed that the problem seems to be in libgc1. 

The build fails (see [1]) with a terse:

make[3]: Leaving directory '/build/reproducible-path/ecl-24.5.10.20250914.git294da20+dfsg/build/c'
Building ecl_min...
pthread_atfork failed
/bin/bash: line 5:  6131 Aborted                    ECLDIR=`pwd`/ ./ecl_min compile

When I run the ecl_min binary (created during the ecl build process) in 
gdb I at first get a SIGSEGV, but when I allow this signal to pass through I get the pthread_atfork failure message with an abort traceback: 

(gdb) run compile
Starting program: /home/pvaneynd/ecl-24.5.10.20250914.git294da20+dfsg/build/ecl_min compile

Thread 4 received signal SIGSEGV, Segmentation fault.
0x012b8b0d in GC_find_limit_with_bound (p=0x1212c88 "x-!\001\374\372\t", up=up@entry=1, bound=bound@entry=0xffffffff <error: Cannot access memory at address 0xffffffff>)
    at ../extra/../os_dep.c:1029
warning: 1029   ../extra/../os_dep.c: No such file or directory
(gdb) handle  SIGSEGV nostop
Signal        Stop      Print   Pass to program Description
SIGSEGV       No        Yes     Yes             Segmentation fault
(gdb) run compile
Starting program: /home/pvaneynd/ecl-24.5.10.20250914.git294da20+dfsg/build/ecl_min compile

Thread 4 received signal SIGSEGV, Segmentation fault.
pthread_atfork failed

Thread 4 received signal SIGABRT, Aborted.
0x014284ac in ?? () from /lib/i386-gnu/libc.so.0.3
(gdb) bt
#0  0x014284ac in ?? () from /lib/i386-gnu/libc.so.0.3
#1  0x01428c60 in mach_msg () from /lib/i386-gnu/libc.so.0.3
#2  0x016c3136 in msg_sig_post () from /lib/i386-gnu/libhurduser.so.0.3
#3  0x01438aa9 in _hurd_raise_signal () from /lib/i386-gnu/libc.so.0.3
#4  0x0168dc84 in pthread_kill () from /lib/i386-gnu/libpthread.so.0.3
#5  0x014765ed in raise () from /lib/i386-gnu/libc.so.0.3
#6  0x01427953 in abort () from /lib/i386-gnu/libc.so.0.3
#7  0x012c6981 in GC_thr_init () at ../extra/../pthread_support.c:1353
#8  0x012c5431 in GC_init () at ../extra/../misc.c:1361
#9  GC_init () at ../extra/../misc.c:927
#10 0x0009fafc in init_alloc (pass=0) at ./src/c/alloc_2.d:774
#11 0x00036573 in cl_boot (argc=2, argv=0x1212e04) at ./src/c/main.d:507
#12 0x00034cd9 in main (argc=2, args=0x1212e04) at ./src/c/cinit.d:175
(gdb)

GC_thr_init [2] is straight going to abort because CAN_HANDLE_FORK is defined, GC_handle_fork is set but CAN_CALL_ATFORK is not true from the disassembly. So this seems to be a 
general problem:

(gdb) break ../extra/../pthread_support.c:1344
Breakpoint 10 at 0x12c64c7: file ../extra/../pthread_support.c, line 1344.
(gdb) run compile
Starting program: /home/pvaneynd/ecl-24.5.10.20250914.git294da20+dfsg/build/ecl_min compile

Thread 4 received signal SIGSEGV, Segmentation fault.

Thread 4 hit Breakpoint 10, GC_thr_init () at ../extra/../pthread_support.c:1352
warning: 1352   ../extra/../pthread_support.c: No such file or directory
(gdb) print GC_handle_fork
$1 = 1
(gdb) disassemble  GC_thr_init
Dump of assembler code for function GC_thr_init:
   0x012c6490 <+0>:       push   %ebp
   0x012c6491 <+1>:       mov    %esp,%ebp
   0x012c6493 <+3>:       push   %edi
   0x012c6494 <+4>:       push   %esi
   0x012c6495 <+5>:       push   %ebx
   0x012c6496 <+6>:       call   0x12b4fb0 <__x86.get_pc_thunk.bx>
   0x012c649b <+11>:      add    $0x14b59,%ebx
   0x012c64a1 <+17>:      sub    $0x2c,%esp
   0x012c64a4 <+20>:      mov    %gs:0x14,%eax
   0x012c64aa <+26>:      mov    %eax,-0x1c(%ebp)
   0x012c64ad <+29>:      xor    %eax,%eax
   0x012c64af <+31>:      mov    0x271b0(%ebx),%eax
   0x012c64b5 <+37>:      test   %eax,%eax
   0x012c64b7 <+39>:      jne    0x12c674e <GC_thr_init+702>
   0x012c64bd <+45>:      movl   $0x1,0x271b0(%ebx)
=> 0x012c64c7 <+55>:      mov    0x278b8(%ebx),%eax
   0x012c64cd <+61>:      add    $0x1,%eax
   0x012c64d0 <+64>:      cmp    $0x1,%eax
   0x012c64d3 <+67>:      ja     0x12c696a <GC_thr_init+1242>

-> straight to abort.

Best regards, Peter

1
https://buildd.debian.org/status/fetch.php?pkg=ecl&arch=hurd-amd64&ver=24.5.10.20250914.git294da20%2Bdfsg-2&stamp=1759858415&raw=0

2
https://salsa.debian.org/debian/libgc/-/blob/master/pthread_support.c?ref_type=heads#L1335
-- System Information:
Debian Release: forky/sid
  APT prefers unreleased
  APT policy: (500, 'unreleased'), (500, 'unstable')
Architecture: hurd-i386 (i686-AT386)

Kernel: GNU-Mach 1.8+git20250731-up-486/Hurd-0.9
Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: unable to detect

Versions of packages libgc1 depends on:
ii  libc0.3     2.41-12+b1
ii  libstdc++6  15.2.0-4

libgc1 recommends no packages.

libgc1 suggests no packages.

-- no debconf information
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.