Dylan Radcliffe added the comment: What I see in gdb is that that read is occurring due to the unpickling thread reading peeking ahead in the stream due to buffered io being used.
#0 0x00007ffff7bcbcbd in read () from /lib/x86_64-linux-gnu/libpthread.so.0 #1 0x000000000061f521 in fileio_readinto (self=0x7ffff6491528, args=0x7ffff66dc190) at ./Modules/_io/fileio.c:541 #2 0x00000000004b96f0 in PyCFunction_Call (func=0x7ffff601d598, arg=0x7ffff66dc190, kw=0x0) at Objects/methodobject.c:90 #3 0x000000000045a0c2 in PyObject_Call (func=0x7ffff601d598, arg=0x7ffff66dc190, kw=0x0) at Objects/abstract.c:2105 #4 0x000000000045ad3e in PyObject_CallMethodObjArgs (callable=0x7ffff601d598, name=0x7ffff7f3ccf0) at Objects/abstract.c:2341 #5 0x0000000000626e65 in _bufferedreader_raw_read (self=0x7ffff6777e58, start=0xa89210 ".\002X\367\017", len=4096) at ./Modules/_io/bufferedio.c:1438 #6 0x00000000006270ed in _bufferedreader_fill_buffer (self=0x7ffff6777e59) at ./Modules/_io/bufferedio.c:1470 #7 0x0000000000628474 in _bufferedreader_peek_unlocked (self=0x7ffff6777e58) at ./Modules/_io/bufferedio.c:1714 #8 0x0000000000624b1d in buffered_peek (self=0x7ffff6777e58, args=0x7ffff66d4948) at ./Modules/_io/bufferedio.c:880 As a possible workaround if you disable buffering when opening your pipe for input it seems to prevent the problem (though I am not sure about performance implications). 22c22 < load = Unpickler(os.fdopen(r, 'rb')).load --- > load = Unpickler(os.fdopen(r, 'rb', 0)).load ---------- nosy: +dylanr _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue18073> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com