Issue 10133: multiprocessing: conn_recv_string() broken error handling (original) (raw)

Issue10133

Created on 2010-10-17 20:14 by hfuru, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
conn_recv_string_failures.diff hfuru,2010-10-17 20:14 conn_recv_string() error handling
Messages (4)
msg118978 - (view) Author: Hallvard B Furuseth (hfuru) Date: 2010-10-17 20:14
Neither conn_recv_string() nor its callers free *newbuffer on error. The promotion rules break negative 'res' for 64-bit Py_ssize_t in the (ulength <= buflength) branch: res = -1 ==> (UINT32)-1 ==> Py_ssize_t 0xffffffff instead of -1. While I'm writing: The _conn_recvall() calls can be factored out of the if(). This patch applies to both 3.2a3 and 2.7. However, the patched failure cases are untested: I do not know how to test them. It passes make test.
msg162618 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-06-11 14:19
New changeset 60a7b704de5c by Richard Oudkerk in branch '2.7': Issue #10133: Make multiprocessing deallocate buffer if socket read fails. http://hg.python.org/cpython/rev/60a7b704de5c New changeset 5643697070c0 by Richard Oudkerk in branch '3.2': Issue #10133: Make multiprocessing deallocate buffer if socket read fails. http://hg.python.org/cpython/rev/5643697070c0
msg162622 - (view) Author: Richard Oudkerk (sbt) * (Python committer) Date: 2012-06-11 15:12
Thanks for the patch, I have applied it. (I don't think there was a problem with the promotion rules because res was a never converted to UINT32.)
msg162665 - (view) Author: Hallvard B Furuseth (hfuru) Date: 2012-06-12 10:35
Richard Oudkerk <report@bugs.python.org> wrote: > Thanks for the patch, I have applied it. (I don't think there was a > problem with the promotion rules because res was a never converted to > UINT32.) True now that res is a Py_ssize_t. It was int when I wrote the patch. Hallvard
History
Date User Action Args
2022-04-11 14:57:07 admin set github: 54342
2012-06-12 10:35:26 hfuru set messages: +
2012-06-11 17:57:29 amaury.forgeotdarc link issue15046 superseder
2012-06-11 15:12:45 sbt set status: open -> closedresolution: fixedmessages: + stage: resolved
2012-06-11 14:19:56 python-dev set nosy: + python-devmessages: +
2012-06-08 14:44:38 sbt set nosy: + sbt
2010-11-04 13:14:29 hfuru set versions: + Python 3.1, Python 2.7
2010-11-04 11:55:49 vstinner set nosy: + vstinner
2010-11-02 14:57:35 asksol set nosy: + asksol
2010-10-17 22:02:42 amaury.forgeotdarc set assignee: jnollernosy: + jnollertitle: conn_recv_string() broken error handling -> multiprocessing: conn_recv_string() broken error handling
2010-10-17 20:14:54 hfuru create