Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 668044

Summary: media-libs/libextractor-1.6 : ole2_extractor.c:337:9: internal compiler error:<snip> Segmentation fault
Product: Gentoo Linux Reporter: Toralf Förster <toralf>
Component: Current packagesAssignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it <maintainer-needed>
Status: RESOLVED FIXED    
Severity: normal CC: slyfox, toolchain
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=654766
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: emerge-info.txt
emerge-history.txt
environment
etc.portage.tbz2
logs.tbz2
media-libs:libextractor-1.6:20181008-111759.log
temp.tbz2
emerge-info.txt
emerge-history.txt
environment
etc.portage.tbz2
logs.tbz2
media-libs:libextractor-1.7:20181020-201741.log
temp.tbz2

Description Toralf Förster gentoo-dev 2018-10-08 12:13:11 UTC
during RTL pass: expand
ole2_extractor.c: In function ‘EXTRACTOR_ole2_extract_method’:
ole2_extractor.c:337:9: internal compiler error: Segmentation fault
   (0 != strncmp (&buf[2],
         ^~~~~~~~~~~~~~~~~
    "SfxDocumentInfo",

  -------------------------------------------------------------------

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 17.0-hardened_20181006-211111

  -------------------------------------------------------------------

gcc-config -l:
 [1] x86_64-pc-linux-gnu-8.2.0 *

Available Python interpreters, in order of preference:
  [1]   python3.6
  [2]   python2.7 (fallback)
Available Ruby profiles:
  [1]   ruby23 (with Rubygems) *



emerge -qpv media-libs/libextractor
[ebuild  N    ] media-libs/libextractor-1.6  USE="archive bzip2 gsf magic zlib -apparmor -ffmpeg -flac -gif -gstreamer -gtk -jpeg -midi -mp4 -mpeg -tidy -tiff -vorbis"
Comment 1 Toralf Förster gentoo-dev 2018-10-08 12:13:13 UTC
Created attachment 549890 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2018-10-08 12:13:16 UTC
Created attachment 549892 [details]
emerge-history.txt
Comment 3 Toralf Förster gentoo-dev 2018-10-08 12:13:19 UTC
Created attachment 549894 [details]
environment
Comment 4 Toralf Förster gentoo-dev 2018-10-08 12:13:21 UTC
Created attachment 549896 [details]
etc.portage.tbz2
Comment 5 Toralf Förster gentoo-dev 2018-10-08 12:13:24 UTC
Created attachment 549898 [details]
logs.tbz2
Comment 6 Toralf Förster gentoo-dev 2018-10-08 12:13:27 UTC
Created attachment 549900 [details]
media-libs:libextractor-1.6:20181008-111759.log
Comment 7 Toralf Förster gentoo-dev 2018-10-08 12:13:30 UTC
Created attachment 549902 [details]
temp.tbz2
Comment 8 Pacho Ramos gentoo-dev 2018-10-20 18:34:02 UTC
I cannot reproduce... also, that "Internal compiler errors" are usually something specific to the system :/

Can you retry also with newer 1.7 version? Thanks
Comment 9 Toralf Förster gentoo-dev 2018-10-20 20:14:13 UTC
(In reply to Pacho Ramos from comment #8)
1.7 works
Comment 10 Toralf Förster gentoo-dev 2018-10-20 20:31:43 UTC
got at the unstable amd64 chroot image 17.0-hardened_20181006-211111 this : ole2_extractor.c:337:9: internal compiler error:<snip> Segmentation fault
Comment 11 Toralf Förster gentoo-dev 2018-10-20 20:31:46 UTC
Created attachment 552006 [details]
emerge-info.txt
Comment 12 Toralf Förster gentoo-dev 2018-10-20 20:31:49 UTC
Created attachment 552008 [details]
emerge-history.txt
Comment 13 Toralf Förster gentoo-dev 2018-10-20 20:31:51 UTC
Created attachment 552010 [details]
environment
Comment 14 Toralf Förster gentoo-dev 2018-10-20 20:31:54 UTC
Created attachment 552012 [details]
etc.portage.tbz2
Comment 15 Toralf Förster gentoo-dev 2018-10-20 20:31:57 UTC
Created attachment 552014 [details]
logs.tbz2
Comment 16 Toralf Förster gentoo-dev 2018-10-20 20:32:00 UTC
Created attachment 552016 [details]
media-libs:libextractor-1.7:20181020-201741.log
Comment 17 Toralf Förster gentoo-dev 2018-10-20 20:32:02 UTC
Created attachment 552018 [details]
temp.tbz2
Comment 18 Larry the Git Cow gentoo-dev 2018-10-20 20:46:52 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6a2b56c0a796fdb00151ba69fb2c617715307905

commit 6a2b56c0a796fdb00151ba69fb2c617715307905
Author:     Pacho Ramos <pacho@gentoo.org>
AuthorDate: 2018-10-20 20:46:33 +0000
Commit:     Pacho Ramos <pacho@gentoo.org>
CommitDate: 2018-10-20 20:46:43 +0000

    media-libs/libextractor: Fix gcc-8 segfault (#668044 by Toralf Förster)
    
    Closes: https://bugs.gentoo.org/668044
    Signed-off-by: Pacho Ramos <pacho@gentoo.org>
    Package-Manager: Portage-2.3.51, Repoman-2.3.11

 .../files/libextractor-1.7-segfault.patch             | 19 +++++++++++++++++++
 media-libs/libextractor/libextractor-1.7.ebuild       |  5 +++++
 2 files changed, 24 insertions(+)
Comment 19 Sergei Trofimovich (RETIRED) gentoo-dev 2018-10-20 22:32:47 UTC
Compiler SIGSEGV also sounds like gcc bug. Would be nice to track it down and report upstream.
Comment 20 Sergei Trofimovich (RETIRED) gentoo-dev 2018-10-20 23:33:06 UTC
(In reply to Sergei Trofimovich from comment #19)
> Compiler SIGSEGV also sounds like gcc bug. Would be nice to track it down
> and report upstream.

Got minimal reproducer:

$ cat bug.c
a;
b() {
  char b[a];
  strncmp(&b[2], "", 0) || 0;
}
$ gcc -c bug.c
bug.c:4:3: internal compiler error: Segmentation fault
   strncmp(&b[2], "", 0) || 0;
   ^~~~~~~~~~~~~~~~~~~~~

gcc-HEAD seems to work. Let's see if we can backport something.
Comment 21 Pacho Ramos gentoo-dev 2018-10-21 08:02:56 UTC
Good, let me know the progress :)

Thanks!
Comment 22 Sergei Trofimovich (RETIRED) gentoo-dev 2018-10-21 09:09:30 UTC
(In reply to Sergei Trofimovich from comment #20)
> (In reply to Sergei Trofimovich from comment #19)
> > Compiler SIGSEGV also sounds like gcc bug. Would be nice to track it down
> > and report upstream.
> 
> Got minimal reproducer:
> 
> $ cat bug.c
> a;
> b() {
>   char b[a];
>   strncmp(&b[2], "", 0) || 0;
> }
> $ gcc -c bug.c
> bug.c:4:3: internal compiler error: Segmentation fault
>    strncmp(&b[2], "", 0) || 0;
>    ^~~~~~~~~~~~~~~~~~~~~
> 
> gcc-HEAD seems to work. Let's see if we can backport something.

Bisected down to this fix in gcc-8 branch:

  commit e24ceb4802f0cc1bb9e498af6f5bdd29e556c34b
  Author: jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
  Date:   Tue Aug 28 11:43:22 2018 +0000

            PR middle-end/87099
            * calls.c (maybe_warn_nonstring_arg): Punt early if
            warn_stringop_overflow is zero.  Don't call get_range_strlen
            on 3rd argument, keep iterating until lenrng[1] is INTEGER_CST.
            Only use lenrng[1] if non-NULL and INTEGER_CST.  Don't uselessly
            increment lenrng[0].
    
            * gcc.dg/pr87099.c: New test.

https://gcc.gnu.org/PR87099
Comment 23 Larry the Git Cow gentoo-dev 2018-10-21 12:20:57 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3b3cd50825ef2f27b4c2b81cd300728743a321fb

commit 3b3cd50825ef2f27b4c2b81cd300728743a321fb
Author:     Pacho Ramos <pacho@gentoo.org>
AuthorDate: 2018-10-21 12:20:13 +0000
Commit:     Pacho Ramos <pacho@gentoo.org>
CommitDate: 2018-10-21 12:20:49 +0000

    Revert "media-libs/libextractor: Fix gcc-8 segfault (#668044 by Toralf Förster)"
    
    This reverts commit 6a2b56c0a796fdb00151ba69fb2c617715307905.
    
    Bug: https://bugs.gentoo.org/668044
    Signed-off-by: Pacho Ramos <pacho@gentoo.org>

 .../files/libextractor-1.7-segfault.patch             | 19 -------------------
 media-libs/libextractor/libextractor-1.7.ebuild       |  5 -----
 2 files changed, 24 deletions(-)
Comment 24 Pacho Ramos gentoo-dev 2018-10-21 12:21:53 UTC
Reverted... we will wait for a newer gcc8 package then :)

Thanks for the work!
Comment 25 Larry the Git Cow gentoo-dev 2018-10-27 11:46:16 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f7c3c14f0c483e882c5a8aebb07365241d68611a

commit f7c3c14f0c483e882c5a8aebb07365241d68611a
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: 2018-10-27 09:04:08 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2018-10-27 11:46:03 +0000

    sys-devel/gcc: cut 1.5 patchset for 8.2.0
    
    3 new patches:
    + 111_all_ubd-hog-PR85704.patch:
      fix initialization of empty structs
    U 105_all_libgfortran-Werror.patch:
      patch configure.ac as well
    + 112_all_libstdcxx-no-vtv.patch:
      drop libstdc++ libking against libvtv
    + 113_all_ICE-on-strncmp-PR87099.patch:
      fix SIGSEGV on strncmp() VRP checks
    
    Closes: https://gcc.gnu.org/PR85704
    Closes: https://bugs.gentoo.org/582524
    Bug: https://gcc.gnu.org/PR85884
    Reported-by: Toralf Förster
    Closes: https://bugs.gentoo.org/668044
    Bug: https://gcc.gnu.org/PR87099
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
    Package-Manager: Portage-2.3.51, Repoman-2.3.11

 sys-devel/gcc/Manifest            |  1 +
 sys-devel/gcc/gcc-8.2.0-r4.ebuild | 20 ++++++++++++++++++++
 2 files changed, 21 insertions(+)