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 Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
20 - 19 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2021 The PHP Group
All rights reserved.
Last updated: Tue Oct 26 08:04:40 2021 UTC