[PATCH] Re: Segmentation fault without further info

Dirk Hohndel dirk at hohndel.org
Tue Mar 15 07:44:10 PDT 2016


> On Mar 15, 2016, at 7:33 AM, Robert Helling <helling at atdotde.de> wrote:
> 
> pars,
> 
>> On 15.03.2016, at 14:52, pars <parsantos at gmail.com <mailto:parsantos at gmail.com>> wrote:
>> 
>> I think I found what can be causing it, though. If I select a dive with photos, and I let the thread responsible for loading the images finish, everything is ok (even though the photos themselves are not loaded). If I don't let the thread finish, and select another dive with photos, then subsurface crashes.
>> There must be some sort of race condition between the threads, which causes the "picture" variable to be updated simultaneously by both threads, and causes a crash.
> 
> 
> indeed, you are right. When you change dives, the memory that picture points to gets freed and then writing to it leads to memory corruption.
> 
> This turns out to be more complicated to fix. I have to look into how to make the live time long enough for the thread to complete. But in order to do this, I have to understand once more the slightly complicated call sequence that the struct picture is handed along.
> 
> This might take a bit longer.

Yeah, our beloved picture loading... you were going to rewrite that anyway, right? :-/

Does this happen in 4.5.3 as well or is this something that got broken more recently in master?
Since I'm hoping to get out 4.5.4 this week it would be nice to fix this if the bug was in 4.5.3 already.

/D

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20160315/75a45caa/attachment.html>


More information about the subsurface mailing list