oneTBB icon indicating copy to clipboard operation
oneTBB copied to clipboard

Loading tbb12.dll fails if its dependencies are located in `LOAD_LIBRARY_SEARCH_USER_DIRS` directories

Open Grantim opened this issue 1 year ago • 1 comments

Summary

I am building python module dependent in tbb, and when packing it I pack libraries into special folder. When importing module dll load fails (on loading msvc140.dll if it is not in common location but it user specified dll search path (it worked in oneTBB 2021.11.0)).

Version

oneTBB 2021.13.0

Environment

Windows 11 python 3.11 MSVC

Observed Behavior

Library does not load

Expected Behavior

Library loads

Steps To Reproduce

Please have a look at related issue https://github.com/adang1345/delvewheel/issues/49

There are several important steps to see the problem:

  1. One should repair dll using https://pypi.org/project/delvewheel/ or any other similar tool (it is important not to load dependencies from system locations)
  2. Dependencies and tbb12 should be located in user added dll search path (not system one)
  3. Load tbb12.dll

It turned out that while loading tbb12.dll it changes system dlls search path and cannot find msvc140.dll that in my case located right near tbb12.dll

I think the reason is https://github.com/oneapi-src/oneTBB/compare/v2021.11.0...v2021.13.0#diff-01fb64c473f1e70ed71d0d37e62daa12d13f2bd487df508e550a80f8ead82f9bR38 this change. But is it expected to affect dependencies?

Grantim avatar Aug 02 '24 16:08 Grantim

The issue appears since #1330

Fedr avatar Aug 02 '24 17:08 Fedr