public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "stefan at bytereef dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libgcc/98390] New: AIX: exceptions in threads: IOT/Abort trap(coredump)
Date: Sat, 19 Dec 2020 10:11:32 +0000	[thread overview]
Message-ID: <bug-98390-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 98390
           Summary: AIX: exceptions in threads: IOT/Abort trap(coredump)
           Product: gcc
           Version: 10.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgcc
          Assignee: unassigned at gcc dot gnu.org
          Reporter: stefan at bytereef dot org
  Target Milestone: ---

The following test case is extracted from a larger program. When repeated
often enough, it terminates with: IOT/Abort trap(coredump)

Confirmed with g++ (GCC) 7.2.0 and g++ (GCC) 10.2.0 on gcc119.fsffrance.org.


test.cc:
========================================================================
#include <stdexcept>
#include <thread>
#include <vector>


class suntime_error : public std::runtime_error {
  using std::runtime_error::runtime_error;
};

static void
doit()
{
    try {
        throw suntime_error("this is an error");
    }
    catch (const suntime_error& err) {
        (void)err;
    }
}

static void
do_threads()
{
    const size_t n = 100;
    std::vector<std::thread> t(n);

    for (size_t k = 0; k < n; k++) {
        t[k] = std::thread(doit);
    }

    for (size_t k = 0; k < n; k++) {
        t[k].join();
    }
}

int
main()
{
    do_threads();
    return 0;
}
========================================================================


doit.sh:
========================================================================
#!/bin/sh

while ./test; do
    :
done
========================================================================



$ g++ -pthread -Wall -Wextra -std=gnu++11 -pedantic -O0 -g -o test test.cc

$ ./doit.sh
./doit.sh[3]: 14484092 IOT/Abort trap(coredump)

$ gdb ./test core
[...]
Program terminated with signal SIGABRT, Aborted.
#0  0xd058f3ec in pthread_kill () from /usr/lib/libpthreads.a(shr_xpg5.o)
(gdb) bt
#0  0xd058f3ec in pthread_kill () from /usr/lib/libpthreads.a(shr_xpg5.o)
#1  0xd058e7cc in _p_raise () from /usr/lib/libpthreads.a(shr_xpg5.o)
#2  0xd0123608 in raise () from /usr/lib/libc.a(shr.o)
#3  0xd0189ebc in abort () from /usr/lib/libc.a(shr.o)
#4  0xd08741a4 in uw_init_context_1 () from
/opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/7.2.0/pthread/libgcc_s.a(shr.o)
#5  0xd0874e50 in _Unwind_RaiseException () from
/opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/7.2.0/pthread/libgcc_s.a(shr.o)
#6  0xd17cd2cc in __cxa_throw () from
/opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/7.2.0/pthread/libstdc++.a(libstdc++.so.6)
#7  0x100006dc in doit () at test.cc:14
#8  0x100021fc in void std::__invoke_impl<void, void
(*)()>(std::__invoke_other, void (*&&)()) (__f=<incomplete type>)
#9  0x100020c4 in std::__invoke_result<void (*)()>::type std::__invoke<void
(*)()>(void (*&&)()) (__fn=<incomplete type>)
#10 0x10002cd4 in decltype (__invoke((_S_declval<0ul>)()))
std::thread::_Invoker<std::tuple<void (*)()>
>::_M_invoke<0ul>(std::_Index_tuple<0ul>) (this=<incomplete type>)
#11 0x10002c2c in std::thread::_Invoker<std::tuple<void (*)()> >::operator()
(this=<incomplete type>)
#12 0x10002b8c in
std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (*)()> >
>::_M_run (this=<incomplete type>)
#13 0xd18964d8 in execute_native_thread_routine () from
/opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/7.2.0/pthread/libstdc++.a(libstdc++.so.6)
#14 0xd0572f68 in _pthread_body () from /usr/lib/libpthreads.a(shr_xpg5.o)
#15 0x00000000 in ?? ()

             reply	other threads:[~2020-12-19 10:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-19 10:11 stefan at bytereef dot org [this message]
2024-01-02 15:24 ` [Bug target/98390] " stefan at bytereef dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-98390-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).