php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62603 Apache 2.2 core dump with PHPExcel 1.7.7 with --enable-zip
Submitted: 2012-07-18 18:52 UTC Modified: 2013-02-18 00:35 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: bianchini dot alessio at gmail dot com Assigned:
Status: No Feedback Package: hash related
PHP Version: 5.3.14 OS: Sun Solaris 8
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: bianchini dot alessio at gmail dot com
New email:
PHP Version: OS:

 

 [2012-07-18 18:52 UTC] bianchini dot alessio at gmail dot com
Description:
------------
I have configured an environment with this product:
1)apache 2.2
2) PHP 5.3.14

I tried to use the library PHPExcel 1.7.7 (this library works fine on my machine 
with XAMPP) but I have error that the "ZipArchive Library is not enbaled".
So i build php with this command line:

./configure --with-curl --with-apxs2=/usr/local/apache/bin/apxs --disable-debug 
--enable-ftp --enable-inline-optimization --enable-magic-quotes --enable-
mbstring --enable-safe-mode --enable-wddx=shared --with-gd --with-gettext --
with-mysql=/usr/local/mysql --with-mysqli --with-regex=system --with-
zlib=/usr/local/zlib --enable-zip --with-libxml-
dir=/usr/local/include/libxml2/libxml

But now when i call my php page, apache core dumped

Test script:
---------------
Before to add the option "--enable-zip", the error is in this line:

Excel2007.php:

  if (!class_exists('ZipArchive')) {
                        throw new Exception("ZipArchive library is not enabled");
                }



After, apache core dumped


Expected result:
----------------
I expect that my page doesn't cause apache core dump:

mypage.php (part of code):

set_include_path(get_include_path() . PATH_SEPARATOR . './Classes/');

/** PHPExcel */
include 'PHPExcel.php';

include 'PHPExcel/IOFactory.php';

$inputFileName = "Estrazione SM giugno 2012.xlsx";  
$inputFileType = PHPExcel_IOFactory::identify($inputFileName);  
$objReader = PHPExcel_IOFactory::createReader($inputFileType); 

$objReader->setReadDataOnly(true);  // sola lettura
$objPHPExcel = $objReader->load($inputFileName); //Carico il file xls
$total_sheets=$objPHPExcel->getSheetCount();// numeri sheet
$allSheetName=$objPHPExcel->getSheetNames(); // nomi dei sheet
$objWorksheet = $objPHPExcel->setActiveSheetIndex(1); // mi prendo il primo 
sheet
$highestRow = $objWorksheet->getHighestRow(); // Numero riga massima
$highestColumn = $objWorksheet->getHighestColumn();  // Colonna Max

$highestColumnIndex = PHPExcel_Cell::columnIndexFromString($highestColumn); // 
Indice delle colonne


Actual result:
--------------
Now Apache core dumped; below there is backtrace:

mysql@etiopia # gdb /usr/local/apache/bin/httpd ./core
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "sparc-sun-solaris2.8"...

warning: Can't read pathname for load map: I/O error.

warning: .dynamic section for "/usr/local/apache/modules/libphp5.so" is not at 
the expected address (wrong library or version mismatch?)
Reading symbols from /usr/lib/libm.so.1...done.
Loaded symbols for /usr/lib/libm.so.1
Reading symbols from /usr/local/lib/libiconv.so.2...done.
Loaded symbols for /usr/local/lib/libiconv.so.2
Reading symbols from /usr/lib/libsendfile.so.1...done.
Loaded symbols for /usr/lib/libsendfile.so.1
Reading symbols from /usr/lib/librt.so.1...done.
Loaded symbols for /usr/lib/librt.so.1
Reading symbols from /usr/lib/libsocket.so.1...done.
Loaded symbols for /usr/lib/libsocket.so.1
Reading symbols from /usr/lib/libnsl.so.1...done.
Loaded symbols for /usr/lib/libnsl.so.1
Reading symbols from /usr/lib/libpthread.so.1...done.
Loaded symbols for /usr/lib/libpthread.so.1
Reading symbols from /usr/lib/libdl.so.1...done.
Loaded symbols for /usr/lib/libdl.so.1
Reading symbols from /usr/lib/libc.so.1...done.
Loaded symbols for /usr/lib/libc.so.1
Reading symbols from /usr/local/lib/libgcc_s.so.1...done.
Loaded symbols for /usr/local/lib/libgcc_s.so.1
Reading symbols from /usr/lib/libaio.so.1...done.
Loaded symbols for /usr/lib/libaio.so.1
Reading symbols from /usr/lib/libmp.so.2...done.
Loaded symbols for /usr/lib/libmp.so.2
Reading symbols from /usr/platform/SUNW,Sun-Fire-280R/lib/libc_psr.so.1...done.
Loaded symbols for /usr/platform/SUNW,Sun-Fire-280R/lib/libc_psr.so.1
Reading symbols from /usr/lib/libthread.so.1...done.
Loaded symbols for /usr/lib/libthread.so.1
Reading symbols from /usr/local/apache/modules/libphp5.so...done.
Loaded symbols for /usr/local/apache/modules/libphp5.so
Reading symbols from /usr/local/lib/libintl.so.8...done.
Loaded symbols for /usr/local/lib/libintl.so.8
Reading symbols from /usr/local/lib/libpng12.so.0...done.
Loaded symbols for /usr/local/lib/libpng12.so.0
Reading symbols from /usr/local/zlib/lib/libz.so...done.
Loaded symbols for /usr/local/zlib/lib/libz.so
Reading symbols from /usr/lib/libresolv.so.2...done.
Loaded symbols for /usr/lib/libresolv.so.2
Reading symbols from /usr/local/lib/libcurl.so.4...done.
Loaded symbols for /usr/local/lib/libcurl.so.4
Reading symbols from /usr/local/ssl/lib/libssl.so.0.9.7...done.
Loaded symbols for /usr/local/ssl/lib/libssl.so.0.9.7
Reading symbols from /usr/local/ssl/lib/libcrypto.so.0.9.7...done.
Loaded symbols for /usr/local/ssl/lib/libcrypto.so.0.9.7
Reading symbols from /usr/lib/libldap.so.4...done.
Loaded symbols for /usr/lib/libldap.so.4
Reading symbols from /usr/local/mysql/lib/mysql/libmysqlclient.so.16...done.
Loaded symbols for /usr/local/mysql/lib/mysql/libmysqlclient.so.16
Reading symbols from /usr/local/lib/libxml2.so.2...done.
Loaded symbols for /usr/local/lib/libxml2.so.2
Reading symbols from /usr/lib/libsec.so.1...done.
Loaded symbols for /usr/lib/libsec.so.1
Reading symbols from /usr/lib/libz.so.1...done.
Loaded symbols for /usr/lib/libz.so.1
Reading symbols from /usr/local/lib/php/extensions/no-debug-non-zts-
20090626/zip.so...done.
Loaded symbols for /usr/local/lib/php/extensions/no-debug-non-zts-
20090626/zip.so
Reading symbols from /usr/lib/nss_files.so.1...done.
Loaded symbols for /usr/lib/nss_files.so.1

warning: Can't read pathname for load map: I/O error.

warning: Can't read pathname for load map: I/O error.
Core was generated by `/usr/local/apache/bin/httpd -k start'.
Program terminated with signal 11, Segmentation fault.
[New process 85866    ]
[New process 151402    ]
[New process 216938    ]
#0  0xe4068000 in ?? ()
Redefine command "____executor_globals"? (y or n) [answered Y; input not from 
terminal]
Redefine command "print_cvs"? (y or n) [answered Y; input not from terminal]
Redefine command "dump_bt"? (y or n) [answered Y; input not from terminal]
Redefine command "printzv"? (y or n) [answered Y; input not from terminal]
Redefine command "____printzv_contents"? (y or n) [answered Y; input not from 
terminal]
Redefine command "____printzv"? (y or n) [answered Y; input not from terminal]
Redefine command "____print_const_table"? (y or n) [answered Y; input not from 
terminal]
Redefine command "print_const_table"? (y or n) [answered Y; input not from 
terminal]
Redefine command "____print_ht"? (y or n) [answered Y; input not from terminal]
Redefine command "print_ht"? (y or n) [answered Y; input not from terminal]
Redefine command "print_htptr"? (y or n) [answered Y; input not from terminal]
Redefine command "print_htstr"? (y or n) [answered Y; input not from terminal]
Redefine command "____print_ft"? (y or n) [answered Y; input not from terminal]
Redefine command "print_ft"? (y or n) [answered Y; input not from terminal]
Redefine command "____print_inh_class"? (y or n) [answered Y; input not from 
terminal]
Redefine command "____print_inh_iface"? (y or n) [answered Y; input not from 
terminal]
Redefine command "print_inh"? (y or n) [answered Y; input not from terminal]
Redefine command "print_pi"? (y or n) [answered Y; input not from terminal]
Redefine command "____print_str"? (y or n) [answered Y; input not from terminal]
Redefine command "printzn"? (y or n) [answered Y; input not from terminal]
Redefine command "printzops"? (y or n) [answered Y; input not from terminal]
Redefine command "zbacktrace"? (y or n) [answered Y; input not from terminal]
Redefine command "zmemcheck"? (y or n) [answered Y; input not from terminal]
(gdb) bt
#0  0xe4068000 in ?? ()
#1  0xfda02060 in WhirlpoolTransform (context=0x4f9700) at 
/export/home/mysql/php-5.3.14/ext/hash/hash_whirlpool.c:166
#2  0xfda04e3c in _php_iconv_mime_decode (pretval=0x0, str=0x414550 "", 
str_nbytes=0, enc=0xffbeeed0 "ÿ¾îÜ", next_pos=0x1, mode=3505840)
    at /export/home/mysql/php-5.3.14/ext/iconv/iconv.c:1772
#3  0xfdc0f218 in mult (a=0x357d68, b=0xc000) at /export/home/mysql/php-
5.3.14/Zend/zend_strtod.c:727
#4  0xfdc0e50c in zend_exception_error (exception=0xffbef600, severity=1758304) 
at /export/home/mysql/php-5.3.14/Zend/zend_exceptions.c:765
#5  0xfdbeabf8 in zend_atoi (str=0x8 <Address 0x8 out of bounds>, str_len=1) at 
/export/home/mysql/php-5.3.14/Zend/zend_operators.c:68
#6  0xfdb8f278 in c_ziparchive_deleteName (ht=0, return_value=0xfe130430, 
return_value_ptr=0x6, this_ptr=0x8, return_value_used=1885892608)
    at /export/home/mysql/php-5.3.14/ext/zip/php_zip.c:2220
#7  0xfdc7f24c in ZEND_FETCH_OBJ_W_SPEC_CV_VAR_HANDLER (execute_data=0x341298) 
at /export/home/mysql/php-5.3.14/Zend/zend_gc.h:183
#8  0x0003dd48 in ap_run_handler (r=0x341298) at config.c:157
#9  0x0003e1dc in ap_invoke_handler (r=0x341298) at config.c:376
#10 0x00056784 in ap_process_request (r=0x341298) at http_request.c:282
#11 0x00053870 in ap_process_http_connection (c=0x33b358) at http_core.c:190
#12 0x000444e0 in ap_run_process_connection (c=0x33b358) at connection.c:43
#13 0x000714f0 in child_main (child_num_arg=0) at prefork.c:662
#14 0x00071754 in make_child (s=0x71000, slot=3) at prefork.c:763
#15 0x00071824 in startup_children (number_to_start=2) at prefork.c:781
#16 0x00072200 in ap_mpm_run (_pconf=0xf4698, plog=0xea400, s=0xf93a0) at 
prefork.c:1002
#17 0x0002aee4 in main (argc=3, argv=0xffbefcec) at main.c:739

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-07-18 19:22 UTC] pajoye@php.net
-Status: Open +Status: Feedback
 [2012-07-18 19:22 UTC] pajoye@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.


 [2012-07-18 20:06 UTC] bianchini dot alessio at gmail dot com
-Status: Feedback +Status: Open
 [2012-07-18 20:06 UTC] bianchini dot alessio at gmail dot com
Hi,

you have to install PHPExcel 1.7.7 and in the directory class you can write this 
page:

<?php

set_time_limit(0);

set_include_path(get_include_path() . PATH_SEPARATOR . './Classes/');

/** PHPExcel */
include 'PHPExcel.php';

include 'PHPExcel/IOFactory.php';

$inputFileName = "YourFile.xlsx";
$inputFileType = PHPExcel_IOFactory::identify($inputFileName);
$objReader = PHPExcel_IOFactory::createReader($inputFileType);

$objReader->setReadDataOnly(true);  // sola lettura
$objPHPExcel = $objReader->load($inputFileName); //Carico il file xls
$total_sheets=$objPHPExcel->getSheetCount();// numeri sheet
$allSheetName=$objPHPExcel->getSheetNames(); // nomi dei sheet
$objWorksheet = $objPHPExcel->setActiveSheetIndex(0); // mi prendo il primo 
sheet
$highestRow = $objWorksheet->getHighestRow(); // Numero riga massima
$highestColumn = $objWorksheet->getHighestColumn();  // Colonna Max

$highestColumnIndex = PHPExcel_Cell::columnIndexFromString($highestColumn);

for ($row = 2   ; $row <= $highestRow; ++$row) {
    for ($col = 0; $col <= $highestColumnIndex -1; ++$col) {
    $value=$objWorksheet->getCellByColumnAndRow($col, $row)->getValue();
       
                        $riga[$col]=$value;

                                      echo "Row $row, Column $col --> ".$value;


}



}


?>

Be careful to change the Excel File name in the variable $inputFileName. There 
you can put the name of your example file Excel (you can write the first sheet 
of excel)
 [2012-07-18 21:09 UTC] pajoye@php.net
-Status: Open +Status: Feedback
 [2012-07-18 21:09 UTC] pajoye@php.net
Sorry but I can't debug using PHPEXcel, either report the bug report there or 
provide an archive I can use to reproduce the issue.
 [2012-07-18 21:10 UTC] pajoye@php.net
Also the crash occurs in ext/hash
 [2012-07-18 21:10 UTC] pajoye@php.net
-Package: Reproducible crash +Package: hash related
 [2012-07-19 07:22 UTC] bianchini dot alessio at gmail dot com
Hi,

you can download the archive from:

http://77.238.10.252/PHP/PHPDump.zip

If i call the page "test.php", apache core dumped; on the contrary, if the same 
package I install with XAMPP, everything works properly

PLEASE HELP ME!!
 [2012-07-19 07:22 UTC] bianchini dot alessio at gmail dot com
-Status: Feedback +Status: Open
 [2012-07-19 07:28 UTC] pajoye@php.net
As I said, we can't debug using such a huge script.

I pointed the PHPExcel author to this bug, let see what can be done.
 [2012-07-19 07:28 UTC] pajoye@php.net
-Status: Open +Status: Feedback
 [2013-02-18 00:35 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 [2014-02-21 16:20 UTC] cyril dot bouthors at isvtec dot com
I got a similar issue that I documented on Github. Please have a look at https://github.com/sandeepcr529/codespy/issues/4#issuecomment-35745447
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 08:01:29 2024 UTC