[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bugs #8498] [MinGW] NSUnarchiver crashes
From: |
Gregory John Casamento |
Subject: |
Re: [bugs #8498] [MinGW] NSUnarchiver crashes |
Date: |
Fri, 9 Apr 2004 06:08:45 -0700 (PDT) |
All,
Initial tests indicate that this breaks .gorm loading for some reason. I need
to do further tests. I recommend not adding this patch until this problem has
been investigated and cleared.
GJC
--- Willem Rein Oudshoorn <noreply@savannah.gnu.org> wrote:
> This mail is an automated notification from the bugs tracker
> of the project: GNUstep.
>
> /**************************************************************************/
> [bugs #8498] Latest Modifications:
>
> Changes by:
> Willem Rein Oudshoorn <woudshoo@xs4all.nl>
> 'Date:
> Fri 04/09/04 at 10:29 (Europe/Amsterdam)
>
> ------------------ Additional Follow-up Comments ----------------------------
> The attached patch should fix this.
> It will retain the objects in the objMap and release them
> when clearing the map. But note that we really need
> to be carefull when retaining the objects, otherwise code like
>
> - initWithCoder:..
> {
> [self dealloc];
> return something_else;
> }
>
> will crash the unarchiver.
> This rules out the replacement of objMap with an
> NSArray.
>
> If nobody objects I will commit this shortly.
>
> Wim Oudshoorn.
>
>
>
>
>
>
>
>
> /**************************************************************************/
> [bugs #8498] Full Item Snapshot:
>
> URL: <http://savannah.gnu.org/bugs/?func=detailitem&item_id=8498>
> Project: GNUstep
> Submitted by: Willem Rein Oudshoorn
> On: Thu 04/08/04 at 09:45
>
> Category: Base/Foundation
> Severity: 3 - Ordinary
> Item Group: Bug
> Resolution: None
> Assigned to: wim
> Status: Open
>
>
> Summary: [MinGW] NSUnarchiver crashes
>
> Original Submission: It seems that if you call release on an decoded object
> that is shared with other objects lead to a crash.
>
> In particular:
>
> Obj1 ---> string
> Obj2 ----/
>
> and if in initWithCoder of Obj1 (and Obj2) we have:
>
> [coder decodeValuesOfObjCType: "@", &string];
> [string release];
>
> the decoding crashes.
> The funny thing is that this seems to be a windows
> specific problem. It works fine on Linux.
>
> The attached program will demonstrate the problem:
>
> ./TestCoder Encode test.enc
>
> this will create test.enc
>
> ./TestCoder Decode test.enc
>
> which decodes the created test.enc. This crashes
> on MinGW but not on Linux and the generated
> files test.enc are identical, so it is probably
> in de unarchiving code.
>
>
>
>
> Follow-up Comments
> ------------------
>
>
> -------------------------------------------------------
> Date: Fri 04/09/04 at 10:29 By: wim
> The attached patch should fix this.
> It will retain the objects in the objMap and release them
> when clearing the map. But note that we really need
> to be carefull when retaining the objects, otherwise code like
>
> - initWithCoder:..
> {
> [self dealloc];
> return something_else;
> }
>
> will crash the unarchiver.
> This rules out the replacement of objMap with an
> NSArray.
>
> If nobody objects I will commit this shortly.
>
> Wim Oudshoorn.
>
>
>
> -------------------------------------------------------
> Date: Thu 04/08/04 at 11:58 By: wim
> Actually, it is a generic bug, Linux is just lucky!
> The bug is as follows:
> NSUnarchiver has an ivar, "objMap" which is a map
> from "ref" to "Objects". However the the "Objects"
> are NOT retained. This means that if they are deallocated
> the reference in this map becomes invalid. Solution is
> to retain the objects in this map.
>
>
>
>
>
>
>
> File Attachments
> -------------------
>
> -------------------------------------------------------
> Date: Fri 04/09/04 at 10:29 Name: NSUnarchiver.patch Size: 1KB By: wim
> Patch to retain temporary the objects so initwithcoder can release them
> http://savannah.gnu.org/bugs/download.php?item_id=8498&item_file_id=1177
>
> -------------------------------------------------------
> Date: Thu 04/08/04 at 09:45 Name: testCoder.tar.bz2 Size: 1KB By: wim
> Demonstrating crash.
> http://savannah.gnu.org/bugs/download.php?item_id=8498&item_file_id=1173
>
>
>
>
>
>
> For detailed info, follow this link:
> <http://savannah.gnu.org/bugs/?func=detailitem&item_id=8498>
>
> _______________________________________________
> Message sent via/by Savannah
> http://savannah.gnu.org/
>
>
>
>
>
> _______________________________________________
> Bug-gnustep mailing list
> Bug-gnustep@gnu.org
> http://mail.gnu.org/mailman/listinfo/bug-gnustep
=====
Gregory John Casamento -- CEO/President Open Logic Corp.
__________________________________
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway
http://promotions.yahoo.com/design_giveaway/
- [bugs #8498] [MinGW] NSUnarchiver crashes, Willem Rein Oudshoorn, 2004/04/08
- [bugs #8498] [MinGW] NSUnarchiver crashes, Willem Rein Oudshoorn, 2004/04/08
- [bugs #8498] [MinGW] NSUnarchiver crashes, Willem Rein Oudshoorn, 2004/04/09
- Re: [bugs #8498] [MinGW] NSUnarchiver crashes,
Gregory John Casamento <=
- Re: [bugs #8498] [MinGW] NSUnarchiver crashes, Wim Oudshoorn, 2004/04/09
- Re: [bugs #8498] [MinGW] NSUnarchiver crashes, Gregory John Casamento, 2004/04/09
- Re: [bugs #8498] [MinGW] NSUnarchiver crashes, Richard Frith-Macdonald, 2004/04/10
- Re: [bugs #8498] [MinGW] NSUnarchiver crashes, Gregory John Casamento, 2004/04/10
- Re: [bugs #8498] [MinGW] NSUnarchiver crashes, Gregory John Casamento, 2004/04/10
- Re: [bugs #8498] [MinGW] NSUnarchiver crashes, Gregory John Casamento, 2004/04/10
- Re: [bugs #8498] [MinGW] NSUnarchiver crashes, Wim Oudshoorn, 2004/04/11
[bugs #8498] [MinGW] NSUnarchiver crashes, Willem Rein Oudshoorn, 2004/04/09
[bugs #8498] [MinGW] NSUnarchiver crashes, Gregory John Casamento, 2004/04/10
[bugs #8498] [MinGW] NSUnarchiver crashes, Richard Frith-Macdonald, 2004/04/11