Skip to content

BUG in x86 DLL with D405Β #10336

Closed
Closed

Description

@POWER-KI
Required Info
Camera Model D405
Operating System & Version Win 10
SDK Version [Intel.RealSense.SDK-WIN10-2.50.0.3785.exe]

rs-hello- realsense.cpp if compiled as:
x86 -> CRASH
x64 -> works.

Regards

Activity

  1. MartyG-RealSense commented on Mar 24, 2022

    @MartyG-RealSense

    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.

    https://www.intel.com/content/www/us/en/support/articles/000030463/emerging-technologies/intel-realsense-technology.html

    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.

    https://docs.microsoft.com/en-us/visualstudio/ide/how-to-configure-projects-to-target-platforms?view=vs-2022

  2. POWER-KI commented on Mar 24, 2022

    @POWER-KI
    Author

    The pre-built works (but I think that is an X64 version).

    To check the problems:

    1. Open with VS(2019) rs-examples;
    2. compile hello-realsense and :
    • in x86 configuration it crash;
    • in x64 configuration it works.

    We have tested this because other programs tha we have with the new DLL crash.

    Regards,
    CAP

  3. POWER-KI commented on Mar 24, 2022

    @POWER-KI
    Author

    I think that the problems is in
    rs2_create_device(_list.get(), index, &e);

  4. MartyG-RealSense commented on Mar 24, 2022

    @MartyG-RealSense

    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

  5. changed the title [-]BUG in x86 DLL[/-] [+]BUG in x86 DLL with D405[/+] on Mar 25, 2022
  6. POWER-KI commented on Mar 25, 2022

    @POWER-KI
    Author

    The x86 DLL with:
    L515 works;
    D435 works;
    D405 CRASH.

  7. MartyG-RealSense commented on Mar 25, 2022

    @MartyG-RealSense

    I will highlight the issue to Intel to seek their feedback. Thanks very much for the report!

  8. MartyG-RealSense commented on Apr 1, 2022

    @MartyG-RealSense

    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.

  9. henryjliu commented on Apr 27, 2022

    @henryjliu

    Any update to this? We also need the x86 compiled version for D405

  10. MartyG-RealSense commented on Apr 27, 2022

    @MartyG-RealSense

    Hi @henryjliu There is no further information to provide at this time.

  11. henryjliu commented on Apr 27, 2022

    @henryjliu

    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?

            var ctx = new Context();
            var list = ctx.QueryDevices(); // Get a snapshot of currently connected devices
            if (list.Count == 0)
                throw new Exception("No device detected. Is it plugged in?");
    
            var dev = list[0];//throws system.accessviolationexception
    
  12. MartyG-RealSense commented on Apr 27, 2022

    @MartyG-RealSense

    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
    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

  13. 3 remaining items

  14. henryjliu commented on Apr 27, 2022

    @henryjliu
    template <class _Keyty>
    _Tree_find_result<_Nodeptr> _Find_lower_bound(const _Keyty& _Keyval) const {
        const auto _Scary = _Get_scary();
        _Tree_find_result<_Nodeptr> _Result{{_Scary->_Myhead->_Parent, _Tree_child::_Right}, _Scary->_Myhead};
        _Nodeptr _Trynode = _Result._Location._Parent;
        while (!_Trynode->_Isnil) {
            _Result._Location._Parent = _Trynode;
            if (_DEBUG_LT_PRED(_Getcomp(), _Traits::_Kfn(_Trynode->_Myval), _Keyval)) {
                _Result._Location._Child = _Tree_child::_Right;
                _Trynode                 = _Trynode->_Right;
            } else {
                _Result._Location._Child = _Tree_child::_Left;
                _Result._Bound           = _Trynode;
                _Trynode                 = _Trynode->_Left;
            }
        }
    
        return _Result;
    }
    
  15. henryjliu commented on Apr 27, 2022

    @henryjliu

    Works fine with D435 but crashes with D405

  16. henryjliu commented on Apr 27, 2022

    @henryjliu

    Not sure what this _Find_lower_bound code does. Is there a way to escalate to Realsense Engineer?

  17. bostjanv commented on Apr 28, 2022

    @bostjanv

    _Find_lower_bound is part of VS C++ standard library implementation, but the bug must be somewhere higher in the call stack.

  18. MartyG-RealSense commented on Apr 28, 2022

    @MartyG-RealSense

    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!

  19. henryjliu commented on Apr 29, 2022

    @henryjliu

    I verified the same thing with compiling libraries in debug mode using cmake -a win32 vs cmake to generate the x64 debug libraries:
    x64 D405 -> ok
    x86 D405 -> crash
    x64 D435 -> ok
    x86 D435 -> ok
    x64 L515 -> ok
    x86 L515 -> ok

    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.

  20. MartyG-RealSense commented on Apr 29, 2022

    @MartyG-RealSense

    Thanks very much @henryjliu for your detailed testing. I have passed your debug findings to Intel.

  21. gwen2018 commented on May 4, 2022

    @gwen2018
    Contributor

    @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
    // "Remove IR Pattern" visual preset is available only for D400, D410, D415, D460, D465
    std::string pid = _depth_sensor.get_info(RS2_CAMERA_INFO_PRODUCT_ID);

  22. henryjliu commented on May 5, 2022

    @henryjliu

    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.

  23. gwen2018 commented on May 6, 2022

    @gwen2018
    Contributor

    @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.

  24. RealSenseCustomerSupport commented on Sep 19, 2022

    @RealSenseCustomerSupport

    This issue has been resolved in RealSense SDK 2.51.1 (https://github.com/IntelRealSense/librealsense/wiki/Release-Notes#release-2511).

  25. MartyG-RealSense commented on Oct 7, 2022

    @MartyG-RealSense

    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!

  26. MartyG-RealSense commented on Oct 25, 2026

    @MartyG-RealSense

    Case closed due to the discussed issue having been resolved in SDK version 2.51.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions