AddressSanitizer CHECK failed: ../../../sanitizer/asan/asan_interceptors.cc:384 "((__interception::real___cxa_throw)) != (0)" (0x0, 0x0)

Bug #1762683 reported by Vojtěch Fried on 2018-04-10
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
gcc
Invalid
Medium
gcc-6 (Ubuntu)
Undecided
Unassigned
gcc-7 (Ubuntu)
Undecided
Unassigned
gcc-8 (Ubuntu)
Undecided
Unassigned

Bug Description

see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84428 for details and repro

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: libubsan0 7.3.0-15ubuntu2
ProcVersionSignature: Ubuntu 4.15.0-13.14-generic 4.15.10
Uname: Linux 4.15.0-13-generic x86_64
ApportVersion: 2.20.9-0ubuntu4
Architecture: amd64
CurrentDesktop: XFCE
Date: Tue Apr 10 11:09:34 2018
Dependencies:
 gcc-7-base 7.3.0-15ubuntu2
 gcc-8-base 8-20180408-0ubuntu1
 libc6 2.27-0ubuntu3
 libgcc1 1:8-20180408-0ubuntu1
 libstdc++6 8-20180408-0ubuntu1
InstallationDate: Installed on 2010-10-19 (2729 days ago)
InstallationMedia: Xubuntu 10.10 "Maverick Meerkat" - Release amd64 (20101008.1)
SourcePackage: gcc-7
UpgradeStatus: No upgrade log present (probably fresh install)

Vojtěch Fried (vojtechfried) wrote :
Matthias Klose (doko) wrote :

libasan should be linked with --no-as-needed. However it looks to me that this is already done in the Ubuntu gcc builds.

Changed in gcc:
importance: Unknown → Medium
status: Unknown → Invalid
Matthias Klose (doko) wrote :

ahh, that was only done for libtsan.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gcc-7 - 7.3.0-16ubuntu2

---------------
gcc-7 (7.3.0-16ubuntu2) bionic; urgency=medium

  * Merge with Debian; remaining changes:
    - Build from upstream sources.
  * Update the gcc-foffload-default patch. LP: #1721355.

gcc-7 (7.3.0-16) unstable; urgency=medium

  * Update to SVN 20180411 (r259316) from the gcc-7-branch.
    - Fix PR target/85203 (ARM), PR target/84748 (AArch64), PR c++/85279,
      PR target/85196 (SPARC).
  * Use triplet-prefixed as and ld (Helmut Grohne). Addresses: #895251.
  * Link libasan, liblsan, libubsan always with --no-as-needed. LP: #1762683.
  * Backport r251558 from the trunk, addresses Linaro #3718. LP: #1759369.
  * Fix PR libstdc++/85222, taken from the trunk.
  * Use --push-state --as-needed and --pop-state instead of --as-needed and
    --no-as-needed for linking libgcc.

 -- Matthias Klose <email address hidden> Thu, 12 Apr 2018 00:45:22 +0200

Changed in gcc-7 (Ubuntu):
status: New → Fix Released
Vojtěch Fried (vojtechfried) wrote :

I can still reproduce the bug after an update.

g++ --version
g++ (Ubuntu 7.3.0-16ubuntu2) 7.3.0

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gcc-8 - 8-20180414-1ubuntu1

---------------
gcc-8 (8-20180414-1ubuntu1) bionic; urgency=medium

  * GCC 8 snapshot, taken from the trunk 20180408 (r259224).
  * Strip the binaries for the upcoming release.

gcc-8 (8-20180414-1) unstable; urgency=medium

  * GCC 8 snapshot, taken from the trunk 20180414 (r259383).

  [ Matthias Klose ]
  * Update GDC to 20180410.
  * Don't install i586 symlinks anymore for i386 builds in sid.
  * Fix zlib-dev dependencies for the libphobos cross multilib packages.
  * Fix dependency generation for libatomic and libquadmath cross packages.
  * Use triplet-prefixed as and ld (Helmut Grohne). Closes: #895251.
  * Link libasan, liblsan, libubsan always with --no-as-needed. LP: #1762683.
  * Use --push-state --as-needed and --pop-state instead of --as-needed and
    --no-as-needed for linking libgcc.
  * Update the gcc-foffload-default patch. LP: #1721355.

  [ Svante Signell ]
  * Reintroduce libgo patches for hurd-i386. Closes: #894080.

 -- Matthias Klose <email address hidden> Sat, 14 Apr 2018 07:29:59 +0200

Changed in gcc-8 (Ubuntu):
status: New → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gcc-6 - 6.4.0-17ubuntu1

---------------
gcc-6 (6.4.0-17ubuntu1) bionic; urgency=medium

  * Merge with Debian; remaining changes:
    - Build from upstream sources.

gcc-6 (6.4.0-17) unstable; urgency=medium

  * Update to SVN 20180424 (r259590) from the gcc-6-branch.
    - Fix PR target/83660 (PPC), PR middle-end/85496, PR target/85261 (ARM),
      PR target/84574 (x86), PR target/84039 (x86), PR target/84530 (x86),
      PR target/83839 (x86), PR target/83905 (x86), PR target/82499 (x86),
      PR target/84748 (AArch64), PR target/85196 (SPARC).
    - Backport of the retpoline support.
  * Use triplet-prefixed as and ld (Helmut Grohne). Addresses: #895251.
  * Link libasan, liblsan, libubsan always with --no-as-needed. LP: #1762683.
  * Use --push-state --as-needed and --pop-state instead of --as-needed and
    --no-as-needed for linking libgcc.
  * Use the binutils in the build chroot if present.

 -- Matthias Klose <email address hidden> Tue, 24 Apr 2018 07:16:10 +0200

Changed in gcc-6 (Ubuntu):
status: New → Fix Released
Vojtěch Fried (vojtechfried) wrote :

I can still reproduce the bug.

Changed in gcc-7 (Ubuntu):
status: Fix Released → Incomplete
Changed in gcc-7 (Ubuntu):
status: Incomplete → Fix Released
Janusz Lisiecki (januszl) wrote :

I have the same problem and it doesn't work with gcc 7.3.0-27.
I tried to https://gcc.gnu.org/bugzilla/attachment.cgi?id=43866 from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84428 with -v option. I see "--push-state --no-as-needed -lasan --pop-state" but it doesn't help.

Phil M (unmobile+ubuntu) wrote :

I'm still seeing this problem for both 7.4.0-1ubuntu1~18.04.1 and 8.3.0-6ubuntu1~18.04.1.

I've confirmed with the reproduction case posted on the GCC bug as well:

phil@machine:~/python_module$ g++ --version
g++ (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

phil@machine:~/python_module$ bash run.sh
without sanitizers
Throwing an exception
Caught an exception
Hello
*******
with sanitizers
Throwing an exception
==11969==AddressSanitizer CHECK failed: ../../../../src/libsanitizer/asan/asan_interceptors.cc:384 "((__interception::real___cxa_throw)) != (0)" (0x0, 0x0)
    #0 0x7faf2d20fc02 (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xe9c02)
    #1 0x7faf2d22e595 in __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x108595)
    #2 0x7faf2d15e26c in __interceptor___cxa_throw (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x3826c)
    #3 0x7faf28e631f5 in greet(_object*, _object*) (/home/phil/python_module/greet.so+0x11f5)
    #4 0x503090 (/usr/bin/python3.6+0x503090)
    #5 0x506858 in _PyEval_EvalFrameDefault (/usr/bin/python3.6+0x506858)
    #6 0x502208 (/usr/bin/python3.6+0x502208)
    #7 0x502f3c (/usr/bin/python3.6+0x502f3c)
    #8 0x506858 in _PyEval_EvalFrameDefault (/usr/bin/python3.6+0x506858)
    #9 0x504c27 (/usr/bin/python3.6+0x504c27)
    #10 0x506392 in PyEval_EvalCode (/usr/bin/python3.6+0x506392)
    #11 0x634d51 (/usr/bin/python3.6+0x634d51)
    #12 0x634e09 in PyRun_FileExFlags (/usr/bin/python3.6+0x634e09)
    #13 0x6385c7 in PyRun_SimpleFileExFlags (/usr/bin/python3.6+0x6385c7)
    #14 0x639159 in Py_Main (/usr/bin/python3.6+0x639159)
    #15 0x4a6f0f in main (/usr/bin/python3.6+0x4a6f0f)
    #16 0x7faf2cd56b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
    #17 0x5afa09 in _start (/usr/bin/python3.6+0x5afa09)

Phil M (unmobile+ubuntu) wrote :

Please change the state back to 'Incomplete', since I don't have the privileges to do so

Phil M (unmobile+ubuntu) wrote :

Also gcc-6

Vojtěch Fried (vojtechfried) wrote :

Yes, the bug is still reproducible. Changing to Confirmed.

Changed in gcc-7 (Ubuntu):
status: Fix Released → Confirmed
Changed in gcc-8 (Ubuntu):
status: Fix Released → Confirmed
Changed in gcc-6 (Ubuntu):
status: Fix Released → Confirmed
Itay Marom (imarom) wrote :

Hi,

I ran into the same issue while trying to run Python extension (binding over C++ library that was built with libasan).

The only *workaround* I've found was to run patchelf on the Python binary and add fake dependency on libstdc++ (after libasan.so)

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.