https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85471

            Bug ID: 85471
           Summary: closing a "thread" in "C++" using "pthread_exit(NULL)"
                    creates a "SIGABRT"
           Product: gcc
           Version: 7.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: aotto1...@t-online.de
  Target Milestone: ---
              Host: openSUSE 42.3 (x86_64)
            Target: openSUSE 42.3 (x86_64)
             Build: openSUSE 42.3 (x86_64)

the c++ compiler I use:

g++-7 (SUSE Linux) 7.3.1 20180307 [gcc-7-branch revision 258314]
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.


Problem
=======

In one of my TEST-Cases… written for my own server-software… I close a
(worker)-thread using the following code…

> pthread_exit(NULL);

in "C" this works fine… in "c++" I get the error from below… covered with
"valgrind"…

question: why I get this error in "system" code ????

==55315==
==55315== Process terminating with default action of signal 6 (SIGABRT)
==55315==    at 0x58E7F67: raise (raise.c:55)
==55315==    by 0x58E9339: abort (abort.c:78)
==55315==    by 0x413FED: _Unwind_SetGR (unwind-dw2.c:273)
==55315==    by 0x40763C: __gxx_personality_v0 (eh_personality.cc:712)
==55315==    by 0x5FF04A4: _Unwind_ForcedUnwind_Phase2 (unwind.inc:175)
==55315==    by 0x5FF0A64: _Unwind_ForcedUnwind (unwind.inc:207)
==55315==    by 0x56A598F: __pthread_unwind (unwind.c:126)
==55315==    by 0x569F8B4: __do_cancel (pthreadP.h:283)
==55315==    by 0x569F8B4: pthread_exit (pthread_exit.c:28)
==55315==    by 0x4E6AB00: libmsgque::SysExit(int, int) (sys.cc:935)
==55315==    by 0x4E64E8C: libmsgque::MqSysExit(int, int) (msgque.h:5671)
==55315==    by 0x4E65B05: libmsgque::MqExitP(libmsgque::MqS*, char const*,
char const*) (msgque.cc:417)
==55315==    by 0x404917: ccmsgque::MqC::Exit() (ccmsgque.h:409)
==55315==
==55315== HEAP SUMMARY:
==55315==     in use at exit: 101,380 bytes in 63 blocks
==55315==   total heap usage: 401 allocs, 338 frees, 493,733 bytes allocated
==55315==
==55315== LEAK SUMMARY:
==55315==    definitely lost: 0 bytes in 0 blocks
==55315==    indirectly lost: 0 bytes in 0 blocks
==55315==      possibly lost: 320 bytes in 1 blocks
==55315==    still reachable: 101,060 bytes in 62 blocks
==55315==         suppressed: 0 bytes in 0 blocks
==55315== Rerun with --leak-check=full to see details of leaked memory
==55315==
==55315== For counts of detected and suppressed errors, rerun with: -v
==55315== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Abgebrochen (Speicherabzug geschrieben)

Reply via email to