Re: asl_log aborts the program?
Re: asl_log aborts the program?
- Subject: Re: asl_log aborts the program?
- From: Chris Idou <email@hidden>
- Date: Fri, 20 Nov 2009 03:07:59 -0800 (PST)
I just noticed something I didn't see before, namely that the doco says to call asl_open once for each thread, which I'm not doing. I guess this most likely is the cause.
________________________________
From: Jeremy Pereira <email@hidden>
To: Chris Idou <email@hidden>; Cocoa Forum <email@hidden>
Cc: Jeremy Pereira <email@hidden>
Sent: Fri, 20 November, 2009 9:35:01 PM
Subject: Re: asl_log aborts the program?
On 20 Nov 2009, at 06:33, Chris Idou wrote:
>
>
> I've got a report from a user of my program crashing.
>
> In the console they are getting this:
>
> 11/19/09 3:08:46 PM[0x0-0x18a18a]Progname[8699]Progname(8699,0x1167b0000) malloc: *** error for object 0x100563870: pointer being freed was not allocated
> 11/19/09 3:08:46 PM[0x0-0x18a18a] Progname[8699]*** set a breakpoint in malloc_error_break to debug
>
>
> Thread 2 Crashed:
> 0 libSystem.B.dylib 0x00007fff87a7784d usleep$NOCANCEL + 0
> 1 libSystem.B.dylib 0x00007fff87a96e3c abort + 93
> 2 libSystem.B.dylib 0x00007fff879ae155 free + 128
> 3 libSystem.B.dylib 0x00007fff879fa16e asl_set_query + 572
> 4 libSystem.B.dylib 0x00007fff87a16239 asl_send + 824
> 5 libSystem.B.dylib 0x00007fff87a15e56 asl_vlog + 570
> 6 libSystem.B.dylib 0x00007fff87a15c19 asl_log + 153
> 7 Progname.CocoaTools 0x0000000104567101 -[Log vlogLevel:format:arguments:] + 270
> 8 Progname.CocoaTools 0x000000010456730c -[Log notice:] + 164
> ....etc
>
> Does this look like an Apple bug? It looks to me like the asl subsystem is freeing something it shouldn't and aborting the program.
>
Normally when I see crashes involving calls to methods with format strings, I immediately assume that the arguments following the the format string do not match the format specifiers in the format string. e.g. if -[Log notice:] is declared like this
-(void) notice: (NSString*) format, ...;
[log notice: @"blah blah blah %@ %s", "blah"];
The above line has an NSObject missing from its argument list. There's also
[log notice: someNSStringofIndeterminateOrigin];
which may crash if the string contains format specifiers e.g. if it is a URL with % escapes in it.
So you probably want to check your calls to -[Log notice:].
>
> __________________________________________________________________________________
> Win 1 of 4 Sony home entertainment packs thanks to Yahoo!7.
> Enter now: http://au.docs.yahoo.com/homepageset/
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
__________________________________________________________________________________
Win 1 of 4 Sony home entertainment packs thanks to Yahoo!7.
Enter now: http://au.docs.yahoo.com/homepageset/
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden