php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59670 chdb crashes when throwing exception on 64-bit platform
Submitted: 2011-03-16 05:37 UTC Modified: 2011-03-19 10:49 UTC
From: php at sagi dot org Assigned:
Status: Closed Package: chdb (PECL)
PHP Version: 5.3.5 OS: Linux 64-bit
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:
Package:
Bug Type:
Summary:
From: php at sagi dot org
New email:
PHP Version: OS:

 

 [2011-03-16 05:37 UTC] php at sagi dot org
Description:
------------
When I run a script such as:
<?php
try {
        $chdb = new chdb('/path/to/non-existing-file');
        var_dump($chdb);
} catch (Exception $ex) {
        echo "Caught exception: ", $ex;
}


As a web page (running under Apache httpd) on PHP 5.3.5 64-
bit, the Apache process crashes with the following back-
trace:
Program received signal SIGSEGV, Segmentation fault.
0x00002aaab18e3b63 in instanceof_function_ex () from 
/etc/httpd/modules/libphp5.so
(gdb) bt
#0  0x00002aaab18e3b63 in instanceof_function_ex () from 
/etc/httpd/modules/libphp5.so
#1  0x00002aaab18e3b3b in instanceof_function () from 
/etc/httpd/modules/libphp5.so
#2  0x00002aaab1903a19 in zend_throw_exception () from 
/etc/httpd/modules/libphp5.so
#3  0x00002aaab1903bb7 in zend_throw_exception_ex () from 
/etc/httpd/modules/libphp5.so
#4  0x00002aaab6d383a5 in throw_except_errno 
(format=0x2aaab6d38886 "Cannot load '%s': %s",
    arg=0x2aaab3161bd8 
"/srv/MyHeritage/cache/translations.chdb", _errno=2) at 
/home/sagi/rpmbuild/BUILD/chdb-0.2.0/php_chdb.c:23
#5  0x00002aaab6d38476 in zim_chdb___construct (ht=1, 
return_value=0x2aaab3169738, return_value_ptr=<value 
optimized out>,
    this_ptr=<value optimized out>, return_value_used=<value 
optimized out>) at /home/sagi/rpmbuild/BUILD/chdb-
0.2.0/php_chdb.c:185
#6  0x00002aaab193a099 in ?? () from 
/etc/httpd/modules/libphp5.so
#7  0x00002aaab191031b in execute () from 
/etc/httpd/modules/libphp5.so
#8  0x00002aaab18ec3e5 in zend_execute_scripts () from 
/etc/httpd/modules/libphp5.so
#9  0x00002aaab189cee8 in php_execute_script () from 
/etc/httpd/modules/libphp5.so
#10 0x00002aaab19750cd in ?? () from 
/etc/httpd/modules/libphp5.so
#11 0x00002aaaaaad4a4a in ap_run_handler ()
#12 0x00002aaaaaad7ed8 in ap_invoke_handler ()
#13 0x00002aaaaaae2938 in ap_process_request ()
#14 0x00002aaaaaadfb70 in ?? ()
#15 0x00002aaaaaadbcd2 in ap_run_process_connection ()
#16 0x00002aaaaaae6789 in ?? ()
#17 0x00002aaaaaae6989 in ?? ()
#18 0x00002aaaaaae74a7 in ap_mpm_run ()
#19 0x00002aaaaaac1e48 in main ()


This doesn't happen when I run it as a CLI script and it 
also never happens on 32-bit platform (both CLI and httpd).

I am using chdb 0.2.0 but I understand it is identical to 
1.0.0.



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-03-16 09:38 UTC] lorenzo at hyves dot nl
I don't currently have a setup like yours to test on, but the 
stacktrace seems to point to 'default_exception_ce' not being 
correctly initialized in Zend/zend_exceptions.c.

What happens if you replace the chdb line with something like 
'new SimpleXmlElement("-")'?
 [2011-03-16 09:46 UTC] php at sagi dot org
I already tried to test other extensions that throw exceptions 
in their constructor including datetime and simplexmlelement - 
neither of them crashes, I could only experience this with 
chdb.
 [2011-03-17 04:25 UTC] php at sagi dot org
Just wanted to update that I managed to reproduce the problem on another 
server with identical setup, and also on a virtual server on Amazon EC2 
that I installed from scratch especially for the purpose of debugging this 
bug.

Is there anything else I can do to help? If you need access to a 64-bit 
server I will gladly provide access credentials to the EC2 server.
 [2011-03-19 10:49 UTC] lorenzo at hyves dot nl
Thank you for your bug report. This issue has been fixed
in the latest released version of the package, which you can download at
http://pecl.php.net/get/chdb

I've reproduced the bug and it should be fixed in the new 
release 1.0.1. Thanks for the report!
 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Tue Sep 25 16:01:26 2018 UTC