X-Original-To: pgsql-interfaces@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 18C38476323 for ; Thu, 3 Apr 2003 01:39:08 -0500 (EST) Received: from news.hub.org (news.hub.org [64.49.215.80]) by postgresql.org (Postfix) with ESMTP id AB45347631F for ; Thu, 3 Apr 2003 01:39:07 -0500 (EST) Received: by news.hub.org (Postfix, from userid 8) id 9475F43A91A; Thu, 3 Apr 2003 01:39:07 -0500 (EST) From: "Frankie Lam" X-Newsgroups: comp.databases.postgresql.interfaces Subject: Segmentation Fault Date: Thu, 3 Apr 2003 14:40:45 +0800 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 44 Message-ID: X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 To: pgsql-interfaces@postgresql.org X-Spam-Status: No, hits=-5.2 required=5.0 tests=BAYES_10,PRIORITY_NO_NAME version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/12 X-Sequence-Number: 3951 Hi, 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 run the 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, "); strcat(p2, tmp); } else if (!strcmp(PQfname(res, i), SERVERID_FIELD_NAME)) { puts("8"); sprintf(tmp, "'%s'", PQgetvalue(res, 0, i)); strcat(p2, tmp); } } ... ... freeing resources here ---------->8-------------- Thank you very much. Frankie Lam.