Thread: Tracked down an error...

Tracked down an error...

From
"Johann Zuschlag"
Date:
Hi,

I went thru the code to track down the page fault error
when leaving my application. There is a funny behavior:

When I switch on CommLog (or Mylog) nothing happens.
If I switch it off: page fault when exiting the application.
I did following test in misc.c:

qlog(char *fmt,...)
{
    va_list        args;
    char        filebuf[80];
    FILE       *LOGFP = globals.qlogFP;

    if (globals.commlog)
    {
        va_start(args, fmt);

        if (!LOGFP)
        {
            generate_filename(QLOGDIR, QLOGFILE, filebuf);
//            LOGFP = fopen(filebuf, PG_BINARY_W);
//            globals.qlogFP = LOGFP;
//            setbuf(LOGFP, NULL);
        }

//        if (LOGFP)
//            vfprintf(LOGFP, fmt, args);

        va_end(args);
    }
}

like this my application crashes when I exit it.

If I remove the first comment from
LOGFP = fopen(filebuf, PG_BINARY_W);

it does NOT crash.

I don't understand that.
Any ideas?
(I'm using MS-C++ 5.0)

regards



Johann Zuschlag
zuschlag2@online.de