Re: asl_log aborts the program?

2009-11-20 Thread Jeremy Pereira

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,0x1167b) 
 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 0x7fff87a7784d usleep$NOCANCEL + 0
 1   libSystem.B.dylib 0x7fff87a96e3c abort + 93
 2   libSystem.B.dylib 0x7fff879ae155 free + 128
 3   libSystem.B.dylib 0x7fff879fa16e asl_set_query + 572
 4   libSystem.B.dylib 0x7fff87a16239 asl_send + 824
 5   libSystem.B.dylib 0x7fff87a15e56 asl_vlog + 570
 6   libSystem.B.dylib 0x7fff87a15c19 asl_log + 153
 7   Progname.CocoaTools0x000104567101 -[Log 
 vlogLevel:format:arguments:] + 270
 8   Progname.CocoaTools0x00010456730c -[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 (Cocoa-dev@lists.apple.com)
 
 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:
 http://lists.apple.com/mailman/options/cocoa-dev/adc%40jeremyp.net
 
 This email sent to a...@jeremyp.net


__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: asl_log aborts the program?

2009-11-20 Thread Chris Idou


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 a...@jeremyp.net
To: Chris Idou idou...@yahoo.com; Cocoa Forum cocoa-dev@lists.apple.com
Cc: Jeremy Pereira a...@jeremyp.net
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,0x1167b) 
 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 0x7fff87a7784d usleep$NOCANCEL + 0
 1   libSystem.B.dylib 0x7fff87a96e3c abort + 93
 2   libSystem.B.dylib 0x7fff879ae155 free + 128
 3   libSystem.B.dylib 0x7fff879fa16e asl_set_query + 572
 4   libSystem.B.dylib 0x7fff87a16239 asl_send + 824
 5   libSystem.B.dylib 0x7fff87a15e56 asl_vlog + 570
 6   libSystem.B.dylib 0x7fff87a15c19 asl_log + 153
 7   Progname.CocoaTools0x000104567101 -[Log 
 vlogLevel:format:arguments:] + 270
 8   Progname.CocoaTools0x00010456730c -[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 (Cocoa-dev@lists.apple.com)
 
 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:
 http://lists.apple.com/mailman/options/cocoa-dev/adc%40jeremyp.net
 
 This email sent to a...@jeremyp.net


__
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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: asl_log aborts the program?

2009-11-20 Thread Jens Alfke

On Nov 19, 2009, at 10:33 PM, Chris Idou wrote:

 Thread 2 Crashed:
 0   libSystem.B.dylib 0x7fff87a7784d usleep$NOCANCEL + 0
 1   libSystem.B.dylib 0x7fff87a96e3c abort + 93
 2   libSystem.B.dylib 0x7fff879ae155 free + 128
 3   libSystem.B.dylib 0x7fff879fa16e asl_set_query + 572

ASL isn't aborting; it's free() that's aborting. Probably it discovered that 
your heap is corrupted [note the prior malloc error log] and bailed out.

—Jens

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


asl_log aborts the program?

2009-11-19 Thread Chris Idou


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,0x1167b) 
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

And in the crash report:

Process: Progname [11128]
Path:/Applications/Progname.app/Contents/MacOS/Progname
Identifier:  Progname
Version: 1.19 (19)
Code Type:   X86-64 (Native)
Parent Process:  launchd [180]

Date/Time:   2009-11-19 17:40:42.570 -0500
OS Version:  Mac OS X 10.6.2 (10C540)
Report Version:  6

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x, 0x
Crashed Thread:  2

Application Specific Information:
abort() called
objc[11128]: garbage collection is ON

Thread 0:  Dispatch queue: com.apple.main-thread
0   libSystem.B.dylib 0x7fff879a7e3a mach_msg_trap + 10
1   libSystem.B.dylib 0x7fff879a84ad mach_msg + 59
2   com.apple.CoreFoundation  0x7fff86c997a2 __CFRunLoopRun + 1698
3   com.apple.CoreFoundation  0x7fff86c98c2f CFRunLoopRunSpecific + 575
4   com.apple.HIToolbox   0x7fff865b9a4e RunCurrentEventLoopInMode 
+ 333
5   com.apple.HIToolbox   0x7fff865b9853 ReceiveNextEventCommon + 
310
6   com.apple.HIToolbox   0x7fff865b970c 
BlockUntilNextEventMatchingListInMode + 59
7   com.apple.AppKit  0x7fff815f31f2 _DPSNextEvent + 708
8   com.apple.AppKit  0x7fff815f2b41 -[NSApplication 
nextEventMatchingMask:untilDate:inMode:dequeue:] + 155
9   com.apple.AppKit  0x7fff815b8747 -[NSApplication run] + 395
10  Progname 0x00010eea main + 76
11  Progname 0x00010e7c start + 52

Thread 1:  Dispatch queue: com.apple.libdispatch-manager
0   libSystem.B.dylib 0x7fff879c0bba kevent + 10
1   libSystem.B.dylib 0x7fff879c2a85 _dispatch_mgr_invoke + 154
2   libSystem.B.dylib 0x7fff879c275c _dispatch_queue_invoke + 
185
3   libSystem.B.dylib 0x7fff879c2286 _dispatch_worker_thread2 + 
244
4   libSystem.B.dylib 0x7fff879c1bb8 _pthread_wqthread + 353
5   libSystem.B.dylib 0x7fff879c1a55 start_wqthread + 13

Thread 2 Crashed:
0   libSystem.B.dylib 0x7fff87a7784d usleep$NOCANCEL + 0
1   libSystem.B.dylib 0x7fff87a96e3c abort + 93
2   libSystem.B.dylib 0x7fff879ae155 free + 128
3   libSystem.B.dylib 0x7fff879fa16e asl_set_query + 572
4   libSystem.B.dylib 0x7fff87a16239 asl_send + 824
5   libSystem.B.dylib 0x7fff87a15e56 asl_vlog + 570
6   libSystem.B.dylib 0x7fff87a15c19 asl_log + 153
7   Progname.CocoaTools0x000104567101 -[Log 
vlogLevel:format:arguments:] + 270
8   Progname.CocoaTools0x00010456730c -[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.


  
__
Win 1 of 4 Sony home entertainment packs thanks to Yahoo!7.
Enter now: http://au.docs.yahoo.com/homepageset/
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com