| Summary: | pthread_cancel inside exception handler and cancel point called from C++ code unexpected behavior | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | Paulo Andrade <pandrade> | ||||
| Component: | gcc | Assignee: | Marek Polacek <mpolacek> | ||||
| gcc sub component: | gcc-toolset-10 | QA Contact: | Alexandra Petlanová Hájková <ahajkova> | ||||
| Status: | CLOSED UPSTREAM | Docs Contact: | |||||
| Severity: | medium | ||||||
| Priority: | medium | CC: | ahajkova, cww, dbasant, fweimer, jakub, jwakely, mnewsome, mpolacek, ohudlick, pbhoot, sipoyare, vmukhame | ||||
| Version: | 8.2 | Keywords: | Triaged | ||||
| Target Milestone: | rc | ||||||
| Target Release: | 8.2 | ||||||
| Hardware: | All | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2021-04-06 18:41:17 UTC | Type: | Bug | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Bug Depends On: | |||||||
| Bug Blocks: | 1461138, 1477664 | ||||||
| Attachments: |
|
||||||
Wrong component. Simpler testcase, without STL, needs just libsupc++ and libpthread:
#include <pthread.h>
#include <unistd.h>
namespace __cxxabiv1
{
class __forced_unwind
{
virtual ~__forced_unwind() throw();
virtual void __pure_dummy() = 0;
};
}
int a;
extern "C" void *
fun (void *)
{
try
{
throw 1;
}
catch (int &)
{
try
{
char buf[10];
for (;;)
read (4, buf, 0);
}
catch (__cxxabiv1::__forced_unwind &)
{
a = 5;
throw;
}
}
return NULL;
}
int
main ()
{
pthread_t thread;
pthread_create (&thread, NULL, fun, NULL);
pthread_cancel (thread);
pthread_join (thread, NULL);
}
All GCC versions affected. Hello Can we get a update on likelyhood of this getting fixed in RHEL-6? This BZ depends on the upstream bug being fixed. There hasn't been any progress, so I'm closing this BZ in favor of the upstream bug. |
Created attachment 1197277 [details] thread.cxx In the attached test case, if flush is called, it will fail with the message: terminate called after throwing an instance of 'std::runtime_error' The test case fails because of 'endl'. Other kinds of cancellation points work as expected.