discuss-gnustep
[Top][All Lists]
Advanced

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

NSHashTable with weak objects crashing


From: Frederik Seiffert
Subject: NSHashTable with weak objects crashing
Date: Mon, 29 Jul 2019 16:38:59 +0200

Hi,

I’m trying to use an NSHashTable with weak objects (-weakObjectsHashTable) on Android, but it’s segfaulting in addObject: on all architectures (ARM/x86). Does anyone know if this should be supported or what might be going on here?

Following is the backtrace:

    frame #5: 0xca4e2b12 libobjc.so`objc_msgSend at objc_msgSend.x86-32.S:120
    frame #6: 0xc9befbcd libgnustep-base.so`hashObject(item=0xcacce5a0, size=0x00000000) at NSConcretePointerFunctions.m:126
    frame #7: 0xc9b02992 libgnustep-base.so`pointerFunctionsHash(PF=0xc7d2d210, item=0xcacce5a0) at NSConcretePointerFunctions.h:180
    frame #8: 0xc9aff7b6 libgnustep-base.so`GSIMapBucketForKey(map=0xc7d2d1e4, key=GSIMapKey @ 0xfff875b4) at GSIMap.h:410
    frame #9: 0xc9b02c03 libgnustep-base.so`GSIMapAddNodeToMap(map=0xc7d2d1e4, node=0xcacce590) at GSIMap.h:453
    frame #10: 0xc9afe964 libgnustep-base.so`GSIMapAddKey(map=0xc7d2d1e4, key=GSIMapKey @ 0xfff87644) at GSIMap.h:1118
    frame #11: 0xc9b0074f libgnustep-base.so`-[NSConcreteHashTable addObject:](self=0xc7d2d1e4, _cmd="C", anObject=0xcac9945c) at NSConcreteHashTable.m:863


Interestingly, when I use hashTableWithWeakObjects (NSPointerFunctionsZeroingWeakMemory, deprecated on Apple platforms) instead of weakObjectsHashTable (NSPointerFunctionsWeakMemory), addObject: works OK, but the pointer is not zero’d when the object is released.

Thanks!
Frederik


reply via email to

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