On Tue, Mar 11, 2025 at 09:12:15AM +0100, Bill Allombert wrote:
> On Mon, Mar 10, 2025 at 11:49:39PM +0100, Aurelien Jarno wrote:
> > I also noticed it failed the same way on arm64.
> 
> Thanks for confirming!
> 
> > > > Please tell me if you would like me to do more experiments.
> > > 
> > > If you have time, yes, that's very useful. I'll also try to have a
> > > closer look at your testcase, but it already seems relatively small.
> > 
> > I am not sure I understand everything yet, but it seems that building
> > pari with -fexceptions is a good workaround for the issue.
> 
> Alas, this would break the ABI of the libpari,
> and I still get failure with -fexceptions: instead of crashes, the program
> terminate without printing Done:
> 
> %for i in `seq 1 100`; do (set -e; echo -n "$i " && sid ./pthread1) || break; 
> done
> 1 Done!
> 2 3 4 5 6 Done!
> 7 8 Done!
> 9 10 11 12 13 Done!
> 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 Done!
> 29 30 31 Done!
> 32 33 34 Done!
> 35 36 37 38 39 40 Done!
> 41 42 43 44 45 46 Done!
> 47 48 49 50 51 52 53 Done!
> 54 55 56 57 58 59 60 61 62 63 64 65 ^C%
> 
> I join a simplified test-case.

which is compiled with

gcc  pthread3.c -Wall -O0 -g -pthread -o pthread3 -fexceptions

by doing 'br _exit' under gdb I get

Thread 5016 "pthread3" hit Breakpoint 1.1, __GI__exit (status=status@entry=0) 
at ../sysdeps/unix/sysv/linux/_exit.c:27
warning: 27     ../sysdeps/unix/sysv/linux/_exit.c: Aucun fichier ou dossier de 
ce nom
(gdb) bt
#0  __GI__exit (status=status@entry=0) at ../sysdeps/unix/sysv/linux/_exit.c:27
#1  0x00007ffff7dcb1d6 in __run_exit_handlers (status=status@entry=0, 
listp=0x7ffff7f70680 <__exit_funcs>,
    run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) 
at ./stdlib/exit.c:141
#2  0x00007ffff7dcb31a in __GI_exit (status=status@entry=0) at 
./stdlib/exit.c:148
#3  0x00007ffff7e1bba1 in start_thread (arg=<optimized out>) at 
./nptl/pthread_create.c:497
#4  0x00007ffff7e997b8 in __GI___clone3 () at 
../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
(gdb) c
Continuing.
[Thread 0x7ffff2d7b6c0 (LWP 3665238) exited]
[Inferior 1 (process 3660113) exited normally]

But actually the line printf("Done!") was not reached.

Cheers,
Bill

Reply via email to