[patch PR libstdc++/51135]: Fix [4.7 Regression] SIGSEGV during exception cleanup on win32

Kai Tietz ktietz70@googlemail.com
Mon Dec 12 15:28:00 GMT 2011


2011/12/12 Paolo Carlini <paolo.carlini@oracle.com>:
> Hi,
>
>> On Mon, 12 Dec 2011, Kai Tietz wrote:
>>
>>> Index: gcc/libstdc++-v3/libsupc++/cxxabi.h
>>> ===================================================================
>>> --- gcc.orig/libstdc++-v3/libsupc++/cxxabi.h
>>> +++ gcc/libstdc++-v3/libsupc++/cxxabi.h
>>> @@ -51,6 +51,10 @@
>>> #include <bits/cxxabi_tweaks.h>
>>> #include <bits/cxxabi_forced.h>
>>>
>>> +#ifndef _GLIBCXX_USE_THISCALL_ON_DTOR
>>> +typedef void (*__cxa_dtor_type) (void *);
>>> +#endif
>>> +
>>
>>
>> This changes the type from a function with "C" linkage to one with "C++"
>> linkage, is that on purpose?
>
> Humm, thanks, I didn't really spend time on what was going on *below* the
> define, only to the right way to implement the mingw specific bits. I guess
> moving the #ifndef a few lines down, close to the other typedef should be
> the safe thing to do. That also requires adjustment in the config files, the
> typedef there must be also wrapped in #ifdef __cplusplus, etc.
>
> Please do the Change Kai.

Ok.  By looking at this, it might be better to use here a define - as
you mentioned.  As I would need to copy here namespace too.

>> There is a type __cxa_cdtor_type a couple lines below, which also seems
>> used for destructors, but that one doesn't get __thiscall, that's confusing
>> (but then there's probably a reason why it wasn't used in __cxa_throw).
>
> No idea if it's right for mingw.

Well, not sure too.  Logically, if those function in cdtor list
(handled in vec.cc) are constructors/destructors, then it would
require thiscall for IA-32 mingw, too. By tests I see that those
function stored within that list have cdecl-calling convention.
Therefore I didn't touched them by this patch.

Kai

Kai



More information about the Gcc-patches mailing list