php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36542 Flash file causes crash when using getimagesize()
Submitted: 2006-02-27 14:03 UTC Modified: 2006-02-27 16:35 UTC
From: ogs22 at cam dot ac dot uk Assigned:
Status: Not a bug Package: Reproducible crash
PHP Version: 5.1.2 OS:
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: ogs22 at cam dot ac dot uk
New email:
PHP Version: OS:

 

 [2006-02-27 14:03 UTC] ogs22 at cam dot ac dot uk
Description:
------------
Tested on php5.1.2 on FreeBSD and MacOSX 10.4.5 both running 
apache 1.3.3

using getimagesize on certain swf files causes crash

test file is http://maths.org/~ogs22/ConstantDrop.swf
it is a version 8 flash file - other version 8 files seem OK.



Reproduce code:
---------------
<?php

$file="/Users/ogs/ConstantDrop.swf";

$x=getimagesize($file);

print_r($x);
?>

Expected result:
----------------
Array ( [0] => 720 [1] => 576 [2] => 13 [3] => width="720" 
height="576" [mime] => application/x-shockwave-flash )

Actual result:
--------------
causes
[Mon Feb 27 12:21:14 2006] [notice] child pid 19520 exit 
signal Bus error (10)

to appear in apache error log
and nothing to appear in browser

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-02-27 14:16 UTC] tony2001@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.


 [2006-02-27 15:47 UTC] ogs22 at cam dot ac dot uk
getimagesize does not work on the test flash file in 5.1.3 
dev - but does not cause crash - so I can't append a 
backtrace, getimagesize returns false instead.

I can append a backtrace from a non debug php5.1.2 though.

Program received signal EXC_BAD_ACCESS, Could not access 
memory.
Reason: 10 at address: 0x017e9000
0xffff8824 in ___memcpy () at /System/Library/Frameworks/
System.framework/PrivateHeaders/ppc/cpu_capabilities.h:189
189     /System/Library/Frameworks/System.framework/
PrivateHeaders/ppc/cpu_capabilities.h: No such file or 
directory.
        in /System/Library/Frameworks/System.framework/
PrivateHeaders/ppc/cpu_capabilities.h
(gdb) bt
#0  0xffff8824 in ___memcpy () at /System/Library/
Frameworks/System.framework/PrivateHeaders/ppc/
cpu_capabilities.h:189
#1  0x0249cae8 in _php_stream_copy_to_mem ()
#2  0x023e983c in php_handle_swc ()
#3  0x023ec694 in zif_getimagesize ()
#4  0x0250db20 in zend_do_fcall_common_helper_SPEC ()
#5  0x0251217c in ZEND_DO_FCALL_SPEC_CONST_HANDLER ()
#6  0x0250d5a4 in execute ()
#7  0x024e3bec in zend_execute_scripts ()
#8  0x02481d80 in php_execute_script ()
#9  0x02575318 in apache_php_module_main ()
#10 0x025766fc in send_php ()
#11 0x0257677c in send_parsed_php ()
#12 0x0000dd18 in ap_invoke_handler ()
#13 0x00017dd4 in process_request_internal ()
#14 0x00017e54 in ap_process_request ()
#15 0x00006b60 in child_main ()
#16 0x00006d18 in make_child ()
#17 0x00006e7c in startup_children ()
#18 0x000074ec in standalone_main ()
#19 0x00007d74 in main ()
 [2006-02-27 16:00 UTC] tony2001@php.net
With 5.1.3-dev and zlib enabled I get this:
array(5) {
  [0]=>
  int(550)
  [1]=>
  int(400)
  [2]=>
  int(13)
  [3]=>
  string(24) "width="550" height="400""
  ["mime"]=>
  string(29) "application/x-shockwave-flash"
}

 [2006-02-27 16:11 UTC] ogs22 at cam dot ac dot uk
After some testing- getimagesize() in 5.1.3-dev only works 
with flash files that are not in SWC format.
php was compiled using:

./configure --enable-debug --with-apxs=/usr/sbin/apxs --with-
zlib=/usr
 [2006-02-27 16:24 UTC] tony2001@php.net
So, it works fine and doesn't crash.
No bug here.
 [2006-02-27 16:35 UTC] ogs22 at cam dot ac dot uk
yes no crash in 5.1.3 - but for me it doesn't work for 
compressed flash files .
Should I start a new bug for that?
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 22:01:28 2024 UTC