Skip to content

OpenNI driver will segfault when openDevice fails #1009

Open
@enbyted

Description

@enbyted

Overview Description:

Version, Platform, and Hardware Bug Found:

  1. Latest git master version
  2. Linux ubuntu 4.10.0-9-upboard Remove boost thread dependency #11~16.04.1 SMP Wed Oct 25 17:10:46 IST 2017 x86_64 x86_64 x86_64 GNU/Linux

Steps to Reproduce:

  1. Connect kinect v2 in such a way that it will be properly enumerated, but not openable
  2. Try to open it using OpenNI driver

Actual Results:

Segafault:

#0  0x00007fffd9e86ada in Freenect2Driver::Driver::deviceOpen(char const*, char const*) () from /usr/lib/OpenNI2/Drivers/libfreenect2-openni2.so.0
#1  0x00007fffee4fa9f2 in ?? () from /usr/lib/libOpenNI2.so.0

Expected Results:

Returning NULL from Freenect2Driver::Driver::deviceOpen

Reproducibility:

In my case the problem was that PCI-e and USB3 line was shared in SoC and this caused the Kinect to be properly enumerated on Linux, but not to be actually used.

Additional Information:

The problem is here:

freenect2.openDevice(id) reports [Error] [Freenect2Impl] failed to open Kinect v2: @1:5 and returns NULL as expected.
setFreenect2Device should handle NULL being passed as an argument. It might be more convenient to perform NULL check in deviceOpen before DeviceImpl is constructed as setFreenect2Device is only used there.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions