discuss-gnustep
[Top][All Lists]
Advanced

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

Re: Please test pending bugfix release of base


From: Quentin Mathé
Subject: Re: Please test pending bugfix release of base
Date: Sat, 18 Jun 2011 20:42:49 +0200

Le 18 juin 2011 à 18:03, Richard Frith-Macdonald a écrit :

> On 18 Jun 2011, at 16:07, Quentin Mathé wrote:
> 
>> I found a bug with NS(Concrete)PointerFunctions, it looks a bit weird. So 
>> I'm not entirely sure it's a bug in GNUstep Base.
>> I'm using GNUstep Base from trunk (r33310), libobjc2 (the lastest revision) 
>> from trunk. Everything is compiled with Clang 2.9 on Ubuntu 10.4 x86 (32 
>> bits).
>> 
>> As visible with the test tool when run inside GDB, -initWithOptions: 
>> receives a completely corrupted arguments (including self), but returns a 
>> valid self, so the issue is not visible until much later (when 
>> pointerFunctionsXXX() are called).  
>> For example… If I create a NSMapTable initialized to accept raw pointers, 
>> when a raw pointer is inserted as an object, the wrong acquireFunction is 
>> called and a crash occurs.
>> 
>> At first sight, I also see no problems when invoking  methods other than 
>> -initWithOptions: on NS(Concrete)PointerFunctions. 
>> 
>> The test program is available in attachment, here is a debug session that 
>> shows how -initWithOptions: goes wrong:
>> 
>> [Thread debugging using libthread_db enabled]
>> [New Thread 0xb7fe0b70 (LWP 16396)]
>> 2011-06-18 16:32:23.318 pfunc-issue[16393]  ---> Alloc 
>> <NSConcretePointerFunctions: 0x80f4c50>
>> 2011-06-18 16:32:23.322 pfunc-issue[16393]  ---> Init 
>> <NSConcretePointerFunctions: 0x80f4c50>
>> 2011-06-18 16:32:23.322 pfunc-issue[16393]  ---> Alloc 
>> <NSConcretePointerFunctions: 0x80f4c50>
>> 
>> Breakpoint 1, -[NSConcretePointerFunctions initWithOptions:] (self=0x2, 
>> _cmd=0x804b310, 
>>   options=135220304) at NSConcretePointerFunctions.m:188
>> ^^^^^^^^^^^^^^^^^^^^^
>> 188  - (id) initWithOptions: (NSPointerFunctionsOptions)options
>> (gdb) bt
>> #0  -[NSConcretePointerFunctions initWithOptions:] (self=0x2, 
>> _cmd=0x804b310, 
>>   options=135220304) at NSConcretePointerFunctions.m:188
>> #1  0x08048ae6 in main (argc=1, argv=0xbffff4e4) at pfunc-issue.m:20
>> (gdb) c
>> Continuing.
>> 2011-06-18 16:32:39.863 pfunc-issue[16393]  ---> InitWithOptions: 
>> <NSConcretePointerFunctions: 0x80f4c50>
>> [Thread 0xb7fe0b70 (LWP 16396) exited]
>> 
>> Any idea?
> 
> 
> 1. Your test program is fine on my CentOS system using the standard 
> compiler/runtime.
> 2. The self=0x2 reported by gdb looks suspicions ... your test program uses 
> NSPointerFunctionsOpaqueMemory as the options, and the numeric value of that 
> constant is 2
> 
> So it *looks* like the compiler (or perhaps the runtime) might be passing the 
> arguments incorrectly... I don't see how a bug in base could cause the 
> arguments passed to the method to be wrong.

Indeed looks like a Clang bug… I just recompiled Base and the test tool with 
GCC 4.4.3, then the bug goes away.

Thanks,
Quentin.




reply via email to

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