> On Mar 15, 2016, at 7:33 AM, Robert Helling <[email protected]> wrote: > > pars, > >> On 15.03.2016, at 14:52, pars <[email protected] >> <mailto:[email protected]>> 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
_______________________________________________ subsurface mailing list [email protected] http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
