Skip to content

fix: exe path resolution bug#358

Merged
ethanpailes merged 1 commit intomasterfrom
investigate-no-new-shell
May 1, 2026
Merged

fix: exe path resolution bug#358
ethanpailes merged 1 commit intomasterfrom
investigate-no-new-shell

Conversation

@ethanpailes
Copy link
Copy Markdown
Contributor

Issue Link

n/a I just hit this myself and spotted it in the logs. There is a google internal bug that's pretty useless on a public issue tracker that I think is relevant.

AI Policy Ack

ack

This PR was:

  • mostly or completely vibe coded
  • mostly or completely meat coded
  • bit of both

I meat coded the fix and vibed the test.

Description

When the shpool daemon binary gets overwritten, linux will start appending ' (deleted)' to the exe path. This causes problems when we self-exec. This has started happening to me pretty regularly and I think it is because of package updates silently overwriting the binary with a new version under the hood.

I think this is the underlying cause that caused the bug I fixed in #348.

This bug was introduced when we did the mac port (in 7030966).

@ethanpailes ethanpailes force-pushed the investigate-no-new-shell branch from 954fc13 to c79d22b Compare April 30, 2026 22:27
@ethanpailes ethanpailes requested a review from maxhbooth April 30, 2026 22:29
@ethanpailes ethanpailes force-pushed the investigate-no-new-shell branch 2 times, most recently from 4af41fb to f6c8ec0 Compare April 30, 2026 22:40
Comment thread libshpool/src/exe.rs

if cfg!(target_os = "linux") {
if let Some(path_str) = path.to_str() {
if let Some(stripped) = path_str.strip_suffix(" (deleted)") {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should include a comment string here explaining a little more of why we need to do this since it's not obvious why a path would ever contain deleted anyway (e.g. that /usr/bin/shpool (deleted) is clearly not the actual path, but it could get output when we ask the linux kernel.)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, done.

When the shpool daemon binary gets overwritten, linux
will start appending ' (deleted)' to the exe path. This
causes problems when we self-exec. This has started happening
to me pretty regularly and I think it is because of package
updates silently overwriting the binary with a new version
under the hood.

I think this is the underlying cause that caused the bug
I fixed in #348.

This bug was introduced when we did the mac port (in 7030966).
@ethanpailes ethanpailes force-pushed the investigate-no-new-shell branch from f6c8ec0 to a679370 Compare April 30, 2026 23:46
@ethanpailes ethanpailes merged commit 8aa82de into master May 1, 2026
7 checks passed
@ethanpailes ethanpailes deleted the investigate-no-new-shell branch May 1, 2026 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants