On Sat, Nov 27, 2004 at 06:46:51PM +0100, Ola Lundqvist wrote: > Hello > > On Fri, Nov 19, 2004 at 02:26:03PM +0100, Daniel van Eeden wrote: > > Same problem here on amd64 (pure64). Backtrace included. I can provide > > access to my box if needed.
The crash in strftime is a bit scary, since rfbLog() doesn't do anything special. It doesn't even pass any of it's own arguments to strftime, so IMHO, if strftime crashes, it must be triggered by rfbLog() itself. I've written a program to test rfbLog alone (rfbLog() copied 1:1 from tightvnc-1.2.9/Xvnc/programs/Xserver/hw/vnc/init.c, along with 5 lines boilerplate code). It would be nice if you could test it on your machine. It's attatched to this mail. Can you also confirm that tightvncserver still crashes? If my test program segfaults too, the only reason I can imagine is that localtime(&clock) returns NULL, because an error occurred. strftime causes a segfault then. Improved error checking could fix this pretty easily then. > I suspect major problems. I do not think vnc was indended for 64 bit > machines. I suspect that there are several int around that may be > used in wrong way. That implies that tightvncserver doesn't work on ia64 too. This would make this bug release critical. Personally I don't want to believe that this is the case though, just because of this bugreport. It doesn't seem to be related to word-size problems at all, except that it only happens on amd64 (apparently). Cheers, Greek0
#include <stdio.h> #include <stdarg.h> #include <time.h> void rfbLog(char *format, ...) { va_list args; char buf[256]; time_t clock; va_start(args, format); time(&clock); strftime(buf, 255, "%d/%m/%y %T ", localtime(&clock)); fprintf(stderr, buf); vfprintf(stderr, format, args); fflush(stderr); va_end(args); } int main() { rfbLog("Test output %s some (%d) args.\n", "with", 2); return 0; }
signature.asc
Description: Digital signature