Marcus Meissner wrote:
On Tue, Feb 26, 2008 at 06:09:08PM +0100, Per Jessen wrote:
I've taken some existing code written for a standard 32 bit system and recompiled it for 64 bit. And now it promptly segfaults in vsyslog(). Well, the segfault happens in a strlen() call at some point, but removing the vsyslog call "fixes" the problem, so clearly there's something dodgy with vsyslog.
Has anyone else seen this?
You likely use vsyslog and its va_args argument wrong. Care to show us the function?
I sure hope I'm using it right - don't want to make myself look stupid in public: void message( int level, char *format, ... ) { int pri; va_list v; // if we print/log this message, depends on the verbosity-level if ( level<2 || level<=get_verbosity() ) { switch ( level ) { case 0: pri=LOG_WARNING; break; case 1: pri=LOG_NOTICE; break; case 2: pri=LOG_INFO; break; default: pri=LOG_DEBUG; break; } va_start( v, format ); // if we're not running as a daemon, we also log stdout. if ( 0==get_daemonize() ) { vfprintf( stdout, format, v ); fputc( '\n', stdout ); } vsyslog( pri, format, v ); va_end(v); } } /Per Jessen, Zürich --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-programming+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming+help@opensuse.org