|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26043 pg_lo_import causes crash under all circumstances
Submitted: 2003-10-30 13:48 UTC Modified: 2003-11-27 01:04 UTC
From: dqj at requesttech dot com Assigned:
Status: Not a bug Package: PostgreSQL related
PHP Version: 4.3.3 OS: Redhat 9.0
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: dqj at requesttech dot com
New email:
PHP Version: OS:


 [2003-10-30 13:48 UTC] dqj at requesttech dot com
No changes to php.ini distribution.  No output shown in logs.  Just doesn't finish the page.  (I have put echoes and breaks in to narrow it to the pg_lo_import() call).  We have checked file permissions, etc.  This code has worked under PHP 4.2 and other versions.  Have tried switching the pg_lo_import parameters back and forth, just in case, as described in the bug documentation.

Reproduce code:
$res = pg_connect( "host=myhost dbname=mytest user=myuser password=zzz" );
pg_exec( $res, "BEGIN" );
$oid = pg_lo_import( $res, "/tmp/dqj.tmp" );
pg_exec( $res, "COMMIT" );
echo "RES: $res, OID: $oid<br/>"; flush();

Expected result:
$oid should have a value. Echoed results should appear.

Actual result:
Blank page.  (Or echoed results prior to subroutine call, if debug is included.)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-10-30 14:26 UTC] dqj at requesttech dot com
I was wrong about there not being anything in the logs.  In the httpd error_log, there was the following:

[Thu Oct 30 14:25:10 2003] [notice] child pid 16877 exit signal Segmentation fault (11)

This occurs whenever a valid filename is given to pg_lo_import.
 [2003-10-30 14:32 UTC] dqj at requesttech dot com
Forgot to mention that the Postgres version is 7.3.4.
 [2003-10-31 16:45 UTC]
if you can provide the file used to replicate the crash, it may be possible for us to test and see if the issue was in fact resolved.
 [2003-10-31 20:49 UTC] dqj at requesttech dot com
Thank you!  To make it really simple and rule out file contents problems, I just did:

% echo "1" > /tmp/dqj.tmp

to create the file.

It also had failed with a .wav file prior to that.
 [2003-11-02 16:16 UTC]
Cannot replicate using latest CVS.
 [2003-11-26 17:18 UTC]
It's not just pg_lo_import, but also pg_lo_create.  The backtrace is as follows:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1226627936 (LWP 28034)]
0xb69f7987 in CC_send_function () from /usr/lib/
(gdb) where
#0  0xb69f7987 in CC_send_function () from /usr/lib/
#1  0xb6a06940 in lo_creat () from /usr/lib/
#2  0xb69c6c23 in lo_import () from /usr/lib/
#3  0xb69e4121 in zif_pg_lo_import (ht=2, return_value=0x8307424,
    this_ptr=0x0, return_value_used=1)
    at /usr/src/debug/php-4.3.2/ext/pgsql/pgsql.c:2099
#4  0xb697a542 in zend_assign_to_variable_reference ()
   from /usr/local/Zend/lib/Optimizer-2.1.0/php-4.3.x/
#5  0x00000002 in ?? ()
#6  0x08307424 in ?? ()

I can't tell yet whether this is a bug in PHP or in the pgsqlodbc libraries.

This backtrace is using the cli version of PHP on the test script provided (modified for my database).

 [2003-11-26 17:57 UTC]
This crash happens only when pgsql and odbc modules are installed and enabled together.
 [2003-11-27 01:04 UTC]
Not PHP bug.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Jun 14 12:01:29 2024 UTC