-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
BUG in x86 DLL with D405 #10336
Comments
Hi @POWER-KI Does the rs-hello-realsense.exe pre-built example program launch correctly on your x86 computer, please? As you have installed the full RealSense SDK for Windows, you should be able to find the program and the other pre-built .exe examples at the folder location below: C: > Program Files (x86) > Intel RealSense SDK 2.0 > tools If you wish to build the example programs in Visual Studio, Intel provide guidance for doing so at the link below. If you were attempting to build rs-hello-realsense.cpp in Visual Studio for an x86 system, you could check whether the build target is configured for x86. |
The pre-built works (but I think that is an X64 version). To check the problems:
We have tested this because other programs tha we have with the new DLL crash. Regards, |
I think that the problems is in |
Could you try building the starter C++ Visual Studio project in the tutorial linked to below please to see whether that project experiences the same problem. https://github.com/EduardoWang/visual-studio-real-sense-record-and-playback-project |
The x86 DLL with: |
I will highlight the issue to Intel to seek their feedback. Thanks very much for the report! |
Hi @POWER-KI Intel were able to replicate your problem with x86 compilation on D405 specifically and created an internal bug report to investigate it further. I will therefore add an Enhancement tag to this case as a reminder to keep the case open whilst that bug report is active. |
Any update to this? We also need the x86 compiled version for D405 |
Hi @henryjliu There is no further information to provide at this time. |
I tested a very simple program and it crashes on last line. I am somewhat motivated to tackle this as would like to use D405 in our application and it needs to be x86. Is there a cmake that creates the x86 compiled libraries?
|
Building the RealSense SDK from source code with CMake should generate the RealSense.dll files, though I cannot offer guarantees regarding whether it will make a difference to whether the generated .dll works with D405. Windows source code build There is no need to carry out the 'Enabling metadata on Windows' section of the instructions as metadata can be enabled through the RealSense Viewer program. Linux source code build |
I’m hoping to compile it in debug mode on x86 then it will tell me what is
wrong. However it appears x86 is not an out of box visual studio compile
option like x64. Do you have the compile scripts for x86?
…On Wed, Apr 27, 2022 at 12:42 PM MartyG-RealSense ***@***.***> wrote:
Building the RealSense SDK from source code should generate the
RealSense.dll files, though I cannot offer guarantees regarding whether it
will make a difference to whether the generated .dll works with D405.
*Windows source code build*
https://github.com/IntelRealSense/librealsense/blob/master/doc/installation_windows.md
There is no need to carry out the 'Enabling metadata on Windows' section
of the instructions as metadata can be enabled through the RealSense Viewer
program.
*Linux source code build*
https://github.com/IntelRealSense/librealsense/blob/master/doc/installation.md
—
Reply to this email directly, view it on GitHub
<#10336 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACXPZM5AMEX2XP4I7LL5ISLVHGKBFANCNFSM5RRKOHBA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
The RealSense.dll files have the same filename whether generated for x86 or x64. I do not have details of a specific librealsense compilation procedure for Visual Studio. Microsoft do though provide guidance at the link below for setting the Configuration Manager of Visual Studio for the Win32 platform (x86) The Win32 platform name is used for C++ projects, and it means x86. Visual Studio considers both project-level platforms and solution-level platforms, and the project platforms come from the language-specific project systems. C++ projects use Win32 and x64, but the solution platforms use x86 and x64. When you choose x86 as the solution configuration, Visual Studio selects the Win32 platform for C++ projects. To see both project-level platform and solution-level platform settings, open Configuration Manager and note the two platform settings. The solution-level platform is shown in the Active solution platform dropdown, and the table shows the project-level platform for each project. For building with CMake, my understanding is that you can set the target platform with the build term CMAKE_GENERATOR_PLATFORM - for example, |
Ok I got it to work with cmake -A win32. I ran the rs-hello-realsense.cpp in debug and it crashes here: |
|
Works fine with D435 but crashes with D405 |
Not sure what this _Find_lower_bound code does. Is there a way to escalate to Realsense Engineer? |
_Find_lower_bound is part of VS C++ standard library implementation, but the bug must be somewhere higher in the call stack. |
Thanks very much for your ongoing debug process. Please continue logging it here and I will pass the results on to Intel when you have completed your tests. Good luck! |
I verified the same thing with compiling libraries in debug mode using cmake -a win32 vs cmake to generate the x64 debug libraries: Seems with source code and compiling of debug mode should be able to figure out what's the difference between x64 and x86 code for D405. Seems it crashes when it creates the device. I'm not really a cpp expert so considering outsourcing it. |
Thanks very much @henryjliu for your detailed testing. I have passed your debug findings to Intel. |
@henryjliu thanks for reporting the issue to RealSense team. we reproduced the problem and will investigate. In the meantime, please try the solution below. Remove/comment out the line highlighted below in src\ds5\advanced_mode\advanced_mode.cpp. The single line of code caused the library to crash with d405 but it's redundant. Removing it should fix the issue. https://github.com/IntelRealSense/librealsense/blob/master/src/ds5/advanced_mode/advanced_mode.cpp#L25 |
Thanks for the workaround - confirmed it works now but will warrant further testing. Not sure why it works fine in x64 and not x86 so prob should be deeper issue to be resolved. |
@henryjliu glad to know the workaround worked. thanks for the confirmation. on x86, a memory alignment issue on x86 along call stack in that particular line of code caused the crash. that's why the issue only appeared on x86. the rest of sdk use a different call stack, so the issue should not impact other areas. we have created an internal ticket to investigate it further to be sure. |
This issue has been resolved in RealSense SDK 2.51.1 (https://github.com/IntelRealSense/librealsense/wiki/Release-Notes#release-2511). |
Hi everyone, can anyone who reported an x86 dll problem on this case confirm if the x86 dll crash issue is resolved for them when using SDK 2.51.1 please? Thanks! |
rs-hello- realsense.cpp if compiled as:
x86 -> CRASH
x64 -> works.
Regards
The text was updated successfully, but these errors were encountered: