Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory access violation when testing benchmark_dll.py in Python 3.12.1. (Memory leak not caused by my PR that just fixes the print statements!) #11

Open
JamesParrott opened this issue Feb 7, 2024 · 0 comments

Comments

@JamesParrott
Copy link
Collaborator

JamesParrott commented Feb 7, 2024

sdna_plus version 4.1.1

I don't know if a benchmarking test will affect users, but any memory issue could point to something much more important.

To demonstrate this, PR #12 needs to be checked out, otherwise Python 3 will throw a SyntaxError before doing anything (the PR's good to go - check the diff - it just updates the print statements).

In Python 3.12.1:

(pytest_py312)  %userprofile%\Coding\repos\sdna_plus\sDNA\sdna_vs2008\tests\pytest>set "SDNADLL=C:\Program Files (x86)\sDNA\x64\sdna_vs2008.dll"

(pytest_py312)  %userprofile%\Coding\repos\sdna_plus\sDNA\sdna_vs2008\tests\pytest>python -u ..\benchmark_dll.py
dll name C:\Program Files (x86)\sDNA\x64\sdna_vs2008.dll
large r list
Traceback (most recent call last):
  File " %userprofile%\Coding\repos\sdna_plus\sDNA\sdna_vs2008\tests\benchmark_dll.py", line 94, in <module>
    test_net(bound_grid_test,large_radius_list,"ANGULAR",False,1)
  File " %userprofile%\Coding\repos\sdna_plus\sDNA\sdna_vs2008\tests\benchmark_dll.py", line 74, in test_net
    net_definition(net)
  File " %userprofile%\Coding\repos\sdna_plus\sDNA\sdna_vs2008\tests\benchmark_dll.py", line 90, in <lambda>
    bound_grid_test = lambda n: grid_test(n,5000,desired_num_links)
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File " %userprofile%\Coding\repos\sdna_plus\sDNA\sdna_vs2008\tests\benchmark_dll.py", line 56, in grid_test
    add_random_kink_link(net,my_id,grid_square_size,numpy.array((x,y)),numpy.array((x+1,y)))
  File " %userprofile%\Coding\repos\sdna_plus\sDNA\sdna_vs2008\tests\benchmark_dll.py", line 47, in add_random_kink_link
    add_polyline(net,my_id,point_list,(0,0))
  File " %userprofile%\Coding\repos\sdna_plus\sDNA\sdna_vs2008\tests\benchmark_dll.py", line 32, in add_polyline
    dll.net_add_polyline(net,arcid,len(points),point_array_x,point_array_y)
OSError: exception: access violation reading 0x000000007C835CA8

(pytest_py312)  %userprofile%\Coding\repos\sdna_plus\sDNA\sdna_vs2008\tests\pytest>python --version
Python 3.12.1

Expected behaviour in CPython 2.7:

(pytest_numpy_py27) %userprofile%\Coding\repos\sdna_plus\sDNA\sdna_vs2008\tests\pytest>python -u ..\benchmark_dll.py
('dll name', 'C:\\Program Files (x86)\\sDNA\\x64\\sdna_vs2008.dll')
large r list
disc,
17356.0695 ms

cont,
79886.8724 ms

small r list
disc,
19372.3797 ms

cont,
15116.5732 ms


(pytest_numpy_py27) %userprofile%\Coding\repos\sdna_plus\sDNA\sdna_vs2008\tests\pytest>python --version
Python 2.7.18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant