php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76561 Segfault with 7.2 / 7.3
Submitted: 2018-07-02 07:16 UTC Modified: 2018-07-02 09:31 UTC
From: remi@php.net Assigned: cmb (profile)
Status: Duplicate Package: mailparse (PECL)
PHP Version: 7.2.7 OS: n/a
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: remi@php.net
New email:
PHP Version: OS:

 

 [2018-07-02 07:16 UTC] remi@php.net
Description:
------------
Test suite is OK with PHP 7.1

With 7.2.7



Test script:
---------------
make test

Expected result:
----------------
All tests ok

Actual result:
--------------
TEST 13/13 [tests/parse_test_messages.phpt]
========DIFF========
002+ 
003+ Warning: (null)(): supplied resource is not a valid mailparse_mail_structure resource in Unknown on line 0
004+ 
005+ Warning: (null)(): supplied resource is not a valid mailparse_mail_structure resource in Unknown on line 0
006+ 
007+ Warning: (null)(): supplied resource is not a valid mailparse_mail_structure resource in Unknown on line 0
========DONE========
FAIL Parse messages in testdata dir [tests/parse_test_messages.phpt] 


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-07-02 09:31 UTC] cmb@php.net
-Status: Open +Status: Duplicate -Assigned To: +Assigned To: cmb
 [2018-07-02 09:31 UTC] cmb@php.net
Duplicate of bug #76402.
 [2018-07-06 07:40 UTC] phpdev at ehrhardt dot nl
Any news on this one? I ran the test on 7.2 (Windows, x64, nts) and got the same error.

FAIL!
Warning: (null)(): supplied resource is not a valid mailparse_mail_structure resource

Unhandled exception at 0x000007FEF22C4344 (php_mailparse.dll) in php.exe: 0xC0000005: Access violation reading location 0x0000000000000008. occurred

>	php_mailparse.dll!php_mimepart_free(_php_mimepart * part) Line 327
 	php7.dll!zend_hash_destroy(_zend_array * ht) Line 1235
 	php_mailparse.dll!php_mimepart_free(_php_mimepart * part) Line 336
 	php7.dll!zend_resource_dtor(_zend_resource * res) Line 81
 	php7.dll!zend_close_rsrc(_zval_struct * zv) Line 233
 	php7.dll!zend_hash_reverse_apply(_zend_array * ht, int(*)(_zval_struct *) apply_func) Line 1597
 	php7.dll!shutdown_executor() Line 264
 	php7.dll!zend_deactivate() Line 1038
 	php7.dll!php_request_shutdown(void * dummy) Line 1907
 	php.exe!do_cli(int argc, char * * argv) Line 1180
 	php.exe!main(int argc, char * * argv) Line 1404
 	[External Code]	

The extension did not even compile for PHP 7.3
 [2018-11-17 03:33 UTC] php at delegated dot net
Received this error in a production environment when parsing a particular email, however the error only triggered on auto destruction, not at parse time. As a workaround, explicitly calling mailparse_msg_free before the end of the script solved the issue.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 14:01:28 2024 UTC