Skip to content

clone_leader_exits_early-linux segfaults #3544

@stevenengler

Description

@stevenengler

I noticed this in a debian sid container. Since debian sid is experimental, it's possible this is a bug in one of its packages rather than shadow. But there might also be a shadow issue here.

Edit: This segfaults on newer stable distros too like Fedora 42.

I haven't looked into this issue at all, but posting some output below.

$ ./setup test clone_leader_exits_early-linux
2025-03-30 22:02:21,409 [INFO] calling ['ctest', '-j12', '--timeout', '20', '-R', 'clone_leader_exits_early-linux']
Test project /tmp/shadow/build
    Start 13: clone_leader_exits_early-linux
1/1 Test #13: clone_leader_exits_early-linux ...***Exception: SegFault  0.10 sec

0% tests passed, 1 tests failed out of 1

Label Time Summary:
linux    =   0.10 sec*proc (1 test)

Total Test time (real) =   0.11 sec

The following tests FAILED:
	13 - clone_leader_exits_early-linux (SEGFAULT)         linux
Errors while running CTest
Output from these tests are in: /tmp/shadow/build/Testing/Temporary/LastTest.log
Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely.
2025-03-30 22:02:21,538 [INFO] ctest returned 8
$ ./build/src/test/clone/test_clone_leader_exits_early
TAP version 14
# random seed: R02Sc7ffc3f1c71ac349b5ced31b4e17c410
1..1
# Start of clone tests
ok 1 /clone/clone_child_exits_after_leader
# End of clone tests
Segmentation fault (core dumped)
(gdb) run
Starting program: /tmp/shadow/build/src/test/clone/test_clone_leader_exits_early 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
TAP version 14
# random seed: R02Sa0a5a062b0100f100332559512760f42
1..1
# Start of clone tests
[New Thread 0x5555555580d0 (LWP 31199)]

Thread 2 "test_clone_lead" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x5555555580d0 (LWP 31199)]
0x00007ffff7cf962d in __internal_syscall_cancel (a1=a1@entry=0, a2=a2@entry=0, a3=a3@entry=140737348628400, a4=a4@entry=0, a5=a5@entry=0, a6=a6@entry=0, nr=230) at ./nptl/cancellation.c:37
warning: 37	./nptl/cancellation.c: No such file or directory
(gdb) thread apply all bt

Thread 2 (Thread 0x5555555580d0 (LWP 31199) "test_clone_lead"):
#0  0x00007ffff7cf962d in __internal_syscall_cancel (a1=a1@entry=0, a2=a2@entry=0, a3=a3@entry=140737348628400, a4=a4@entry=0, a5=a5@entry=0, a6=a6@entry=0, nr=230) at ./nptl/cancellation.c:37
#1  0x00007ffff7d45f7a in __GI___clock_nanosleep (clock_id=<optimized out>, clock_id@entry=0, flags=flags@entry=0, req=req@entry=0x7ffff7abefb0, rem=rem@entry=0x0) at ../sysdeps/unix/sysv/linux/clock_nanosleep.c:48
#2  0x00007ffff7d51393 in __GI___nanosleep (req=req@entry=0x7ffff7abefb0, rem=rem@entry=0x0) at ../sysdeps/unix/sysv/linux/nanosleep.c:25
#3  0x00007ffff7d7a373 in usleep (useconds=<optimized out>) at ../sysdeps/posix/usleep.c:31
#4  0x00005555555553d7 in _clone_child_exits_after_leader_waitee_thread (args=0x0) at /tmp/shadow/src/test/clone/test_clone_leader_exits_early.c:86
#5  0x00007ffff7d7a5f0 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:100

Thread 1 (Thread 0x7ffff7ac0480 (LWP 31196) "test_clone_lead"):
#0  clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:83
#1  0x000055555555553e in _clone_child_exits_after_leader () at /tmp/shadow/src/test/clone/test_clone_leader_exits_early.c:125
#2  0x00007ffff7eea919 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffff7eea893 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007ffff7eeae22 in g_test_run_suite () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007ffff7eeaea8 in g_test_run () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#6  0x0000555555555610 in main (argc=1, argv=0x7fffffffeca8) at /tmp/shadow/src/test/clone/test_clone_leader_exits_early.c:143

Shadow: 24343d0
Linux: 6.13.7

Metadata

Metadata

Assignees

Labels

Type: BugError or flaw producing unexpected results

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions