Re: archiving: Non-aligned pointer being freed
Re: archiving: Non-aligned pointer being freed
- Subject: Re: archiving: Non-aligned pointer being freed
- From: Clark Cox <email@hidden>
- Date: Mon, 5 Apr 2004 09:35:32 -0400
On Apr 05, 2004, at 00:10, Marius Kintel wrote:
>
When running the minimal foundation tool below, I get the following
>
error
>
message when unarchiving:
>
*** malloc[23918]: error for object 0x300999: Non-aligned pointer
>
being freed
>
>
This seems to happen if I use an NSValue as a value object for a
>
dictionary
>
entry. Any other object I've tried works perfectly.
>
>
I've tried the following but without any effect:
>
o Use different ways of creating an NSValue
>
o Archive to file instead of NSData
>
o Turn off ZeroLink, Fix&Cont., predictive compilation
>
>
Does anyone have any idea why this happens and if I should worry about
>
it?
I'd recommend filing a bug on this. I can't see anything wrong with
your code (except that you never release your dictionary, but that is
largely irrelevant).
>
#import <Foundation/Foundation.h>
>
>
int main (int argc, const char * argv[])
>
{
>
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
>
>
NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
>
int val = 123;
>
NSValue *nsval = [NSValue value:&val withObjCType:@encode(int)];
>
[dict setObject:nsval forKey:@"test"];
>
NSData *data = [NSKeyedArchiver archivedDataWithRootObject:dict];
>
[NSKeyedUnarchiver unarchiveObjectWithData:data];
>
>
[pool release];
>
return 0;
>
}
--
Clark S. Cox III
email@hidden
http://homepage.mac.com/clarkcox3/
http://homepage.mac.com/clarkcox3/blog/B1196589870/index.html
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.