Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test failures with gcc 4.8.0 -fsanitize=address #12885

Open
p5pRT opened this issue Mar 27, 2013 · 5 comments
Open

Test failures with gcc 4.8.0 -fsanitize=address #12885

p5pRT opened this issue Mar 27, 2013 · 5 comments

Comments

@p5pRT
Copy link

p5pRT commented Mar 27, 2013

Migrated from rt.perl.org#117383 (status was 'open')

Searchable as RT117383$

@p5pRT
Copy link
Author

p5pRT commented Mar 27, 2013

From @timbunce

Created by @timbunce

I built bleadperl b5de49e on OS X 10.8.3 using gcc 4.8.0 from macports
with -fsanitize=address enabled.

Failed 4 tests out of 2327, 99.83% okay.
  mro/recursion_c3_utf8.t
  mro/recursion_dfs_utf8.t
  op/tie_fetch_count.t
  run/runenv.t

The runenv.t failure is​:
  # Failed test 46 - PERL_HASH_SEED => 12345678,PERL_HASH_SEED_DEBUG => 1,-e,1 stderr at run/runenv.t line 217
  # Failed test 48 - PERL_HASH_SEED => 12,PERL_HASH_SEED_DEBUG => 1,-e,1 stderr at run/runenv.t line 222

The others were AddressSanitizer exceptions​:

t/op/tie_fetch_count .......................................... ASAN​:SIGSEGV =================================================================
==26704== ERROR​: AddressSanitizer​: SEGV on unknown address 0x601a00026cb8 (pc 0x00010c917c55 sp 0x7fff5631c370 bp 0x7fff5631c540 T0) AddressSanitizer can not provide additional info.

t/mro/recursion_c3_utf8 ....................................... ASAN​:SIGSEGV =================================================================
==27612== ERROR​: AddressSanitizer​: SEGV on unknown address 0x601a000190d8 (pc 0x000104d861d6 sp 0x7fff5ddf4800 bp 0x7fff5ddf4820 T0) AddressSanitizer can not provide additional info.

t/mro/recursion_dfs_utf8 ...................................... ASAN​:SIGSEGV =================================================================
==27614== ERROR​: AddressSanitizer​: SEGV on unknown address 0x601a000190e8 (pc 0x00010ff99cec sp 0x7fff52cdab50 bp 0x7fff52cdac00 T0) AddressSanitizer can not provide additional info.

Caveat​: the gcc48 port is actually gcc48 @​4.8-20130321 (lang)
"The GNU compiler collection, prerelease BETA".
That was packaged one day before the official gcc 4.8.0 release.
It's the latest available via macports at the time of writing and, given the
one day gap, seemed reasonable to use for my needs. Your mileage with the
official gcc 4.8.0 release may vary.

Perl Info

Flags:
    category=core
    severity=high

Site configuration information for perl 5.17.11:

Configured by timbo at Wed Mar 27 20:37:03 GMT 2013.

Summary of my perl5 (revision 5 version 17 subversion 11) configuration:
  Derived from: b5de49e55f04e3a6c36012d250a46eb301a2be38
  Platform:
    osname=darwin, osvers=12.3.0, archname=darwin-thread-multi-2level
    uname='darwin timac.local 12.3.0 darwin kernel version 12.3.0: sun jan 6 22:37:10 pst 2013; root:xnu-2050.22.13~1release_x86_64 x86_64 '
    config_args='-des -Doptimize=-g -O1 -DEBUGGING=both -Accflags=-fsanitize=address -fno-omit-frame-pointer -Aldflags=-fsanitize=address -Alddlflags=-fsanitize=address -Dusethreads -Dusemultiplicity -Dusesitecustomize -Dusedevel -Uversiononly -Dcc=gcc-mp-4.8 -Dld=gcc-mp-4.8 -Duseshrplib'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=define, usemultiplicity=define
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='gcc-mp-4.8', ccflags ='-fno-common -DPERL_DARWIN -fsanitize=address -fno-omit-frame-pointer -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -I/opt/local/include',
    optimize='-g -O1',
    cppflags='-fno-common -DPERL_DARWIN -fsanitize=address -fno-omit-frame-pointer -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -I/opt/local/include'
    ccversion='', gccversion='4.8.0 20130321 (prerelease)', gccosandvers=''
    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='env MACOSX_DEPLOYMENT_TARGET=10.3 gcc-mp-4.8', ldflags =' -fsanitize=address -fstack-protector -L/usr/local/lib -L/opt/local/lib'
    libpth=/usr/local/lib /opt/local/lib /usr/lib
    libs=-lgdbm -ldbm -ldl -lm -lutil -lc
    perllibs=-ldl -lm -lutil -lc
    libc=, so=dylib, useshrplib=true, libperl=libperl.dylib
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup -fsanitize=address -L/usr/local/lib -L/opt/local/lib -fstack-protector'

Locally applied patches:
    


@INC for perl 5.17.11:
    lib
    /usr/local/lib/perl5/site_perl/5.17.11/darwin-thread-multi-2level
    /usr/local/lib/perl5/site_perl/5.17.11
    /usr/local/lib/perl5/5.17.11/darwin-thread-multi-2level
    /usr/local/lib/perl5/5.17.11
    .


Environment for perl 5.17.11:
    DYLD_LIBRARY_PATH=/Users/timbo/perl/blead:
    HOME=/Users/timbo
    LANG=en_IE.UTF-8
    LANGUAGE (unset)
    LC_ALL=en_IE.UTF-8
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=.:/opt/local/bin:/Users/timbo/perl5/perlbrew/bin:/Users/timbo/perl5/perlbrew/perls/perl-5.12.4/bin:/Users/timbo/bin:/usr/local/perl512-dev/bin:/Users/timbo/perl6/rakudo/parrot_install/bin:/usr/local/mysql/bin:/usr/local/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
    PERLBREW_BASHRC_VERSION=0.44
    PERLBREW_HOME=/Users/timbo/.perlbrew
    PERLBREW_MANPATH=/Users/timbo/perl5/perlbrew/perls/perl-5.12.4/man
    PERLBREW_PATH=/Users/timbo/perl5/perlbrew/bin:/Users/timbo/perl5/perlbrew/perls/perl-5.12.4/bin
    PERLBREW_PERL=perl-5.12.4
    PERLBREW_ROOT=/Users/timbo/perl5/perlbrew
    PERLBREW_VERSION=0.44
    PERLCRITIC=/Users/timbo/.setdev/perlcriticrc
    PERLTIDY=/Users/timbo/.setdev/perltidyrc
    PERL_BADLANG (unset)
    SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Mar 28, 2013

From @craigberry

On Wed, Mar 27, 2013 at 6​:22 PM, Tim Bunce <perlbug-followup@​perl.org> wrote​:

I built bleadperl b5de49e on OS X 10.8.3 using gcc 4.8.0 from macports
with -fsanitize=address enabled.

Failed 4 tests out of 2327, 99.83% okay.
mro/recursion_c3_utf8.t
mro/recursion_dfs_utf8.t
op/tie_fetch_count.t
run/runenv.t

The runenv.t failure is​:
# Failed test 46 - PERL_HASH_SEED => 12345678,PERL_HASH_SEED_DEBUG => 1,-e,1 stderr at run/runenv.t line 217
# Failed test 48 - PERL_HASH_SEED => 12,PERL_HASH_SEED_DEBUG => 1,-e,1 stderr at run/runenv.t line 222

The others were AddressSanitizer exceptions​:

t/op/tie_fetch_count .......................................... ASAN​:SIGSEGV =================================================================
==26704== ERROR​: AddressSanitizer​: SEGV on unknown address 0x601a00026cb8 (pc 0x00010c917c55 sp 0x7fff5631c370 bp 0x7fff5631c540 T0) AddressSanitizer can not provide additional info.

t/mro/recursion_c3_utf8 ....................................... ASAN​:SIGSEGV =================================================================
==27612== ERROR​: AddressSanitizer​: SEGV on unknown address 0x601a000190d8 (pc 0x000104d861d6 sp 0x7fff5ddf4800 bp 0x7fff5ddf4820 T0) AddressSanitizer can not provide additional info.

t/mro/recursion_dfs_utf8 ...................................... ASAN​:SIGSEGV =================================================================
==27614== ERROR​: AddressSanitizer​: SEGV on unknown address 0x601a000190e8 (pc 0x00010ff99cec sp 0x7fff52cdab50 bp 0x7fff52cdac00 T0) AddressSanitizer can not provide additional info.

Caveat​: the gcc48 port is actually gcc48 @​4.8-20130321 (lang)
"The GNU compiler collection, prerelease BETA".
That was packaged one day before the official gcc 4.8.0 release.
It's the latest available via macports at the time of writing and, given the
one day gap, seemed reasonable to use for my needs. Your mileage with the
official gcc 4.8.0 release may vary.

I built GCC 4.8.0 final from source on OS X 10.8.3, configured
v5.17.10-39-gb5de49e with​:

$ ./Configure -Dusedevel -Dcc=gcc -Dccflags=-fsanitize=address
-Dldflags=-fsanitize=address -des

and got only​:

Failed 2 tests out of 2254, 99.91% okay.
  ../cpan/B-Lint/t/lint.t
  run/runenv.t

the runenv.t failure was the same as Tim's.

lint.t fails with​:

ok 27 - bare-subs
not ok 28 - Lint legacy plugin
# Failed test 28 - Lint legacy plugin at cpan/B-Lint/t/lint.t line 134
# got 'ASAN​:SIGSEGV
# =================================================================
# ==65379== ERROR​: AddressSanitizer​: SEGV on unknown address
0x601a0000cfd3 (pc 0x0001030acb67 sp 0x7fff5cd5f7e0 bp 0x60620000dce4
T0)
# AddressSanitizer can not provide additional info.
# #0 0x1030acb66 (/Users/craig/perlrep/perl/perl+0x10020db66)
# ==65379== ABORTING
# '
# expected /(?^​:X ok\.)/
ok 29 - Lint uses Module​::Pluggable

I attempted another build with all 14 of the Configure options that
appeared in Tim's bug report, i.e.,

$ ./Configure -des -Doptimize='-g -O1' -DEBUGGING=both
-Accflags='-fsanitize=address -fno-omit-frame-pointer'
-Aldflags=-fsanitize=address -Alddlflags=-fsanitize=address
-Dusethreads -Dusemultiplicity -Dusesitecustomize -Dusedevel
-Uversiononly -Dcc=gcc -Dld=gcc -Duseshrplib

but the build failed when linking DynaLoader with a long list of
undefined symbol errors. I don't know what about half of those
options mean, so I'm not planning to investigate further.

@p5pRT
Copy link
Author

p5pRT commented Mar 28, 2013

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Mar 29, 2013

From @rurban

On Thu, Mar 28, 2013 at 6​:36 PM, Craig A. Berry <craig.a.berry@​gmail.com> wrote​:

On Wed, Mar 27, 2013 at 6​:22 PM, Tim Bunce <perlbug-followup@​perl.org> wrote​:

I built bleadperl b5de49e on OS X 10.8.3 using gcc 4.8.0 from macports
with -fsanitize=address enabled.

Failed 4 tests out of 2327, 99.83% okay.
mro/recursion_c3_utf8.t
mro/recursion_dfs_utf8.t
op/tie_fetch_count.t
run/runenv.t

The runenv.t failure is​:
# Failed test 46 - PERL_HASH_SEED => 12345678,PERL_HASH_SEED_DEBUG => 1,-e,1 stderr at run/runenv.t line 217
# Failed test 48 - PERL_HASH_SEED => 12,PERL_HASH_SEED_DEBUG => 1,-e,1 stderr at run/runenv.t line 222

The others were AddressSanitizer exceptions​:

I could verify the asan SEGVs with the macports version and I got a few more.
These look like compiler errors to me, possibly alignment problems or
miscompilations.
I could not repro it with latest clang and asan.

I also could not repro some gcc+asan segvs tests with cpan/Digest-MD5
and cpan/Digest-SHA
when I run the tests manually.

So lets rather wait for a stable gcc+asan
--
Reini Urban
http​://cpanel.net/ http​://www.perl-compiler.org/

@jkeenan
Copy link
Contributor

jkeenan commented Dec 8, 2021

From @timbunce

Created by @timbunce

I built bleadperl b5de49e on OS X 10.8.3 using gcc 4.8.0 from macports with -fsanitize=address enabled.

Failed 4 tests out of 2327, 99.83% okay. mro/recursion_c3_utf8.t mro/recursion_dfs_utf8.t op/tie_fetch_count.t run/runenv.t

@timbunce, @craigberry, @rurban: Could we get an update on the status of this ticket?

Re-reading the ticket 8 years later (!), it appears to be very Mac-specific and somewhat gcc-version-specific. Have the underlying problems resolved (such that we could close this ticket)?

Thank you very much.
Jim Keenan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants