tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] crash when function that is called from tcc compiled


From: Tigran Grigoryan
Subject: Re: [Tinycc-devel] crash when function that is called from tcc compiled dynamic library, throws exception
Date: Wed, 16 Sep 2015 06:01:27 +0000 (UTC)

Thank you for your explanation.
Seems that the issue is that tcc generated binaries lack ".eh_frame", ".eh_frame_hdr" sections.


Thanks,
Tigran



On Tuesday, September 15, 2015 3:21 PM, Jacek Wielemborek <address@hidden> wrote:


W dniu 15.09.2015 o 11:38, Stephan Beal pisze:
> On Tue, Sep 15, 2015 at 11:25 AM, Tigran Grigoryan <
> address@hidden> wrote:
>
>> When linux shared object (compiled with tcc) calls some c++ function, that
>> throws exception, application crashes.
>> Seems that std::terminate is called from __cxa_throw ().
>>
>> Is this something expected? (if  "so" is compiled with llvm or gcc C
>> compiler it works ok)
>>
>
> Behaviour of a C app which allows a C++ exception to propagate through it
> is UNDEFINED. So, yes, what you're seeing is, in a sense, expected.
>
> C code has no way of handling an exception, and a C++ app which does not
> catch an exception crashes.

A crash isn't good behavior anyway. There's the risk that it's a memory
error leading to a security vulnerability - and compiling source code
can be a real attack vector.

_______________________________________________
Tinycc-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/tinycc-devel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]