Re: Serious GORM bug

2014-01-05 Thread Fred Kiefer
On 04.01.2014 12:45, Jamie Ramone wrote:
> On Sat, Jan 4, 2014 at 7:59 AM, Fred Kiefer  wrote:
>> Am 04.01.2014 um 00:17 schrieb Jamie Ramone :
>>
>> Well $hit! I ran on a VM with Ubuntu 13.10...same problem:
>>
>> Starting program: /SystemApps/Gorm.app/Gorm
>> [Thread debugging using libthread_db enabled]
>> Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
>> 2014-01-03 20:09:11.042 Gorm[6849] QueryTree window is 25186477 (root 373
>> cwin root 373)
>> 2014-01-03 20:09:11.102 Gorm[6849] QueryTree window is 25186476 (root 373
>> cwin root 373)
>> 2014-01-03 20:09:11.573 Gorm[6849] QueryTree window is 25186511 (root 373
>> cwin root 373)
>> 2014-01-03 20:09:11.574 Gorm[6849] QueryTree window is 25186510 (root 373
>> cwin root 373)
>>
>>
>> Could you please explain where these messages come from? Are you using
>> unaltered GNUstep code, or if you have changes would you mind telling us
>> about them? This looks a bit like the debugging code I used in the backend
>> to track down the other Gorm bug, which actually turned out to be a Gorm
>> bug.
>> If you want to see more information on what is happening inside of the
>> running Gorm application start it with parameters such as
>> "--GNU-Debug=dflt",  "--GNU-Debug=NSEvent" or  "--GNU-Debug=NSDragging"
>> (typed from memory, better check the correct names in the source code).
>>
> 
> To my knowledge, it's unaltered. I didn't touch any line of Gorm's code,
> just downloaded and compiled it. OK, I'll try those.

I am back at my computer and found the source of this message. You have
a window manager that uses double parent windows and there we had a left
over NSLog call. I turned that into NSDebugLLog.

Sadly this wont help with your real issue.

Fred

___
Gnustep-dev mailing list
Gnustep-dev@gnu.org
https://lists.gnu.org/mailman/listinfo/gnustep-dev


Re: libobjc2 objc_setassociatedobject issue

2014-01-05 Thread Doug Warren
As a hopeful final follow-up to this.  I opened a bug
https://savannah.gnu.org/bugs/index.php?4 with a GNUstep style failing
test that I verified fails on 1.24.6 on Ubuntu along with the fix I
mentioned above.  Hopefully it'll be integrated or someone else will be
inspired by a failing test to fix it.


On Tue, Dec 17, 2013 at 2:12 AM, David Chisnall  wrote:

> The new version still looks more complex than the equivalent (correct)
> code in libobjc2.
>
> David
>
> On 16 Dec 2013, at 23:49, Doug Warren  wrote:
>
> > Looks like it was this optimization:
> >   /* C++ destructors must be called in the opposite order to their
> >* creators, so start at the leaf class and then go up the tree until
> we
> >* get to the root class.  As a small optimisation, we don't bother
> >* visiting any classes that don't have an implementation of this
> method
> >* (including one inherited from a superclass).
> >*
> >* Care must be taken not to call inherited .cxx_destruct methods.
> >*/
> >   while (class_respondsToSelector(destructorClass, cxx_destruct))
> > {
> >   IMP newDestructor;
> >
> >   newDestructor
> >   = class_getMethodImplementation(destructorClass, cxx_destruct);
> >   destructorClass = class_getSuperclass(destructorClass);
> >
> >   if (newDestructor != destructor)
> > {
> > newDestructor(self, cxx_destruct);
> > destructor = newDestructor;
> >   }
> > }
> >
> > I replaced it with:
> >   while (destructorClass)
> >   {
> >   if (class_respondsToSelector(destructorClass,
> cxx_destruct))
> >   {
> >   IMP newDestructor =
> class_getMethodImplementation(destructorClass, cxx_destruct);
> >   destructorClass =
> class_getSuperclass(destructorClass);
> >
> >   if (newDestructor != destructor)
> >   {
> >   newDestructor(self, cxx_destruct);
> >   destructor = newDestructor;
> >   }
> >   }
> >   else
> >   {
> >   destructorClass =
> class_getSuperclass(destructorClass);
> >   }
> >   }
> >
> > And it works for my test cases though I haven't checked if there was a
> performance penalty or not.
> >
> >
> > On Mon, Dec 16, 2013 at 11:30 AM, David Chisnall 
> wrote:
> > This sounds like a bug in GNUstep base's object deallocation then.  If
> .cxx_dealloc isn't called then ObjC++ won't work correctly either.
> >
> > David
> >
> > On 16 Dec 2013, at 19:24, Doug Warren  wrote:
> >
> > > Followup to this,
> > >
> > > cleanupReferenceList() is never being called, I see the hidden class
> created and the .cxx_destruct registered but it isn't invoked.  The problem
> is that I don't see how object_dispose() get's called.  In the libobjc2
> Test it's called in dealloc which would explain why the libobjc2 Test
> works, but I don't see it invoked in gnustep-base anywhere.  Or for that
> matter anywhere in anyone's trunk other than libobjc2's Test.h and
> RuntimeTest.m.
> > >
> > >
> > > On Fri, Dec 13, 2013 at 1:30 PM, Doug Warren 
> wrote:
> > > Works without objc_setAssociatedObject:
> > > E/Z2GameLog(14278): STDOUT: [--] 1 test from
> objc_setAssociatedObject
> > > E/Z2GameLog(14278): STDOUT: [ RUN  ]
> objc_setAssociatedObject.AssociatedObjectsAreReleased
> > > E/Z2GameLog(14278): STDOUT: [   OK ]
> objc_setAssociatedObject.AssociatedObjectsAreReleased (1 ms)
> > > E/Z2GameLog(14278): STDOUT: [--] 1 test from
> objc_setAssociatedObject (1 ms total)
> > >
> > > Code change:
> > > @autoreleasepool {
> > > associatedObjectTestAllocatedObject* object =
> [associatedObjectTestAllocatedObject new];
> > >
> > > associatedObjectTestAssociatedObject *info =
> [[associatedObjectTestAssociatedObject new] autorelease];
> > > // silence -Wunused-variable
> > > [info description];
> > > //objc_setAssociatedObject(object,
> &objc_setAssociatedObjectKey, info, OBJC_ASSOCIATION_RETAIN);
> > >
> > > [object release];
> > > }
> > >
> > > The reason why I had suggested that was your original post that
> NSString wouldn't be an appropriate target, got me thinking that perhaps
> there was an optimization at some point made in the runtime to NSObject
> that would similarly cause it to not work.
> > >
> > >
> > > On Fri, Dec 13, 2013 at 11:43 AM, David Chisnall 
> wrote:
> > > This test case looks like it should pass irrespective of whether the
> runtime does the right thing.  Since you're using
> associatedObjectTestAssociatedObject for both objects, deallocating the
> original autoreleased one ought to set associatedObjectDeallocCalled.  Can
> you confirm whether this test fails for you on GNUstep with the
> objc_setAssociatedObject() call removed?
> > >
> > > David
> > >
> > > On 13 Dec 2013, at 18:27, Doug Warren  wrote:
> 

int vs. void pointer

2014-01-05 Thread Riccardo Mottola

Hi,

in reference to:
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/Source/GSDisplayServer.m?r1=37026&r2=37533

is it correct to get an int and return it as a void* ? I get a warning 
there.
I suppose int goes to void, not a pointer. perhaps the method shold 
accept a void* as a win?


Riccardo

___
Gnustep-dev mailing list
Gnustep-dev@gnu.org
https://lists.gnu.org/mailman/listinfo/gnustep-dev


Re: int vs. void pointer

2014-01-05 Thread Stefan Bidi
I don't know of any platform where an int is larger than a pointer, so I
think it is safe to do this. You should cast it to into first and the
warning will disappear: return (int)win.
On Jan 5, 2014 2:45 PM, "Riccardo Mottola"  wrote:

> Hi,
>
> in reference to:
> http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/Source/
> GSDisplayServer.m?r1=37026&r2=37533
>
> is it correct to get an int and return it as a void* ? I get a warning
> there.
> I suppose int goes to void, not a pointer. perhaps the method shold accept
> a void* as a win?
>
> Riccardo
>
> ___
> Gnustep-dev mailing list
> Gnustep-dev@gnu.org
> https://lists.gnu.org/mailman/listinfo/gnustep-dev
>
___
Gnustep-dev mailing list
Gnustep-dev@gnu.org
https://lists.gnu.org/mailman/listinfo/gnustep-dev


Re: int vs. void pointer

2014-01-05 Thread Niels Grewe

Am 05.01.2014 um 20:45 schrieb Riccardo Mottola :

> Hi,
> 
> in reference to:
> http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/Source/GSDisplayServer.m?r1=37026&r2=37533
> 
> is it correct to get an int and return it as a void* ? I get a warning there.
> I suppose int goes to void, not a pointer. perhaps the method shold accept a 
> void* as a win?

Fred already mentioned to me that I probably missed something when I added that 
method, I think I’ll be rolling it back soon.

Cheers,

Niels
___
Gnustep-dev mailing list
Gnustep-dev@gnu.org
https://lists.gnu.org/mailman/listinfo/gnustep-dev