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

Brian Inglis Brian.Inglis@SystematicSw.ab.ca
Sun Sep 12 18:20:01 GMT 2021


Anyone seen these kinds of issues before? Also submitted to bug-bison.

Trying to package bison 3.8/.1 for Cygwin - previous releases to 3.7.6 
built and checked okay - bison 3.8.1 checked okay on 32 bit - all tests 
segv on 64 bit!

Reran build and check with bison 3.8 and 3.8.1 using gcc 10.2.0 and 
11.2.0 under Cygwin 64 with no change as all tests segv @ 
0x0000000100000000.

Build runs with autoreconf et al as per normal on 32 and 64 bit; adding 
debug output allowed me see test commands to narrow down cause.

Ran using gdb against tests/c/bistromathic/parse.y (see attached for gdb 
command, script, and full log) getting the output below.

It appears to be possible that `gl_lock_lock` expansion to 
`pthread_in_use() ? pthread_mutex_lock(...)` -> `glthread_in_use() ? 
...` has avoided defining the latter in the build, or some underlying 
dynamic library function may not be loaded?

This could result from Cygwin being neither fish nor fowl: none of BSD, 
Sun, Windows, or Linux, although I notice some __CYGWIN__ conditionals.

...

Thread 1 "bison" hit Breakpoint 10, block_fatal_signals () at 
/usr/src/debug/bison-3.8.1-1/lib/fatal-signal.c:318
318       if (mt) gl_lock_lock (fatal_signals_block_lock);
Continuing.

Thread 1 "bison" received signal SIGSEGV, Segmentation fault.
0x0000000100000000 in ?? ()
#0  0x0000000100000000 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

-- 
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.]
-------------- next part --------------
set logging file bison-segv-cygwin-64-gdb.log
set logging overwrite on
set logging on
break main
break /mnt/c/Users/bwi/src/cygwin/bison/bison-3.8.1-1.x86_64/src/bison-3.8.1/lib/main.c:30
break output_skeleton
break /mnt/c/Users/bwi/src/cygwin/bison/bison-3.8.1-1.x86_64/src/bison-3.8.1/src/output.c:903
break /mnt/c/Users/bwi/src/cygwin/bison/bison-3.8.1-1.x86_64/src/bison-3.8.1/src/output.c:785
break create_pipe_bidi
break create_pipe
break /mnt/c/Users/bwi/src/cygwin/bison/bison-3.8.1-1.x86_64/src/bison-3.8.1/lib/spawn-pipe.c:475
break block_fatal_signals
break /mnt/c/Users/bwi/src/cygwin/bison/bison-3.8.1-1.x86_64/src/bison-3.8.1/lib/fatal-signal.c:316
break /mnt/c/Users/bwi/src/cygwin/bison/bison-3.8.1-1.x86_64/src/bison-3.8.1/lib/fatal-signal.c:318
break /mnt/c/Users/bwi/src/cygwin/bison/bison-3.8.1-1.x86_64/src/bison-3.8.1/lib/fatal-signal.c:320
run -o y.tab.c --defines -Werror -Wall,dangling-alias --report=all --no-lines bison-3.8.1-1.x86_64/src/bison-3.8.1/examples/c/bistromathic/parse.y
break pthread_mutex_lock
disable 13
-------------- next part --------------
Breakpoint 1 at 0x100464b60: file /usr/src/debug/bison-3.8.1-1/src/main.c, line 65.
Breakpoint 2 at 0x100464b78: file /usr/src/debug/bison-3.8.1-1/src/main.c, line 67.
Breakpoint 3 at 0x10041d140: file /usr/src/debug/bison-3.8.1-1/src/output.c, line 722.
Breakpoint 4 at 0x100422168: file /usr/src/debug/bison-3.8.1-1/src/output.c, line 903.
Breakpoint 5 at 0x10041d2a7: file /usr/src/debug/bison-3.8.1-1/src/output.c, line 785.
Breakpoint 6 at 0x100457960: file /usr/src/debug/bison-3.8.1-1/lib/spawn-pipe.c, line 617.
Breakpoint 7 at 0x100457100: file /usr/src/debug/bison-3.8.1-1/lib/spawn-pipe.c, line 147.
Breakpoint 8 at 0x1004574ce: file /usr/src/debug/bison-3.8.1-1/lib/spawn-pipe.c, line 475.
Breakpoint 9 at 0x10044ea50: file /usr/src/debug/bison-3.8.1-1/lib/fatal-signal.c, line 315.
Breakpoint 10 at 0x10044ea54: file /usr/src/debug/bison-3.8.1-1/lib/fatal-signal.c, line 316.
Breakpoint 11 at 0x10044ea54: file /usr/src/debug/bison-3.8.1-1/lib/fatal-signal.c, line 318.
Breakpoint 12 at 0x10044ea74: file /usr/src/debug/bison-3.8.1-1/lib/fatal-signal.c, line 320.
[New Thread 6868.0x1884]
[New Thread 6868.0x1bc8]
[New Thread 6868.0x22f8]
[New Thread 6868.0x2a38]

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

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

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

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

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

Thread 1 "bison" hit Breakpoint 6, create_pipe_bidi (progname=progname@entry=0x10046c418 <__func__.2+600> "m4", 
    prog_path=prog_path@entry=0x100468643 <argmatch_warning_docs+2275> "/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-1/lib/spawn-pipe.c:617
617	{
Continuing.

Thread 1 "bison" hit Breakpoint 7, create_pipe (progname=progname@entry=0x10046c418 <__func__.2+600> "m4", 
    prog_path=prog_path@entry=0x100468643 <argmatch_warning_docs+2275> "/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-1/lib/spawn-pipe.c:147
147	{
Continuing.

Thread 1 "bison" hit Breakpoint 8, create_pipe (progname=progname@entry=0x10046c418 <__func__.2+600> "m4", 
    prog_path=prog_path@entry=0x100468643 <argmatch_warning_docs+2275> "/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-1/lib/spawn-pipe.c:475
475	      block_fatal_signals ();
Continuing.

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

Thread 1 "bison" hit Breakpoint 10, block_fatal_signals () at /usr/src/debug/bison-3.8.1-1/lib/fatal-signal.c:318
318	  if (mt) gl_lock_lock (fatal_signals_block_lock);
Continuing.

Thread 1 "bison" received signal SIGSEGV, Segmentation fault.
0x0000000100000000 in ?? ()
#0  0x0000000100000000 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
-------------- next part --------------
gdb -d bison-3.8.1-1.x86_64/src/bison-3.8.1/src -d bison-3.8.1-1.x86_64/src/bison-3.8.1/lib -d bison-3.8.1-1.x86_64/src/bison-3.8.1/lib/glthread -r -ex 'source bison-segv-cygwin-64.gdb' bison-3.8.1-1.x86_64/build/src/bison


More information about the Cygwin-apps mailing list