https://bugs.kde.org/show_bug.cgi?id=469606
            Bug ID: 469606
           Summary: valgrind crashed when compile with c++ stand 17
    Classification: Developer tools
           Product: valgrind
           Version: 3.16.1
          Platform: RedHat Enterprise Linux
                OS: Unspecified
            Status: REPORTED
          Severity: crash
          Priority: NOR
         Component: massif
          Assignee: n...@valgrind.org
          Reporter: lvwanzhu2...@gmail.com
  Target Milestone: ---

SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug
symbols.
See
https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1.  compile project with flag "-std=c++17"
2.  run application with valgrind massif tool

OBSERVED RESULT
valgrind/massif crashed with below error:
==16638== Massif, a heap profiler
==16638== Copyright (C) 2003-2017, and GNU GPL'd, by Nicholas Nethercote
==16638== Using Valgrind-3.16.1 and LibVEX; rerun with -h for copyright info
==16638== Command:
/build/os/sys-root/x86_64-pc-linux-gnu/lib64/ld-linux-x86-64.so.2
--library-path /build/os/sys-root/x86_64-pc-linux-gnu/lib64 myapp
==16638==
Starting main...
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
==16638==
==16638== Process terminating with default action of signal 6 (SIGABRT):
dumping core
==16638==    at 0x5A3A610: raise (raise.c:50)
==16638==    by 0x5A24525: abort (abort.c:79)
==16638==    by 0x576D80B: ??? (in
/build/os/sys-root/x86_64-pc-linux-gnu/usr/lib64/libstdc++.so.6.0.28)
==16638==    by 0x57788F5: ??? (in
/build/os/sys-root/x86_64-pc-linux-gnu/usr/lib64/libstdc++.so.6.0.28)
==16638==    by 0x5778960: std::terminate() (in
/build/os/sys-root/x86_64-pc-linux-gnu/usr/lib64/libstdc++.so.6.0.28)
==16638==    by 0x5778BF3: __cxa_throw (in
/build/os/sys-root/x86_64-pc-linux-gnu/usr/lib64/libstdc++.so.6.0.28)
==16638==    by 0x576D4C7: ??? (in
/build/os/sys-root/x86_64-pc-linux-gnu/usr/lib64/libstdc++.so.6.0.28)
==16638==    by 0xD63ECE: allocate (new_allocator.h:112)
==16638==    by 0xD63ECE:
freelist_stack<std::allocator<boost::lockfree::queue<std::function<void(int)>*>::node>
> (freelist.hpp:61)
==16638==    by 0xD63ECE: boost::lockfree::queue<std::function<void
(int)>*>::queue(unsigned long) (queue.hpp:217)


code example:

TaskPool::TaskPool()
    : tasksQueue_(100)
{
}

mutable boost::lockfree::queue<std::function<void(int id)>* > tasksQueue_;

EXPECTED RESULT
no crash

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma:  
N.el7.x86_64 #2 SMP Mon Nov 30 18:39:13 EET 2020 x86_64 x86_64 x86_64 GNU/Linux
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
If I compile project with flag "-std=c++14", valgrind works correctly.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to