Link to home
Start Free TrialLog in
Avatar of Bvm 18
Bvm 18

asked on

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

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
Avatar of arnold
arnold
Flag of United States of America image

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.
Avatar of Bvm 18
Bvm 18

ASKER

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
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.
ASKER CERTIFIED SOLUTION
Avatar of Bvm 18
Bvm 18

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial