> On Fri, 13 Feb 2009 18:31:10 +0000 Lee Noar> wrote
>
> alan buckley wrote:
>> I rebuilt wesnoth again just before christmas
>> and have only just managed to get time to
>> analyse the latest crash.
>>
>> This occurs in the same place as the last one,
>> but I believe the details are different so John's
>> modification did do something.
>
> [snip]
 
[snip]
>>
>> _ZN9__gnu_cxx18__exchange_and_addEPVii
>>
>> Does anybody know what the problem could be and how to
>> fix it?
>
> Not quite no, but I can perhaps add a few more details. I'm fairly
> certain that terrain_label::clear() is calling the destructor of a
> std::string which in turn is calling __gnu_cxx::exchange_and_add(). The
> first argument to exchange_and_add should be a memory location, but here
> it is -4 which is what causes the seg fault. The second arg (-1) is
> correct (see libstdc++-v3/include/bits.basic_string.h
> basic_string::_M_dispose()).
 
I couldn't quite tell if terrain_label::clear ended up calling a string
destructor, but the terrain_label class itself does contain a string
so it would definiately be calling a string destructor.

>
> A quick google for the exchange_and_add function shows that seg faults
> can also occur on other platforms so it may not be specific to RISC OS
> (not that that is much comfort :-/)
>
> The crash doesn't appear to be related to exceptions, and although the
> source for exchange_and_add() refers to mutex locks, the code above
> doesn't use them. Perhaps it should, but IIRC, a thread swap only occurs
> when returning from OS code such as a SWI call, so this code shouldn't
> need to be made thread safe.
>
> I'll see if I can dig a bit deeper.
>
 
Thanks for looking into it,
Alan
 
_________________________________________________________________
Check out the new and improved services from Windows Live. Learn more! 
http://clk.atdmt.com/UKM/go/132630768/direct/01/
_______________________________________________
GCCSDK mailing list [email protected]
Bugzilla: http://www.riscos.info/bugzilla/index.cgi
List Info: http://www.riscos.info/mailman/listinfo/gcc
Main Page: http://www.riscos.info/index.php/GCCSDK

Reply via email to