Re: [naviserver-devel] Crash in x64 mode in Ns_Log

2007-10-15 Thread Vlad Seryakov
yes, i know, i am complaining about myself relying on particular formatting. Stephen Deasey wrote: > On 10/15/07, Vlad Seryakov <[EMAIL PROTECTED]> wrote: >> The only thing which broke my old code regarding switching to vsnprintf >> is that old Ns_DStringPrintf handled empty string differently, vs

Re: [naviserver-devel] Crash in x64 mode in Ns_Log

2007-10-15 Thread Stephen Deasey
On 10/15/07, Vlad Seryakov <[EMAIL PROTECTED]> wrote: > The only thing which broke my old code regarding switching to vsnprintf > is that old Ns_DStringPrintf handled empty string differently, vsnprintf > now puts (null), before that empty string did not put anything. > > I still need to review si

Re: [naviserver-devel] Crash in x64 mode in Ns_Log

2007-10-15 Thread Vlad Seryakov
The only thing which broke my old code regarding switching to vsnprintf is that old Ns_DStringPrintf handled empty string differently, vsnprintf now puts (null), before that empty string did not put anything. I still need to review si the damage is critical enough or never upgrade until all cod

Re: [naviserver-devel] Crash in x64 mode in Ns_Log

2007-10-13 Thread Vlad Seryakov
Yes, works fine now, Thanks Stephen Deasey wrote: > On 10/13/07, Vlad Seryakov <[EMAIL PROTECTED]> wrote: >> I was able to find the location which causes the crash but i am not sure >> how to fix it >> >> In function Ns_VALog i call vsnprintf directly, it works, when it is >> called via Ns_DString

Re: [naviserver-devel] Crash in x64 mode in Ns_Log

2007-10-13 Thread Stephen Deasey
On 10/13/07, Vlad Seryakov <[EMAIL PROTECTED]> wrote: > I was able to find the location which causes the crash but i am not sure > how to fix it > > In function Ns_VALog i call vsnprintf directly, it works, when it is > called via Ns_DStringVPintf it crashes. using va_copy does not help > diff -r

Re: [naviserver-devel] Crash in x64 mode in Ns_Log

2007-10-13 Thread Vlad Seryakov
with included old dsprintf.c it works fine Vlad Seryakov wrote: > I was able to find the location which causes the crash but i am not sure > how to fix it > > In function Ns_VALog i call vsnprintf directly, it works, when it is > called via Ns_DStringVPintf it crashes. using va_copy does not he

Re: [naviserver-devel] Crash in x64 mode in Ns_Log

2007-10-13 Thread Vlad Seryakov
I was able to find the location which causes the crash but i am not sure how to fix it In function Ns_VALog i call vsnprintf directly, it works, when it is called via Ns_DStringVPintf it crashes. using va_copy does not help { char buf[4096]; vsnprintf(buf, sizeof(buf

Re: [naviserver-devel] Crash in x64 mode in Ns_Log

2007-10-13 Thread Vlad Seryakov
When i replaced Ns_VALog with pure vfprintf it does not crash anymore, so it is definitely something with passing va_list. I tried as discussed here but it still crashes: http://osdir.com/ml/redhat.amd64/2006-12/msg1.html void Ns_Log(Ns_LogSeverity severity, CONST char *fmt, ...) { va_l

Re: [naviserver-devel] Crash in x64 mode in Ns_Log

2007-10-13 Thread Gustaf Neumann
there is nothing wrong on using *va_list in general. the problem is rather in vsnprintf, which does most probably a loop like in Ns_DStringVarAppend char * Ns_DStringVarAppend(Ns_DString *dsPtr, ...) { register char *s; va_list ap; va_start(ap, dsPtr); while ((s = va_arg

Re: [naviserver-devel] Crash in x64 mode in Ns_Log

2007-10-12 Thread Vlad Seryakov
I use ns_log or Ns_Log, so it should take care about it, it ends up in Ns_DStringPrintf which calls vsnprintf. Is it correct in x64 to pass *va_list? Ns_VALog(Ns_LogSeverity severity, CONST char *fmt, va_list *vaPtr) Gustaf Neumann wrote: > be sure to terminate va_* argument lists with NULL (o

Re: [naviserver-devel] Crash in x64 mode in Ns_Log

2007-10-12 Thread Gustaf Neumann
be sure to terminate va_* argument lists with NULL (or to be on the safe side with (char*)NULL) and not with 0. when you have sizeof(int) != sizeof(char *), the compiler will put a 32bit for 0, a comparison with a 64bit null pointer will fail. I am pretty sure, the vsnprintf() tries to write

[naviserver-devel] Crash in x64 mode in Ns_Log

2007-10-12 Thread Vlad Seryakov
Hi, This is an example when it crashes inside vsnprintf, experimenting i found that issuing long unknown command crashes as well. In my case i noticed that trying to log long lines does not work as well. In x32 everything works fine db:vlad[18:01:19]#uname -a Linux db 2.6.22-ARCH #1 SMP PREEM