discuss-gnustep
[Top][All Lists]
Advanced

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

Problem with GSFromUnicode in Unicode.m


From: Sebastian Reitenbach
Subject: Problem with GSFromUnicode in Unicode.m
Date: Wed, 2 Mar 2011 15:33:16 +0100
User-agent: KMail/1.13.5 (Linux/2.6.34.7-0.7-xen; KDE/4.4.4; x86_64; ; )

Hi,

When i want to install sieve scripts from ogo into the cyrus imapd sieve 
daemon, ogo uses the tool sky_install_sieve. This tool crashes, converting a 
unicode string (actually the filter list), due to a double free?

As far as I can see, the problem might be in GSFromUnicode in Unicode.m, see 
the backtrace below.
Attached patch fixes the problem for me, but I am not sure whether this is 
actually right. I also don't have a mac to see whether/how it is working 
there. The only thing I can tell is that with libFoundation, it was working, 
and I guess it was also tested and working on the mac, years ago.

This happens for me with gnustep-base-1.20.2. also the patch is against it.
I additionally check for zone != 0, since I don't think it makes sense to free 
a zone which is already 0, which is was here for me all the time.
The patch also still applies to -trunk, with offset of -3 lines.


Or otherwise, if I'm totally wrong, a hint would be nice where to look 
elsewhere.

Sebastian




sky_install_sieve in free(): error: bogus pointer (double free?) 0xcfbcee94

Program received signal SIGABRT, Aborted.
[Switching to process 4963, thread 0x8946f400]
0x0e1ad76d in kill () from /usr/lib/libc.so.58.0
(gdb) bt
#0  0x0e1ad76d in kill () from /usr/lib/libc.so.58.0
#1  0x0e20de65 in abort () at /usr/src/lib/libc/stdlib/abort.c:68
#2  0x0e20b9ed in wrterror (msg=Variable "msg" is not available.
) at /usr/src/lib/libc/stdlib/malloc.c:387
#3  0x0e20ce39 in free (ptr=0xcfbcee94) at 
/usr/src/lib/libc/stdlib/malloc.c:1328
#4  0x066e9310 in objc_free (mem=0xcfbcee94) at 
/usr/src/gnu/usr.bin/cc/libobjc/../../../gcc/libobjc/misc.c:135
#5  0x0b14a93d in default_free (zone=0x2afb6180, ptr=0xcfbcee94) at 
NSZone.m:159
#6  0x0b14a3d6 in NSZoneFree (zone=0x0, ptr=0xcfbcee94) at NSZone.m:2037
#7  0x0b1a8c36 in GSFromUnicode (dst=0x0, size=0xcfbd36e0, src=0x8687f000, 
slen=17868, enc=NSUTF8StringEncoding, zone=0x0, options=4) at Unicode.m:2505
#8  0x0afd05c8 in -[GSMutableString lengthOfBytesUsingEncoding:] 
(self=0x87d4c528, _cmd=0x28f241c0, encoding=NSUTF8StringEncoding) at 
GSString.m:1390
#9  0x08f7538c in -[NGSieveClient putScript:script:] (self=0x7faf6188, 
_cmd=0x3c0024e8, _name=0x3c002684, _script=0x87d4c528) at NGSieveClient.m:426
#10 0x1c0036bf in -[InstallSieve runWithArguments:] (self=0x8549fc88, 
_cmd=0x3c002528, _args=0x8488cb08) at sky_install_sieve.m:560
#11 0x1c0013e8 in +[InstallSieve runWithArguments:] (self=0x3c002260, 
_cmd=0x3c002530, _args=0x8488cb08) at sky_install_sieve.m:588
#12 0x1c002393 in gnustep_base_user_main (argc=14, argv=0xcfbd38a8, 
env=0xcfbd38e4) at sky_install_sieve.m:606
#13 0x0b0d246e in main (argc=14, argv=Cannot access memory at address 0x4
) at NSProcessInfo.m:933
#14 0x1c001147 in ___start ()
#15 0x1c0010c7 in _start ()
#16 0x00000000 in ?? ()

Attachment: patch-Source_Additions_Unicode_m
Description: Text document


reply via email to

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