bug-gnustep
[Top][All Lists]
Advanced

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

Re: bug in NSPortCoder


From: Richard Frith-Macdonald
Subject: Re: bug in NSPortCoder
Date: Fri, 11 Apr 2003 17:06:45 +0100


On Friday, April 11, 2003, at 03:50  pm, Enrico Sersale wrote:


With the last cvs DO doesn't work anymore.
I'm not able to find exactly where the bug is but it must be in
NSPortCoder.m because changing only this file with a copy taken from the
yesterday cvs all is working again.
I don't know if this can help, but, in the ChangeLog there is:

* Headers/gnustep/base/NSPortCoder.h: Add array for pointers

but NSPortCoder.h is identical to the old one.

I've fixed that ... I inadvertently committed incorrect versions of NSPortCoder.[hm], noticed and reverted them, but forgot to fix the ChangeLog. I've corrected the
ChangeLog entry now.

This is the output of nsconnection_client in Testing:

<snip>

ot (Ny String 3)
Small Struct:
  sending ptr to c got 3b
Struct:
Segmentation fault (core dumped)

Well ... I've been doing quite a bit on this, to do with field alignment in structures. In gcc-3 __alignof__ has been changed so that it no longer returns the alignment used to build structures. In particular, on intel it now returns 8 rather than 4 for
the alignment of a double (but still uses 4 to lay out its structures).

Someone added some functions to libobjc (quite a long time ago) to work out alignments, and I've modified the base library archiving code to use this stuff.

I modified the nsconnection tests to pass a structure which would demonstrate
this alignment problem.

While I was looking at this I found a bug in handling pointers to structures, which could cause memory to be scribbled on, and fixing that exposed another obscure memory management problem when returning a c-string as both an argument and
the return value of the same DO method.

All that should be pretty much ok.





reply via email to

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