Re: Segmentation Fault

Поиск
Список
Период
Сортировка
От Christoph Haller
Тема Re: Segmentation Fault
Дата
Msg-id 3E8BFAD1.40107@rodos.fzk.de
обсуждение исходный текст
Ответ на Segmentation Fault  ("Frankie Lam" <frankie@ucr.com.hk>)
Список pgsql-interfaces
>> I want to ask what does the error message mean by> "0x40023abb in resetPQExpBuffer () from
/usr/local/pgsql/lib/libpq.so.3"?>I got this message using GDB to trace the program.> (Segmentation fault occurswhen
runthe program directly.)>> I reviewed the program many times, and found this is only to happen when> I call the
`ctime()' or `time()' in a program function.>> code fragment FYI> --8<------------------------> // `res = PQexec(conn,
sql)'here..> ...> ...>   }>   else if (!strcmp(PQfname(res, i), SYNCTIME_FIELD_NAME))>   {> //   puts("7");>    //char
chP[30];>   printf("timer=%ld\n", time(timer)); // <====== without this line, the> program works> //   printf("%s",
ctime(time(NULL)));>//   printf("%s", asctime(localtime(&timer)));>    sprintf(tmp, "'1999-12-11 09:50:58'::timestamp,
");

I would like to see the declaration of the "timer" variable.
Is it "time_t"? Then you should code "&timer" as in localtime(&timer).
Is it "time_t *"? Then, did you alloc'd memory?
Regards, Christoph



В списке pgsql-interfaces по дате отправления:

Предыдущее
От: "Frankie Lam"
Дата:
Сообщение: Segmentation Fault
Следующее
От: "Jose Luis LG"
Дата:
Сообщение: unsubscribe