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.

classification
Title: Shared Memory List Returns 0 Length
Type: crash Stage: resolved
Components: ctypes, Extension Modules, Interpreter Core, IO Versions: Python 3.8
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: HugeAckmen, davin, pitrou
Priority: normal Keywords:

Created on 2019-12-04 18:29 by HugeAckmen, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (4)
msg357817 - (view) Author: (HugeAckmen) Date: 2019-12-04 18:29
When accessing Shared Memory Lists, occasionally the shared memory list will have a length of zero for only one line of code.

Even know the length of the list is constant and greater than zero, when accessing this list, like say sml[0], python returns a ValueError complaining that sml is an empty list.

As well, if you print out sml on the very next line in the exception handler, then you get a full length list, with no access issues whatsoever.

This isn't a locking issue, since locks were acquired before writing to the lists, and released after writing.  This is a shared memory list runtime access consistency issue.

An Example of this Issue can be Seen Here:
https://github.com/uofrobotics/RPLidarVidStream

The issue is in the process_data function, only when smd, sma, smq, or sml are read from.
msg357833 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2019-12-04 21:55
As I see, the problem is not related to asyncio at all.
msg357909 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2019-12-06 10:32
Antoine is marked as the multiprocessing expert
msg359703 - (view) Author: (HugeAckmen) Date: 2020-01-10 02:38
Documentation on Global Descriptor Lock needs re-writing.  Found documentation in version 2, much more helpful.
History
Date User Action Args
2022-04-11 14:59:24adminsetgithub: 83154
2020-01-10 02:38:58HugeAckmensetstatus: open -> closed

messages: + msg359703
stage: resolved
2020-01-04 18:27:10HugeAckmensetfiles: - 20191203_194951.jpg
2019-12-06 10:52:01xtreaksetnosy: + davin
2019-12-06 10:32:42asvetlovsetnosy: - asvetlov
2019-12-06 10:32:34asvetlovsetnosy: + pitrou
messages: + msg357909
2019-12-05 19:07:52yselivanovsetnosy: - yselivanov
2019-12-04 21:55:09asvetlovsetnosy: asvetlov, yselivanov, HugeAckmen
messages: + msg357833
components: - asyncio
2019-12-04 18:29:49HugeAckmencreate