Re: PHP 4.0 Bug #7117 Updated: ibase_query() crashes when inserting a blob_id
| From: | Mathieu Kooiman | Date: | Wed, 18 Oct 2000 07:33:53 +0000 |
| Subject: | Re: PHP 4.0 Bug #7117 Updated: ibase_query() crashes when inserting a blob_id | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-35362@lists.php.net to get a copy of this message | ||
While you're at it..
There's a bug in ibase_blob_import when it can't access the file pointer,
e.g. There's no such file.. Causes segfault.
I do have a patch that works but I'm not totally sure what
ibase_blob_import does, but it works for file pointers:P
-- CaPS
On 17 Oct 2000 jah@php.net wrote:
> ID: 7117
> Updated by: jah
> Reported By: lb@knuut.de
> Status: Closed
> Bug Type: InterBase related
> Assigned To: jah
> Comments:
>
> No reason to thank. Guess who broke it in the first place? :(
>
> Closing, it is fixed now.
>
> Previous Comments:
> ---------------------------------------------------------------------------
>
> [2000-10-17 17:42:35] lb@knuut.de
> Thank you Jouni,
>
> my example do not make troubles anymore.
>
> I also did some quick testings with prepare/execute and everything
> runs well.
>
> Lutz
>
>
> ---------------------------------------------------------------------------
>
> [2000-10-17 13:48:49] jah@php.net
> This is hopefully fixed in CVS. Please replace ext/interbase/interbase.c with
>
> http://cvs.php.net/viewcvs.cgi/~checkout~/php4/ext/interbase/interbase.c?rev=1.45
> and recompile. And please also tell whether it worked or not...
>
> ---------------------------------------------------------------------------
>
> [2000-10-10 08:30:42] lb@knuut.de
> this little script crashes php4.02 and 4.03dev on my linux box
> no matter if php is running as an apache module or as cgi.
>
> It seems that the error is not in the ibase_blob_import(),
> but in the ibase_query() when trying to insert a blob id.
>
> <?php
>
> $dbhandle = ibase_connect("/tmp/test.gdb", "itsme", "secret");
> ibase_query($dbhandle, "create table test (bid integer, bbb blob)");
> ibase_commit();
> $bfhandle = fopen("/tmp/test.txt", "r");
> $b_str = ibase_blob_import($dbhandle, $bfhandle);
> ibase_query("insert into test (bid, bbb) values (1, ?)", $b_str);
>
> ?>
>
>
> I hope this will help to fix this nasty bug:
>
> (gdb) bt
> #0 0x8098c45 in _efree (ptr=0x8175204) at zend_alloc.c:217
> #1 0x80b880d in _php_ibase_free_xsqlda (sqlda=0x81dafbc) at interbase.c:297
> #2 0x80ba98d in _php_ibase_exec (ib_resultp=0xbfffe604, ib_query=0x81daebc, argc=1,
> args=0x81a1680) at interbase.c:1413
> #3 0x80bb069 in php_if_ibase_query (ht=2, return_value=0x81ab9cc, this_ptr=0x0,
> return_value_used=0) at interbase.c:1677
> #4 0x80937d8 in execute (op_array=0x81ac60c) at ./zend_execute.c:1519
> #5 0x8089e92 in zend_execute_scripts (type=8, file_count=3) at zend.c:717
> #6 0x8064b6b in php_execute_script (primary_file=0xbffffac4) at main.c:1199
> #7 0x806152c in main (argc=3, argv=0xbffffb24) at cgi_main.c:706
>
>
> Thanks,
> Lutz
>
>
> ---------------------------------------------------------------------------
>
>
> Full Bug description available at: http://bugs.php.net/?id=7117
>
>
>