--- Begin Message ---
Subject: |
Anyone else having heavy problems with NSInvocation? |
Date: |
Wed, 27 Nov 2002 11:20:37 +0100 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.1) Gecko/20020826 |
Hi...
As some might now I am running gnustep on Windows (mingw32)...
I ran it a long time with GSFrameInvocation as concrete class.
Everything was fine.
(NSInvocation is heavily in use). But then came XP and here it is
(sometimes)
- not always, but much too often - crashing when invoking a NSInvocation.
Presumably a __builtin_apply() problem of gcc (I have to run 2.95.3)???
So I switched to ffcall. The random crashes disappeared, but for some
reason when using structs as arguments it crashes now reproducably and
everytime on
all windows platforms (tested NT4,W2k,XP).
I try to invoke eg. a method like this.
- (void)methodWithRange:(NSRange)aRange andObject:(NSString *)string
andRange:(NSRange)secondRange
The method is invoked with rubbish as arguments and when then acessing
eg. the string
it crashes. Rubbish in rubbish out.... So I tried to debug it.
When peeking out the invocations arguments before invoking it it appears
that
everything is trashed right here. See the attached output of my little
NSInvocation dumper.
(It hooks in as category to NSInvocation -invoke and dumps right before
invoking).
Arguments should be:
aRange={location=4,length=1} aString(id:0x0D4285D0)="hello"
secondRange={location=4,length=0}
(the dumper shows the correct results when using GSFrameInvocation)
NSInvocation: aClass methodWithRange:andObject:andRange: with
GSFFCallInvocation
Returntype=void
5 (retained) Arguments to invocation:
complete ArgumentString: @0:4{?=II}8@16{?=II}20
arg0: offset = 0
arg0: type = @ (object)
arg0: typeDescription = ID:0x0B3C4268 Class:aClass description:<aClass:
b3c4268>
arg0: size = 4
arg0: align = 4
arg0: qual = 0
arg0: isReg = 0
===================
arg1: offset = 4
arg1: type = : (selector)
arg1: typeDescription = methodWithRange:andObject:andRange:
arg1: size = 4
arg1: align = 4
arg1: qual = 0
arg1: isReg = 0
===================
arg2: offset = 8
arg2: type = { (struct)
arg2: typeDescription = struct-layout:
element0: offset:0 alignment:4 type:I (uint) descr:2005416376
element1: offset:4 alignment:4 type:I (uint) descr:1
arg2: size = 8
arg2: align = 16
arg2: qual = 0
arg2: isReg = 0
===================
arg3: offset = 16
arg3: type = @ (object)
arg3: typeDescription = ID:0x00000004 Class:null description:null
arg3: size = 4
arg3: align = 4
arg3: qual = 0
arg3: isReg = 0
===================
arg4: offset = 20
arg4: type = { (struct)
arg4: typeDescription = struct-layout:
element0: offset:0 alignment:4 type:I (uint) descr:0
element1: offset:4 alignment:4 type:I (uint) descr:229240664
arg4: size = 8
arg4: align = 16
arg4: qual = 0
arg4: isReg = 0
===================
before invoke...
* imagine a fine crash here when the called method tries to access the
object *
Using GSFrameInvocation everything is fine here (and in the invoked
method) but it
crashes elsewhere (with other invocations) on XP by then.
Also when using only objects as parameters everything appears to be fine
with
GSFFCallInvocation. But when using structs it goes crash.
So it appears when using GSFFCallInvocation that creating the callframe
for avcall in
gs_objc_msg_forward() in GSFFCallInvocation.m fails when structs are
there as
arguments. But I can't find a bug here.
Are compiler options here of any influence?
-fno-omit-frame-pointer vs -fomit-frame-pointer
I tried compiling gnustep with both. -fno-omit-frame-pointer seems to
present (sometimes)
partitially correct arguments...
Any help is appreciated... And thanks for your answers in advance.
(Maybe someone has a solution for the GSFrameInvocation problem on XP?)
Roland
--- End Message ---