Received: from hotmail.com (oe62.law4.hotmail.com [216.33.148.158]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f8QGDRh14809; Wed, 26 Sep 2001 12:13:27 -0400 (EDT) (envelope-from temp6453@hotmail.com) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Wed, 26 Sep 2001 09:13:23 -0700 X-Originating-IP: [142.177.213.133] Reply-To: "Mike Rogers" From: "Mike Rogers" To: , , Subject: PostgreSQL / PHP Overrun Error Date: Wed, 26 Sep 2001 13:13:17 -0300 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 Message-ID: X-OriginalArrivalTime: 26 Sep 2001 16:13:23.0477 (UTC) FILETIME=[2A821C50:01C146A6] X-Archive-Number: 200109/177 X-Sequence-Number: 2327 I have just upgraded to the new PostgreSQL 7.1.3 (from 7.0.3) and have been experiencing a pretty serious problem: On one particular page, in what seems to be completely random instances, I get buffer overruns and either 0-rows or a crashed apache child. Turning on PHP's --enable-debug, I receive the following: [Wed Sep 26 06:21:12 2001] Script: '/path/to/script.php' --------------------------------------- pgsql.c(167) : Block 0x086A6DF8 status: Beginning: Overrun (magic=0x00000000, expected=0x7312F8DC) End: Unknown --------------------------------------- Sometimes it will actually crash mid-way (probably overwrote some valuable code): --------------------------------------- pgsql.c(167) : Block 0x08684290 status: Beginning: Overrun (magic=0x0000111A, expected=0x7312F8DC) [Wed Sep 26 09:22:46 2001] [notice] child pid 8710 exit signal Segmentation fault (11) This problem is of great concern to me and I have been working for days trying to debug it myself and find other reports, with little success. The line it claims to be failing on is PHP's ext/pgsql/pgsql.c on line 167 (by what this claims) which is the following function [the efree(PGG(last_notice)) line]. static void _notice_handler(void *arg, const char *message) { PGLS_FETCH(); if (! PGG(ignore_notices)) { php_log_err((char *) message); if (PGG(last_notice) != NULL) { efree(PGG(last_notice)); } PGG(last_notice) = estrdup(message); } } Can anyone provide further input as to why this is causing problems? The PHP code works sometimes and not others, and it seems to be only that one script, so I do not believe it to be a hardware issue. Any thoughts? I can provide any further system information if needed. I have tried recompiling pgsql, php and apache with different optimizations [including none at all and debug mode on as i have now] with little change in the result. Thanks in advance; -- Mike cc: pgsql-hackers; pgsql-php; pgsql_bugs