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

stage1: fix lost argv[0] #3292

Merged
merged 1 commit into from Sep 22, 2019
Merged

stage1: fix lost argv[0] #3292

merged 1 commit into from Sep 22, 2019

Conversation

mikdusan
Copy link
Member

  • bug presented on FreeBSD when /proc filesystem is not mounted
  • bogus cc was used as exename, causing incorrect executable spawn
  • llvm::sys::fs::getMainExecutable() has platform-specific code
    to get exename and fallback is to use param argv0
  • linux fallback is rare because /proc is usually mounted
  • *BSD fallback is not rare because /proc is often not mounted
  • macOS doesn't ever fallback: bug cannot present
  • windows doesn't ever fallback: bug cannot present
  • other Posix will always present

- bug presented on FreeBSD when `/proc` filesystem is not mounted
- bogus `cc` was used as exename, causing incorrect executable spawn
- llvm::sys::fs::getMainExecutable() has platform-specific code
  to get exename and fallback is to use param argv0
- linux fallback is rare because `/proc` is usually mounted
- *BSD fallback is not rare because `/proc` is often not mounted
- macOS doesn't ever fallback: bug cannot present
- windows doesn't ever fallback: bug cannot present
- other Posix will always present
@andrewrk andrewrk merged commit c571671 into ziglang:master Sep 22, 2019
@andrewrk
Copy link
Member

Wonderful, thank you!

@mikdusan mikdusan deleted the freebsd-stage1 branch September 22, 2019 17:14
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.

None yet

2 participants