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: random.shuffle() crashes with Unhandled exception
Type: crash Stage: resolved
Components: Library (Lib) Versions: Python 3.9
process
Status: closed Resolution: third party
Dependencies: Superseder:
Assigned To: Nosy List: JelleZijlstra, rhettinger, rowan.bradley, scoder
Priority: normal Keywords:

Created on 2021-03-24 14:16 by rowan.bradley, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (3)
msg389456 - (view) Author: Rowan Sylvester-Bradley (rowan.bradley) Date: 2021-03-24 14:16
When I do 
  random.shuffle(questions_element) 
(questions_element is an element generated by lxml via the code
  questions_element = exams.find("questions") )
I get a crash:
Unhandled exception at 0x00007FFD7AE8EF89 (ntdll.dll) in python.exe: 0xC0000374: A heap has been corrupted (parameters: 0x00007FFD7AEF77F0).

Is there a way to work around this?

Thanks - Rowan
msg389462 - (view) Author: Jelle Zijlstra (JelleZijlstra) * (Python committer) Date: 2021-03-24 14:46
Could you post code that fully reproduces the problem?

I suspect the root cause for the bug is in lxml (a third-party library), not in CPython itself.
msg389516 - (view) Author: Stefan Behnel (scoder) * (Python committer) Date: 2021-03-25 18:43
Almost certainly not a bug in CPython's stdlib.

Possibly something worth investigating in lxml, although, as stated in issue 43618, random.shuffle() simply does not work on lxml.etree Elements.
History
Date User Action Args
2022-04-11 14:59:43adminsetgithub: 87782
2021-03-25 18:43:27scodersetstatus: open -> closed
resolution: third party
messages: + msg389516

stage: resolved
2021-03-25 17:31:35rhettingersetnosy: + scoder, - skrah
2021-03-24 18:34:45iritkatrielsetcomponents: + Library (Lib)
2021-03-24 18:08:39rhettingersetnosy: + skrah
2021-03-24 16:19:19rhettingersetnosy: + rhettinger
2021-03-24 14:46:46JelleZijlstrasetnosy: + JelleZijlstra
messages: + msg389462
2021-03-24 14:16:11rowan.bradleycreate