Re: bison segv under Cygwin 64 at fatal-signal.c:318

Brian Inglis <[email protected]> Mon, 13 Sep 2021 17:19:25 -0600
Newsgroups gmane.comp.parsers.bison.bugs
Organization Systematic Software
Message-ID <[email protected]>
On 2021-09-13 14:54, Brian Inglis wrote:
> On 2021-09-13 14:20, Akim Demaille wrote:
>> Thanks for the very detailed bug report!  Before trying to go further, 
>> could you please try this tarball, which includes an updated gnulib?
>>
>> https://www.lrde.epita.fr/~akim/private/bison/bison-3.8.1.27-dd6e.tar.gz
>> https://www.lrde.epita.fr/~akim/private/bison/bison-3.8.1.27-dd6e.tar.lz
>> https://www.lrde.epita.fr/~akim/private/bison/bison-3.8.1.27-dd6e.tar.xz
> 
> Thanks for the quick response Akim, will try that out ASAP!
> 
> The only information I forgot to include was that I copied your patch to 
> revert the autoconf upgrade from 2.68 to 2.71 as Cygwin currently only 
> has up to 2.69.
> 
>> If it does not work any better, we'll probably have to dive into gnulib.
> 
> Spent part of yesterday there!
> 
> Will later be trying to rebuild fatal-signal.c in the released version 
> with -E to see what the expansions of gl_lock_lock, pthread_in_use, and 
> the value of glthread_in use look like.

Sorry to report still consistent failure mode, symptom, and location.
Please see attached.
Modified to run from below the non-standard SRC_DIR names, continue, 
step to get failure, bt, then quit.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in binary units and prefixes, physical quantities in SI.]
bison-segv-cygwin-64-gdb.sh (text/plain, 161 B)
cd ${@:-bison-3.8.1-1}.x86_64/src/${@:-bison-3.8.1-1}/
gdb -d src -d lib -d lib/glthread -r -ex 'source ../../../bison-segv-cygwin-64.gdb' ../../build/src/bison
bison-segv-cygwin-64.gdb (text/plain, 658 B)
set logging file ../../../bison-segv-cygwin-64-gdb.log
set logging overwrite on
set logging on
break main
break lib/main.c:30
break output_skeleton
break src/output.c:903
break src/output.c:785
break create_pipe_bidi
break create_pipe
break lib/spawn-pipe.c:475
break block_fatal_signals
break lib/fatal-signal.c:316
break lib/fatal-signal.c:318
break lib/fatal-signal.c:320
run -o ../../build/examples/c/bistromathic/y.tab.c --defines -Werror -Wall,dangling-alias --report=all --no-lines examples/c/bistromathic/parse.y
break pthread_mutex_lock
disable 13
continue
continue
continue
continue
continue
continue
continue
continue
continue
enable 13
step
bt
q
bison-segv-cygwin-64-gdb.log (text/plain, 4.2 KB)
Breakpoint 1 at 0x100464b60: file /usr/src/debug/bison-3.8.1.27-dd6e/src/main.c, line 65.
Breakpoint 2 at 0x100464b78: file /usr/src/debug/bison-3.8.1.27-dd6e/src/main.c, line 67.
Breakpoint 3 at 0x10041d140: file /usr/src/debug/bison-3.8.1.27-dd6e/src/output.c, line 722.
Breakpoint 4 at 0x100422168: file /usr/src/debug/bison-3.8.1.27-dd6e/src/output.c, line 903.
Breakpoint 5 at 0x10041d2a7: file /usr/src/debug/bison-3.8.1.27-dd6e/src/output.c, line 785.
Breakpoint 6 at 0x100457960: file /usr/src/debug/bison-3.8.1.27-dd6e/lib/spawn-pipe.c, line 617.
Breakpoint 7 at 0x100457100: file /usr/src/debug/bison-3.8.1.27-dd6e/lib/spawn-pipe.c, line 147.
Breakpoint 8 at 0x1004574ce: file /usr/src/debug/bison-3.8.1.27-dd6e/lib/spawn-pipe.c, line 475.
Breakpoint 9 at 0x10044ea50: file /usr/src/debug/bison-3.8.1.27-dd6e/lib/fatal-signal.c, line 315.
Breakpoint 10 at 0x10044ea54: file /usr/src/debug/bison-3.8.1.27-dd6e/lib/fatal-signal.c, line 316.
Breakpoint 11 at 0x10044ea54: file /usr/src/debug/bison-3.8.1.27-dd6e/lib/fatal-signal.c, line 318.
Breakpoint 12 at 0x10044ea74: file /usr/src/debug/bison-3.8.1.27-dd6e/lib/fatal-signal.c, line 320.
[New Thread 7864.0x2680]
[New Thread 7864.0x7d0]
[New Thread 7864.0x215c]
[New Thread 7864.0xf5c]

Thread 1 "bison" hit Breakpoint 1, main (argc=9, argv=0xffffcb70) at /usr/src/debug/bison-3.8.1.27-dd6e/src/main.c:65
Breakpoint 13 at 0x1801670f0: pthread_mutex_lock. (2 locations)

Thread 1 "bison" hit Breakpoint 2, main (argc=9, argv=0xffffcb70) at /usr/src/debug/bison-3.8.1.27-dd6e/src/main.c:67

Thread 1 "bison" hit Breakpoint 4, output () at /usr/src/debug/bison-3.8.1.27-dd6e/src/output.c:903
903	  output_skeleton ();

Thread 1 "bison" hit Breakpoint 3, output_skeleton () at /usr/src/debug/bison-3.8.1.27-dd6e/src/output.c:722
722	{

Thread 1 "bison" hit Breakpoint 5, output_skeleton () at /usr/src/debug/bison-3.8.1.27-dd6e/src/output.c:785
785	    pid = create_pipe_bidi ("m4", m4, argv,

Thread 1 "bison" hit Breakpoint 6, create_pipe_bidi (progname=progname@entry=0x10046c518 <__func__.2+600> "m4", 
    prog_path=prog_path@entry=0x1004686b3 <argmatch_warning_docs+2291> "/usr/bin/m4", 
    prog_argv=prog_argv@entry=0xffffc990, directory=directory@entry=0x0, null_stderr=null_stderr@entry=false, 
    slave_process=slave_process@entry=true, exit_on_error=exit_on_error@entry=true, fd=fd@entry=0xffffc988)
    at /usr/src/debug/bison-3.8.1.27-dd6e/lib/spawn-pipe.c:617
617	{

Thread 1 "bison" hit Breakpoint 7, create_pipe (progname=progname@entry=0x10046c518 <__func__.2+600> "m4", 
    prog_path=prog_path@entry=0x1004686b3 <argmatch_warning_docs+2291> "/usr/bin/m4", 
    prog_argv=prog_argv@entry=0xffffc990, directory=directory@entry=0x0, pipe_stdin=pipe_stdin@entry=true, 
    pipe_stdout=pipe_stdout@entry=true, prog_stdin=prog_stdin@entry=0x0, prog_stdout=prog_stdout@entry=0x0, 
    null_stderr=null_stderr@entry=false, slave_process=slave_process@entry=true, 
    exit_on_error=exit_on_error@entry=true, fd=fd@entry=0xffffc988)
    at /usr/src/debug/bison-3.8.1.27-dd6e/lib/spawn-pipe.c:147
147	{

Thread 1 "bison" hit Breakpoint 8, create_pipe (progname=progname@entry=0x10046c518 <__func__.2+600> "m4", 
    prog_path=prog_path@entry=0x1004686b3 <argmatch_warning_docs+2291> "/usr/bin/m4", 
    prog_argv=prog_argv@entry=0xffffc990, directory=directory@entry=0x0, pipe_stdin=pipe_stdin@entry=true, 
    pipe_stdout=pipe_stdout@entry=true, prog_stdin=prog_stdin@entry=0x0, prog_stdout=prog_stdout@entry=0x0, 
    null_stderr=null_stderr@entry=false, slave_process=slave_process@entry=true, 
    exit_on_error=exit_on_error@entry=true, fd=fd@entry=0xffffc988)
    at /usr/src/debug/bison-3.8.1.27-dd6e/lib/spawn-pipe.c:475
475	      block_fatal_signals ();

Thread 1 "bison" hit Breakpoint 9, block_fatal_signals () at /usr/src/debug/bison-3.8.1.27-dd6e/lib/fatal-signal.c:315
315	{

Thread 1 "bison" hit Breakpoint 10, block_fatal_signals () at /usr/src/debug/bison-3.8.1.27-dd6e/lib/fatal-signal.c:318
318	  if (mt) gl_lock_lock (fatal_signals_block_lock);
0x0000000100000000 in ?? ()
#0  0x0000000100000000 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
A debugging session is active.

	Inferior 1 [process 7864] will be killed.

Quit anyway? (y or n) [answered Y; input not from terminal]