Windows fatal exception: access violation - shapes.py line 65

See original GitHub issue

Experiencing irregular python interpreter crashes. Crash happens 20-30% of the time that error producing line is executed. Code is using a multiprocessing pool, dont know if that is relevant but thought it might be worth mentioning.

Error found by using pythons in-built faulthandler module. Full traceback below:

Windows fatal exception: access violation

Current thread 0x00000a28 (most recent call first):
  File "C:\Users\OolongJunSun\AppData\Local\Programs\Python\Python310\lib\site-packages\pymunk\shapes.py", line 65 in shapefree
  File "D:\02_Projects\03_Active\Evolution\Crawl-Eat-Die-Repeat-broken\population.py", line 42 in generate_individuals
  File "D:\02_Projects\03_Active\Evolution\Crawl-Eat-Die-Repeat-broken\main.py", line 113 in <module>

Line 42 of my population.py script is resetting a dictionary containing a 500 class instances with variables made up of pymunk objects.

OS: Windows 10 PY: Python 3.10.4

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
viblocommented, May 28, 2022

Ok, great that you found a workaround! I will still keep this issue open for a while, while I research it a bit more.

1reaction
viblocommented, May 27, 2022

Ah, it became a bit easier to validate different theories around this error when I could trigger the error more often with a higher n_genes. It seems like the error reduces (or completely goes away) when I manually remove the shapes and reset their bodies to None in evaluate_individual, just after the while loop like this:

for shape in env.space.shapes:
    env.space.remove(shape)
    shape.body = None
Read more comments on GitHub >

github_iconTop Results From Across the Web

[core] "Windows fatal exception: access violation" cluttering ...
What is the problem? I am using Ray 1.1.0 with Python 3.7.6 to run an ActorPool. Each actor needs access to it's own...
Read more >
Windows fatal exception: access violation - Python Help
If an attempt to access an address in memory fails because the address isn't allocated or because the type of access isn't allowed...
Read more >
PyCharm Debugger dies with "Windows fatal exception
My observation is, that the error initially occurs if breakpoints are are set near/inside a codepath that may be "optimized" away, like close...
Read more >
Fix list for IBM WebSphere Application Server V8.5
IBM WebSphere Application Server provides periodic fixes for the base and Network Deployment editions of release V8.5. The following is a complete listing ......
Read more >
PHP - Wikipedia
PHP is a general-purpose scripting language geared toward web development. It was originally created by Danish-Canadian programmer Rasmus Lerdorf in 1993 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found