my application makes /dev empty. what could be the reason?

Bvm 18
Bvm 18 used Ask the Experts™
on
HI,

  I am developing a C++ application with libfuse on rhel 6.10. And, also a simple test application also there.

  When I run my test application with same arguments to fuse_main, works fine. But, with actual application, /dev becomes empty (corrupted).  I don't understand why this corrupts machine. I am running these apps with non-root user. added non-root user to fuse group as well as changed permissions to fusermount too.

   In which cases, /dev becomes empty due to any application.

Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Distinguished Expert 2017

Commented:
without seeing your code, it is likely there where you try to do something to /dev/ possibly overlaying it with a partition/device

i.e. instead of creating a /dev/mytool
you call the overlay and specify /dev as the path

presumably when you reboot, /dev/ returns to its normal sefl since you did not mention you have to reinstall/fix...

to your last question, an errand entry in an application that does something it should not.


it would be similar to running
mount -o loopback  file.isp /dev

now /dev/ reflects the contents of the file.iso

a typo in the variable device versus Device will convert the '/dev'',Device  /dev/device into /dev/ when the variable used does not exist or is null.

often the compile should kick out the error that an undefined variable is being accessed, but depending on the disposition at the time, a quick definition of the variable, gets rid of the error which manifests in the wrong overlay.

Author

Commented:
Hi arnold,

   Thanks for your response.

   I consumed libfuse apis in my application. I haven't touched anything from /dev/fuse.

   But, when my application failed only on rhel 6.10 with fuse 2.8.3, works fine on rhel7.6 with fuse 2.9.2. It's very suspecious what my application is doing on rhel6.10. how to catch this bug?

Thank you,
bvm
David FavorFractional CTO
Distinguished Expert 2018

Commented:
Several items.

1) You don't explain what "/dev is corrupt" might mean.

If /dev/* files are missing, then very likely arnold's suggestion explains why.

2) RHEL 7.x uses a nearly 3 year old Kernel now.

If you're working on a new libfuse project, update to RHEL 8 (4.18 Kernel) or other Distro like Ubuntu Bionic. In other words, start with a recent Kernel.

3) You might try simply running the mount command to see if you see an overlay mount like arnold suggested.
Commented:
link broken between /etc/mtab and /proc/mounts on rhel6.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial