Re: Anything I should know about thread safety and fprintf?
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=3W6TdG9CzIpuLkM2+MMokR7n4wxCWoFiflvl3bsgVJA=; b=n5Ww0DnuCiQp7MWE8uNCebVc6G6mlMAg/rAGTUA9DXPndJ81l/0GYJ7W6DdGtSXph8qsmB/Es98hnyUovE7TeLOdscgg8sc1lX+2SHLIWTYakIxWK6ClUYN68QqxCI8Vt3ENY4vptSOLTnY+JG6ndjev3IsjgvbHK2iSXQlkQOw= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=c8pyWagvUHqPCI8hI7rhCrXrCHHCV1r3byQ+iN32gzFKzY9DpDF4eShdMGoQ2DDaF8aDdoZf1OkyIZ0rLZnHKRu70k2RHFFd7O+EUsznbnciS7W+gAWjphI1aoVs3UL74hJcYZuAy47PB1lt6b6q7xIiwfIgrxEW8HLuM9Pm+/A= On Jan 24, 2008 11:16 AM, Jonathan del Strother <maillist@steelskies.com> wrote:
On Jan 24, 2008 7:00 AM, Jordan K. Hubbard <jkh@apple.com> wrote:
On Jan 23, 2008, at 5:02 PM, Terry Lambert wrote:
The only real way to talk to the system logging facility is via syslog()
Which is how you should generate log messages only if you wish to use the deprecated, purely-for-backwards-compatibility interface. :-)
Please use asl(3) for all new code. It's a far better, more flexible interface.
Ah. I thought the standard way of system logging was just fprintf(stderr, ... ). I still have no idea why I should be getting stuck in write() like that, but I've switched to asl and the problem seems to have magically disappeared...
Damn, spoke too soon. Now my app gets stuck in #0 0x94709a31 in write$NOCANCEL$UNIX2003 () #1 0x94700714 in asl_send () #2 0x946ff501 in asl_vlog () #3 0x946ff267 in asl_log () With a call to asl_log looking something like : asl_log(aslClient, NULL, ASL_LEVEL_INFO, "%s:%d - %s", "MillicentView.m", 236, "qc - 2.000000, 1.500000"); I attached gdb, and tried to 'finish' out of the write() frame, which never returns. The arguments look a little odd - presumably the function definition is along the lines of write(int fd, const void *buffer, size_t numbytes) ? I get : (gdb) p (char*) *(int *)($ebp+12) // buffer argument $1 = 0x15778380 "" (gdb) p *(size_t *)($ebp+16) // numbytes argument $2 = 360399840 ... which seems an unusually large buffer size, assuming I'm reading that right. I'm going to carry on hacking away at this, see if I can reduce the problem some more. _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com
participants (1)
-
Jonathan del Strother