[Top][All Lists]

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

Re: Mysterious crash in NSRunLoop, using libobjc2 on Linux

From: David Chisnall
Subject: Re: Mysterious crash in NSRunLoop, using libobjc2 on Linux
Date: Mon, 11 Dec 2017 17:54:14 +0000

> On 11 Dec 2017, at 17:09, Lobron, David <address@hidden> wrote:
>>>> Just use @try and @catch.  If you can find a smallish test case, please 
>>>> file a bug on GitHub and I’ll take a look.  Ideally, a test case shouldn’t 
>>>> depend on anything other than libobjc2 - take a look at the existing EH 
>>>> tests and see if you can make a similar one that shows the issue.
>>> I've been trying combinations of C++ and ObjC exceptions in a .mm file, and 
>>> so far I haven't been able to reproduce the abort behavior.  I've attached 
>>> my latest code, which throws ObjC and C++ exceptions from C++ and ObjC 
>>> classes, and catches them.  Please let me know if you can think of any 
>>> variations I haven't tried here.  
>> If the failure is what I suspect that it is, then it’s a problem caused by 
>> mixing C++ and Objective-C exception unwinding, so it won’t be possible to 
>> reproduce in a single file.  You will need to throw an exception from 
>> Objective-C++ and have it pass through stack frames from an Objective-C 
>> compilation unit that includes an @finally block that runs some code, and 
>> then be caught in an Objective-C++ compilation unit.  
> Ah, got it.  I will try this.  
> Would separate .o files linked into a single binary be sufficient for 
> counting as separate compilation units?

Yup, that’s fine.


reply via email to

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