Skip to content

Ray1M, RayHit1M - Deallocation crash #10

@drawitsro

Description

@drawitsro

Hi,
I have tried to use your library, it's exactly what I have been looking for for a long time, unfortunately, I am not skilled in python bindings generation and I encountered some troubles.

I have installed Embree: High-Performance Ray Tracing Kernels 3.12.2 from Embree website.
I have built it successfully (latest version, commit 1238e0e) on Windows 10, python 3.7 in mingw64 (git bash console).
Here is the build log:
$ C:/python37/python.exe setup.py build_ext -I/c/Program\ Files/Intel/Embree3/include -L /c/Program\ Files/Intel/Embree3/lib
running build_ext
building 'embree' extension
creating build
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -I/opt/local/include "-IC:/Program Files/Intel/Embree3/include" -IC:\python37\include -IC:\python37\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /Tcembree.c /Fobuild\temp.win-amd64-3.7\Release\embree.obj
embree.c
creating C:\external\python-embree\build\lib.win-amd64-3.7
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX86\x64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:/opt/local/lib "/LIBPATH:C:/Program Files/Intel/Embree3/lib" /LIBPATH:C:\python37\libs /LIBPATH:C:\python37\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\ATLMFC\lib\x64" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64" embree3.lib /EXPORT:PyInit_embree build\temp.win-amd64-3.7\Release\embree.obj /OUT:build\lib.win-amd64-3.7\embree.cp37-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.7\Release\embree.cp37-win_amd64.lib
Creating library build\temp.win-amd64-3.7\Release\embree.cp37-win_amd64.lib and object build\temp.win-amd64-3.7\Release\embree.cp37-win_amd64.exp
Generating code
Finished generating code

I have even successfully created a triangle geometry and the scene (even multiple times with deallocation), everything works until some of the Ray1M or RayHit1M objects are deallocated (freed).

Very minimalistic repro code is:
import embree
rays = embree.Ray1M(100)

and result after run is:
Process finished with exit code -1073740940 (0xC0000374) <- crash

Of course, the same problem prevails even if the Ray1M is created somewhere in the function or class and its freed after usage.

The only workaround I have found to be working is to preallocate the Ray1M big enough for the whole work done in the program and let it crash only when the program is closing.

Any Ideas what might be behind this trouble?

Best regards,
Zdenek Glazer

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions