Skip to content
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

Segmentation Faults Because of Small RAM Size??? #3341

Closed
ShadowHunter0510 opened this issue Feb 27, 2019 · 21 comments
Closed

Segmentation Faults Because of Small RAM Size??? #3341

ShadowHunter0510 opened this issue Feb 27, 2019 · 21 comments
Labels

Comments

@ShadowHunter0510
Copy link


Required Info
Camera Model D400
Operating System & Version Ubuntu 16
Platform Raspberry Pi

Issue Description

It appears that a few other users and I have been encountering segmentation faults on the Raspberry Pi. I believe that this may be because there is not enough dedicated RAM size. My program relies on an infinite loop, which would of course increase the chances of segmentation faults, since it tracks distance in real time. Perhaps is there any way to “clear” the data that would be obtained from each frame captured when the program loops again? The program may be storing this data that is only necessary for relaying the distance for one instance at a time.

@dorodnic
Copy link
Contributor

dorodnic commented Feb 27, 2019

From my experience, boards like this often come without configured swap file. Perhaps this is a better option?
Overall the memory footprint of the library is not that big, but it was also never designed for low-memory situations.

@ShadowHunter0510
Copy link
Author

Hi @dorodnic

I already have 2GB of swap file size. Should I increase this? Or is there an alternative solution?

@dorodnic
Copy link
Contributor

It should be plenty. Are you sure the issue is related to out-of-memory situation? What data are you seeing using htop?

@ShadowHunter0510
Copy link
Author

@dorodnic

After using htop, I noticed that the memory used just hovers around 450 MB. It jumps to around maximum capacity right when the program starts and periodically increases with every frame captured. I’m not very sure what is causing this issue.
2d23127a-2df9-4d66-995c-cae30306c4f3
60e2441b-c732-4016-9e9c-8fdccdd65b61

@dorodnic
Copy link
Contributor

Are you getting stable memory when running rs-capture and other examples?
There was issue of memory leak with python that was localised to a leak in numpy (#3164), perhaps this can be related?

@ShadowHunter0510
Copy link
Author

ShadowHunter0510 commented Mar 1, 2019

Hi @dorodnic

Yes, memory hovers around 290 MB when running rs-capture. Would reverting NumPy to a previous version affect my code?

@dorodnic dorodnic added the python label Mar 2, 2019
@dorodnic
Copy link
Contributor

dorodnic commented Mar 2, 2019

I think it should be fine. I'm just suggesting one possible source for the problem. Perhaps the application is doing some additional heavy processing, maybe storing multiple frames?

@RealSenseCustomerSupport
Copy link
Collaborator


@ShadowHunter0510 Any update for Dorodnic's question? Thanks!

@jdwolk
Copy link

jdwolk commented Mar 9, 2019

@dorodnic I'm also getting segfaults for, i.e. rs-depth, rs-color, etc, on Beaglebone Black. I have a 2G swap file allocated also.

My specs:

  • Beaglebone Black
  • Ubuntu 16.04
  • Kernel 4.4
  • D435, firmware 05.11.01.100
  • librealsense 2.18.1 (also got the same thing on 2.19.0)

In my case, I'm also getting "rs_error was raised when calling rs2_pipeline_wait_for_frames(pipe:0x5bf818) Frame didn't arrived within 5000" before the segfault of most of these tools.

realsense-viewer launches for me (I'm using lxde as a lightweight desktop) + recognizes the camera over USB 2 but I can't flip the "switches" on the left.

@RealSenseCustomerSupport
Copy link
Collaborator


@jdwolk Did you try if you still get segmentation fault with rs-depth if change to lower resolution or FPS? Such as 480x270@30fps or 640x480@15fps

@RealSenseCustomerSupport
Copy link
Collaborator


@jdwolk Any update? Thanks!

@jdwolk
Copy link

jdwolk commented Mar 29, 2019

We ended up moving to Raspberry Pi which opened up separate issues (see IntelRealSense/realsense-ros#652, IntelRealSense/realsense-ros#669 ). I can try again in a few days with the Beaglebone.

@RealSenseCustomerSupport
Copy link
Collaborator


@jdwolk Any update? Thanks!

@RealSenseCustomerSupport
Copy link
Collaborator


@jdwolk Do you still need support on this issue? Please update. Thanks!

@filipematosinov
Copy link

I am having similar behaviour with the Raspberry Pi. Getting segmentation fault using the realsense-viewer or python scripts using pyrealsense2.

@RealSenseCustomerSupport
Copy link
Collaborator


@filipematosinov Did you try rs-depth to see if it works or not?

@RealSenseCustomerSupport
Copy link
Collaborator


@filipematosinov @jdwolk @ShadowHunter0510 Any other questions for this ticket? Please update. Thanks!

@filipematosinov
Copy link

I have tried rs-depth having the same issue

@RealSenseCustomerSupport
Copy link
Collaborator


@filipematosinov What's the resolution and FPS configuration when you get issue for rs-depth?

@RealSenseCustomerSupport
Copy link
Collaborator


@filipematosinov Looking forward to your reply? Could you please update? Thanks!

@RealSenseCustomerSupport
Copy link
Collaborator


@filipematosinov If no other questions, will close the ticket at this point. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants