|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57735 Segfault on non-existant file
Submitted: 2007-07-06 14:48 UTC Modified: 2017-10-24 09:09 UTC
From: Assigned:
Status: Suspended Package: perl (PECL)
PHP Version: 5.2.1 OS: FreeBSD 6.2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
49 - 11 = ?
Subscribe to this entry?

 [2007-07-06 14:48 UTC]
I'm actually using php 5.2.3 but the list only goes up to 5.2.1. Also using perl 5.8.8 from ports with all perl modules also from ports.

Extension compiled as a shared object. No other shared Extensions loaded.

Configure line is the standard php ports one: 
'./configure' '--enable-versioning' '--with-layout=GNU' '--with-config-file-scan-dir=/usr/local/etc/php' '--disable-all' '--enable-libxml' '--with-libxml-dir=/usr/local' '--enable-reflection' '--program-prefix=' '--disable-cgi' '--with-apxs2=/usr/local/sbin/apxs' '--with-regex=php' '--with-zend-vm=CALL' '--prefix=/usr/local'

When trying to create a perl object of class DNS::ZoneParse if  a filename that does not exist, php segfaults.

Reproduce code:
    #If exists it works. If not, it segfaults.

    $zone_file = '';

    $perl = new Perl();
    $perl->eval('use DNS::ZoneParse;');

    global $zone_file;
    $zone = new Perl('DNS::ZoneParse', 'new', $zone_file);

Expected result:
Perl exception raised by class or an empty zone created or other graceful failure.

Actual result:
Segmentation fault (core dumped)

drs# gdb /usr/local/bin/php php.core
GNU gdb 6.1.1 [FreeBSD]
<snip copyright>
Core was generated by `php'.
Program terminated with signal 11, Segmentation fault.
<snip symbols>
#0  0x28822125 in php_perl_get_class_name () from /usr/local/lib/php/20060613/
(gdb) bt
#0  0x28822125 in php_perl_get_class_name () from /usr/local/lib/php/20060613/
#1  0x0814e4c0 in zend_get_object_classname ()
#2  0x0815d808 in zend_fetch_debug_backtrace ()
#3  0x08160604 in zend_default_exception_new_ex ()
#4  0x081606a6 in zend_default_exception_new ()
#5  0x0815014b in _object_and_properties_init ()
#6  0x08150182 in _object_init_ex ()
#7  0x08161b26 in zend_throw_exception ()
#8  0x08161bd7 in zend_throw_exception_ex ()
#9  0x28821a18 in php_perl_constructor_handler () from /usr/local/lib/php/20060613/
#10 0x08169a4a in zend_do_fcall_common_helper_SPEC ()
#12 0x08169075 in execute ()
#13 0x0814ddf0 in zend_execute_scripts ()
#14 0x0810cd70 in php_execute_script ()
#15 0x081d449b in main ()


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-10-24 09:09 UTC]
-Status: Open +Status: Suspended
 [2017-10-24 09:09 UTC]
The perl package has had no activity for at least 4 years, so I'm gonna consider it dead. If a new maintainer decides to pick this back up, he/she can re-open the report
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Sep 20 05:03:36 2021 UTC