php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71066 mb_send_mail: Program terminated with signal SIGSEGV, Segmentation fault.
Submitted: 2015-12-08 20:46 UTC Modified: -
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: ae at devil-coding dot de Assigned:
Status: Closed Package: Mail related
PHP Version: 7.0.0 OS: Debian 8 Jessie (x64)
Private report: No CVE-ID: None
 [2015-12-08 20:46 UTC] ae at devil-coding dot de
Description:
------------
I've noticed that the mb_send_mail() function causes a Segmentation fault error.
When I execute the test code below I'm only recive a Segmentation fault error message to stderr. It seems that mb_send_mail crashes here.

Here is the gdb backtrace for the Segmentation fault error:

Program terminated with signal SIGSEGV, Segmentation fault.
#0  __strchr_sse2 () at ../sysdeps/x86_64/multiarch/../strchr.S:32
32      ../sysdeps/x86_64/multiarch/../strchr.S: No such file or directory.
(gdb) bt
#0  __strchr_sse2 () at ../sysdeps/x86_64/multiarch/../strchr.S:32
#1  0x00000000006d5fc7 in zif_mb_send_mail (execute_data=0x7f61b0a152e0, return_value=0x7f61b0a152c0) at /tmp/php/php-7.0.0/ext/mbstring/mbstring.c:4117
#2  0x0000000000a27e12 in ZEND_DO_ICALL_SPEC_HANDLER () at /tmp/php/php-7.0.0/Zend/zend_vm_execute.h:586
#3  0x0000000000a2784a in execute_ex (ex=0x7f61b0a15030) at /tmp/php/php-7.0.0/Zend/zend_vm_execute.h:414
#4  0x0000000000a2795f in zend_execute (op_array=0x7f61b0a88000, return_value=0x0) at /tmp/php/php-7.0.0/Zend/zend_vm_execute.h:458
#5  0x00000000009cdb89 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /tmp/php/php-7.0.0/Zend/zend.c:1428
#6  0x0000000000940eda in php_execute_script (primary_file=0x7ffe9b72a810) at /tmp/php/php-7.0.0/main/main.c:2471
#7  0x0000000000a8b9e2 in do_cli (argc=2, argv=0x2d5f660) at /tmp/php/php-7.0.0/sapi/cli/php_cli.c:974
#8  0x0000000000a8c98d in main (argc=2, argv=0x2d5f660) at /tmp/php/php-7.0.0/sapi/cli/php_cli.c:1345


Configure:
./configure --prefix=/usr/local --with-bz2 --enable-calendar --with-curl --enable-exif --enable-ftp --with-gd --with-jpeg-dir --enable-gd-native-ttf --enable-mbstring --with-mcrypt --with-pcre-regex --enable-soap --enable-sockets --enable-zip --with-zlib --enable-fpm --with-config-file-path=/etc/php5 --with-mysql-sock=/var/run/mysqld/mysqld.sock --with-pdo-mysql --with-mysqli --enable-shmop --enable-opcache --with-freetype-dir --enable-debug

Test script:
---------------
define('ADMIN_MAIL', 'mail@example.net');
define('NAME', 'Backoffice');
define('DEFAULT_HOST', 'example.net');

admin_mail('test', 'some text for testing');

function admin_mail($subject, $text) {

    if($text !== '') {
        
        $headers = 'MIME-Version: 1.0' . "\r\n";
        $headers .= 'Content-type: text/plain; charset=UTF-8' . "\r\n";
        $headers .= 'From: ESO-Database System <no-reply@' . DEFAULT_HOST . '>' . "\r\n";

        mb_send_mail(ADMIN_MAIL, NAME . ' Adminmail | ' . $subject, $text, $headers);
	}
}


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-12-08 20:57 UTC] ae at devil-coding dot de
It looks like this header causes the error:

$headers .= 'Content-type: text/plain; charset=UTF-8' . "\r\n";

Without this line I get no Segmentation fault error.
 [2015-12-09 01:47 UTC] laruence@php.net
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=84b997020ea47b10172207196136291c5ff09443
Log: Fixed bug #71066 (mb_send_mail: Program terminated with signal SIGSEGV, Segmentation fault)
 [2015-12-09 01:47 UTC] laruence@php.net
-Status: Open +Status: Closed
 [2016-07-20 11:34 UTC] davey@php.net
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=84b997020ea47b10172207196136291c5ff09443
Log: Fixed bug #71066 (mb_send_mail: Program terminated with signal SIGSEGV, Segmentation fault)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 09:01:32 2024 UTC