You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I could not narrow it down so far but sometimes the socket gets closed and removed from the filesystem. However the lock is still present, so one has to manually delete the lock file.
I suspect some EAGAIN failure on reading/writing to the descriptor but I have been unable to correctly trace this so far.
The text was updated successfully, but these errors were encountered:
vtrlx
added a commit
to vtrlx/sam
that referenced
this issue
Apr 29, 2024
Previously, using any command that forked sam would run the odd risk of causing sam's control socket to exit. This seems to be a consequence of using atexit() to schedule removal of the control socket from the file system.
This commit adds a global boolean named forked, which is set to true in child process after they are forked. The exit handlers removesocket() and rmsocket() are changed such that they don't remove the control sockets if the forked boolean is set to true.
Sam's control socket should only get removed once the main instance exits.
Fixesdeadpixi#75
I believe I've narrowed the issue down to the use of atexit().
From the function's man page,
When a child process is created via fork(2), it inherits copies of its parent's registrations. Upon a successful call to one of the exec(3) functions, all registrations are removed.
I suspected that the removal of registrations after an exec() was not actually being done, so I ran a small test.
Start up Sam.
Use the B shell command to open files in Sam, verifying it works.
Use the ! command in Sam.
Again use the B shell command, and it no longer functions.
I've opened a pull request with a naïve fix that seems to work, based on my using several shell commands in this session of Sam as well as many invocations of B from my shell… → #130
I could not narrow it down so far but sometimes the socket gets closed and removed from the filesystem. However the lock is still present, so one has to manually delete the lock file.
I suspect some EAGAIN failure on reading/writing to the descriptor but I have been unable to correctly trace this so far.
The text was updated successfully, but these errors were encountered: