GNU bug report logs - #40477
Segfault with grep-3.4 and pcre-8.44

Previous Next

Package: grep;

Reported by: Bruce Dubbs <bruce.dubbs <at> gmail.com>

Date: Mon, 6 Apr 2020 20:55:01 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 40477 in the body.
You can then email your comments to 40477 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-grep <at> gnu.org:
bug#40477; Package grep. (Mon, 06 Apr 2020 20:55:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Bruce Dubbs <bruce.dubbs <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-grep <at> gnu.org. (Mon, 06 Apr 2020 20:55:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Bruce Dubbs <bruce.dubbs <at> gmail.com>
To: bug-grep <at> gnu.org
Subject: Segfault with grep-3.4 and pcre-8.44
Date: Mon, 6 Apr 2020 15:54:47 -0500
In linuxfromscratch we normally build grep without pcre using:

./configure --prefix=/usr --bindir=/bin
make

It works fine.

Later after pcre is installed users can rebuild grep with exactly the 
same instructions, but with grep-3.4, I get a segfault with

grep --help

and all other command line entries.  Adding --disable-perl-regexp 
restores grep but of course removes pcre regex capabilities.

I went back and built grep-3.3 with pcre and everything worked with the 
same pcre library as above.

I did some preliminary gdb testing and got:

Reading symbols from src/grep...
(gdb) run --help
Starting program: /build/grep/grep-3.4/src/grep --help

Program received signal SIGSEGV, Segmentation fault.
0x000000000041cc03 in __libc_start_main ()
(gdb) bt
#0  0x000000000041cc03 in __libc_start_main ()
#1  0x000000000040715a in _start () at ../sysdeps/x86_64/start.S:120

We are using glibc-2.31 and gcc-9.2.0 if that makes a difference.

  -- Bruce Dubbs
     linuxfromscratch.org




Information forwarded to bug-grep <at> gnu.org:
bug#40477; Package grep. (Mon, 06 Apr 2020 23:49:01 GMT) Full text and rfc822 format available.

Message #8 received at 40477 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Bruce Dubbs <bruce.dubbs <at> gmail.com>
Cc: 40477 <at> debbugs.gnu.org
Subject: Re: bug#40477: Segfault with grep-3.4 and pcre-8.44
Date: Mon, 6 Apr 2020 16:48:13 -0700
On 4/6/20 1:54 PM, Bruce Dubbs wrote:
> 
> Program received signal SIGSEGV, Segmentation fault.
> 0x000000000041cc03 in __libc_start_main ()
> (gdb) bt
> #0  0x000000000041cc03 in __libc_start_main ()
> #1  0x000000000040715a in _start () at ../sysdeps/x86_64/start.S:120

You'll have to debug this one, as grep's main function hasn't even started yet 
so the failure cannot be due to anything in grep's source code. Probably you 
linked it the wrong way somehow.




Information forwarded to bug-grep <at> gnu.org:
bug#40477; Package grep. (Tue, 07 Apr 2020 03:32:02 GMT) Full text and rfc822 format available.

Message #11 received at 40477 <at> debbugs.gnu.org (full text, mbox):

From: Bruce Dubbs <bruce.dubbs <at> gmail.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 40477 <at> debbugs.gnu.org
Subject: Re: bug#40477: Segfault with grep-3.4 and pcre-8.44
Date: Mon, 6 Apr 2020 22:31:33 -0500
On 4/6/20 6:48 PM, Paul Eggert wrote:
> On 4/6/20 1:54 PM, Bruce Dubbs wrote:
>>
>> Program received signal SIGSEGV, Segmentation fault.
>> 0x000000000041cc03 in __libc_start_main ()
>> (gdb) bt
>> #0  0x000000000041cc03 in __libc_start_main ()
>> #1  0x000000000040715a in _start () at ../sysdeps/x86_64/start.S:120
> 
> You'll have to debug this one, as grep's main function hasn't even 
> started yet so the failure cannot be due to anything in grep's source 
> code. Probably you linked it the wrong way somehow.

It's definitely a problem specific to my system.  I tried it on another 
very similar system with the same gcc, glibc, and build instructions and 
it worked perfectly.

Upon more investigation my problem may be to be due to libsigsegv-2.12. 
If I keep that from being linked into grep it is fine.

I'm passing on this as info.  I don't think it is a grep issue, but in 
case you run into it again I offer the following:

For grep-3.3 (working):
[ /build/grep33/grep-3.3 ]$ ldd src/grep
        linux-vdso.so.1 (0x00007ffc2858b000)
        libpcre.so.1 => /lib/libpcre.so.1 (0x00007fa569942000)
        libsigsegv.so.2 => /usr/lib/libsigsegv.so.2 (0x00007fa56993c000)
        libc.so.6 => /lib/libc.so.6 (0x00007fa569779000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fa5699b8000)

For grep-3.4 (not working):

[ /build/grep/grep-3.4 ]$ ldd src/grep
        linux-vdso.so.1 (0x00007ffded180000)
        libpcre.so.1 => /lib/libpcre.so.1 (0x00007f38dd95e000)
        libsigsegv.so.2 => /usr/lib/libsigsegv.so.2 (0x00007f38dd958000)
        libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007f38dd93e000)
        libc.so.6 => /lib/libc.so.6 (0x00007f38dd77b000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f38dd9d4000)

I have no idea why my system is adding libgcc_s.so.1 into the build. I 
did note that the link line included /usr/lib/libc.a.  Removing that 
fixed my problem.

  -- Bruce




Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Mon, 21 Sep 2020 19:21:01 GMT) Full text and rfc822 format available.

Notification sent to Bruce Dubbs <bruce.dubbs <at> gmail.com>:
bug acknowledged by developer. (Mon, 21 Sep 2020 19:21:01 GMT) Full text and rfc822 format available.

Message #16 received at 40477-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Bruce Dubbs <bruce.dubbs <at> gmail.com>
Cc: 40477-done <at> debbugs.gnu.org
Subject: Re: bug#40477: Segfault with grep-3.4 and pcre-8.44
Date: Mon, 21 Sep 2020 12:19:57 -0700
On 4/6/20 8:31 PM, Bruce Dubbs wrote:

> Upon more investigation my problem may be to be due to libsigsegv-2.12. If I 
> keep that from being linked into grep it is fine.

This appears to be the Gnulib/libsigsegv problem that Bruno Haible fixed yesterday:

https://lists.gnu.org/r/bug-gnulib/2020-09/msg00101.html

so I'm closing the grep bug report.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 20 Oct 2020 11:24:13 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 187 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.