Edit report at https://bugs.php.net/bug.php?id=64830&edit=1

 ID:                 64830
 Updated by:         paj...@php.net
 Reported by:        bluewind at xinu dot at
 Summary:            mimetype detection segfaults on mp3 file
-Status:             Open
+Status:             Feedback
 Type:               Bug
 Package:            Unknown/Other Function
 Operating System:   Arch Linux
 PHP Version:        5.4.15
 Block user comment: N
 Private report:     N

 New Comment:

can you try using CLI please?

And it would be very helpful to either use a debug build or load the debug 
symbols 
to generate the backtrace.


Previous Comments:
------------------------------------------------------------------------
[2013-05-13 17:58:07] bluewind at xinu dot at

Description:
------------
Uploading an mp3 file or using fileinfo to check the mimetype of an mp3 file 
causes a crash.

5.4.14 works fine, 5.4.15 crashes.

I bisected it down to 10367fa7c6a4a2cf9bee02d8905e284185428f09.

Doesn't seem to happen for every mp3 file so here's the one I used: 
http://flo.server-speed.net/tmp/php-bug-mp3/test.mp3

If you need any more information to track it down or can't reproduce it, I'm 
happy to help.

Test script:
---------------
<?php

        function mimetype($file) {
                $fileinfo = new finfo(FILEINFO_MIME_TYPE);
                $mimetype = $fileinfo->file($file);

                return $mimetype;
        }

echo mimetype ("test.mp3")."\n";

Expected result:
----------------
Output should be "audio/mpeg" and it shouldn't crash.

Actual result:
--------------
*** Error in `/home/flo/git/php-src/sapi/cgi/php-cgi': munmap_chunk(): invalid 
pointer: 0x00007f31e3dc24f0 ***
======= Backtrace: =========
/usr/lib/libc.so.6(+0x788ae)[0x7f31e258a8ae]
/home/flo/git/php-src/sapi/cgi/php-cgi[0x5860d6]
/home/flo/git/php-src/sapi/cgi/php-cgi[0x5825ee]
/home/flo/git/php-src/sapi/cgi/php-cgi[0x5820bc]
/home/flo/git/php-src/sapi/cgi/php-cgi[0x57fef3]
/home/flo/git/php-src/sapi/cgi/php-cgi[0x580f87]
/home/flo/git/php-src/sapi/cgi/php-cgi[0x580d6a]
/home/flo/git/php-src/sapi/cgi/php-cgi[0x573bbc]
/home/flo/git/php-src/sapi/cgi/php-cgi[0x573dd1]
/home/flo/git/php-src/sapi/cgi/php-cgi[0x7cd0b2]
/home/flo/git/php-src/sapi/cgi/php-cgi[0x7cd71c]
/home/flo/git/php-src/sapi/cgi/php-cgi(execute+0x369)[0x7cc671]
/home/flo/git/php-src/sapi/cgi/php-cgi(zend_execute_scripts+0x23c)[0x79381c]
/home/flo/git/php-src/sapi/cgi/php-cgi(php_execute_script+0x370)[0x70ffd8]
/home/flo/git/php-src/sapi/cgi/php-cgi[0x8370bb]
/usr/lib/libc.so.6(__libc_start_main+0xf5)[0x7f31e2533a15]
/home/flo/git/php-src/sapi/cgi/php-cgi[0x41fca9]



------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=64830&edit=1

Reply via email to