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

Check maps don't change underneath us ... #10127

Open
mmeeks opened this issue Sep 25, 2024 · 0 comments
Open

Check maps don't change underneath us ... #10127

mmeeks opened this issue Sep 25, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@mmeeks
Copy link
Contributor

mmeeks commented Sep 25, 2024

Perhaps this is only something a developer would ever see - but I just had a loop crash where the kit would immediately crash as the forkit process forked; it seemed to crash in the seg-fault handler - which is/was interesting in itself.

Sadly I was distracted before I could get to see what was causing that - but I suspect that DOSs changing underneath us can cause a SIGBUS that in turn will prolly cause backtrace() to have problems.

As a thought we already have some degree of paranoia about checking our Jail has not been deleted underneath us; I expect it would be useful to add more of this in the forkit.

I would suggest:

  • after the first LOK initialize and pre-init that we:
  • read /proc/self/maps - and extract all of the DSO filenames - ending that contain ".so" - and executable
  • we stat all of these - and store their size and (I guess) inode number if we can get it
  • when a KIT process crashes, we do a sanity check to see if the system underneath us changed in some unpredictable way
  • and if so exit the forkit - which should trigger coolwsd to re-start it with a new forkit process

Hopefully that would catch some of the more esoteric problems we seem to have on upgrades =)

Of course, hopefully packaging systems do large, atomic updates of everything, and our mmaps will continue to map the previous files which will be released when we exit but ... =)

@mmeeks mmeeks added the enhancement New feature or request label Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: No status
Development

No branches or pull requests

1 participant