This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eryksun
Recipients eryksun, paul.moore, steve.dower, tim.golden, vstinner, zach.ware
Date 2017-06-08.20:09:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1496952576.94.0.952832247721.issue30602@psf.upfronthosting.co.za>
In-reply-to
Content
The memory leak is in os_spawnv_impl and os_spawnve_impl in Modules/posixmodule.c. The call fails with a ValueError when the first argument in the argv list is an empty string, in which case these functions both mistakenly pass i (0) to free_string_array() as the count of strings to free. But the conversion was successful, so it needs to include the current string in the count, i.e. `i + 1`.

The fix for this could also address the following two issues, which are mostly cosmetic in nature. os_spawnve_impl needs its TypeError message to be special cased the same as in os_spawnv_impl, i.e. "spawnve() arg 2 must contain only strings". Currently it uses the default message from the failed conversion: "expected str, bytes or os.PathLike object, not %.200s". Also, its ValueError message needs to reference "spawnve()" instead of "spawnv()".
History
Date User Action Args
2017-06-08 20:09:36eryksunsetrecipients: + eryksun, paul.moore, vstinner, tim.golden, zach.ware, steve.dower
2017-06-08 20:09:36eryksunsetmessageid: <1496952576.94.0.952832247721.issue30602@psf.upfronthosting.co.za>
2017-06-08 20:09:36eryksunlinkissue30602 messages
2017-06-08 20:09:36eryksuncreate