[llvm-bugs] [Bug 28401] New: cfl-aa with -O1 segfaults binary

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Jul 2 15:06:16 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=28401

            Bug ID: 28401
           Summary: cfl-aa with -O1 segfaults binary
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: matthias.krueger at famsik.de
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 16683
  --> https://llvm.org/bugs/attachment.cgi?id=16683&action=edit
code snippet

This original code I found this bug with is
https://github.com/danmar/cppcheck/blob/e795eef4651ea3db8b60498da2e3608bf5b44aeb/tools/dmake.cpp

I tried to reduce this (code attached).

llvm was at bafbf2b643f118fd2ea402ed6cd204281c7e9e94
clang was at 0cf7afc057e83969413f10f3817eb107ac8a0933
(using the github llvm-mirror repos)

I compiled with
clang++  -std=c++0x  -mllvm -use-cfl-aa -mllvm -use-cfl-aa-in-codegen -O1   -o
crash code.cpp
which will cause the binary to crash.
Omitting -O1 will prevent the crash.

A debug build
clang++  -std=c++0x  -mllvm -use-cfl-aa -mllvm -use-cfl-aa-in-codegen
-fsanitize=address -g3  -O1   -o crash code.cpp 
revealed this trace:

ASAN:DEADLYSIGNAL
=================================================================
==12120==ERROR: AddressSanitizer: SEGV on unknown address 0x000077000001 (pc
0x7f7ec82d05b3 bp 0x7ffd8fd55fe0 sp 0x7ffd8fd55e78 T0)
==12120==The signal is caused by a READ memory access.
    #0 0x7f7ec82d05b2 in std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> >::~basic_string()
(/lib64/libstdc++.so.6+0x1235b2)
    #1 0x4e95af in void
std::_Destroy_aux<false>::__destroy<std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char>
>*>(std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> >*)
/usr/lib/gcc/x86_64-redhat-linux/6.1.1/../../../../include/c++/6.1.1/bits/stl_construct.h:103:6
    #2 0x4e91d8 in std::vector<std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> >,
std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> > > >::~vector()
/usr/lib/gcc/x86_64-redhat-linux/6.1.1/../../../../include/c++/6.1.1/bits/stl_vector.h:426:9
    #3 0x4e909e in main /tmp/code.cpp:11:1
    #4 0x7f7ec72c2730 in __libc_start_main (/lib64/libc.so.6+0x20730)
    #5 0x41a828 in _start (/tmp/crash+0x41a828)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/lib64/libstdc++.so.6+0x1235b2) in
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>
>::~basic_string()
==12120==ABORTING


I'm using a fedora 24 system with glibc 2.23.1-8.fc24 and gcc 6.1.1-3.fc24

Kind regards
Matthias Krüger

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160702/c88a4e99/attachment.html>


More information about the llvm-bugs mailing list