|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-03-02 21:51 UTC] alan at akbkhome dot com
[2008-03-03 13:38 UTC] shire@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 17 08:00:01 2025 UTC |
Description: ------------ I have a function similar to the following: function part_data ($headers) { $msg = mailparse_msg_create (); mailparse_msg_parse ($msg, $headers); $part = mailparse_msg_get_part ($msg, '1'); $part_data = mailparse_msg_get_part_data ($part); return $part_data; } After calling this function (but not immediately after), PHP will infinite loop and/or the contents of $part_data will be corrupted. I believe the reason for this is that $msg goes out of scope and gets garbage collected, which frees the $msg resource. As part of freeing the $msg resource, I believe that the $part_data array (or perhaps one of the sub-arrays it contains) gets garbage collected prematurely. The reason I believe this is that if I recursively copy $part_data, and then return the copy, everything works fine. I therefore suspect there is a reference counting bug inside of the mailparse extension. The only reproduce code I have at present is part of a 900 line application. I have not tried to create a small example that demonstrates the bug, but I might be able to do so if that would help you. Thanks!