Community
Participate
Working Groups
Build Identifier: 3.5.0.v20090525 Bash has 2 ways to include the current directory in your PATH: by including a . entry in PATH, or by including an 'empty' entry, via either a leading or trailing : in the PATH. We have an RCP application for Linux GTK x86; if you unzip it in /home/foo/app, and the RCP binary is named LaunchApp, then the following happens: 1 - CWD is /home/foo/app, ./LaunchApp works, no matter the PATH 2 - CWD is /home/foo/app, PATH includes . ; LaunchApp works 3 - CWD is /home/foo, PATH includes /home/foo/app ; LaunchApp works 4 - CWD is /home/foo/app, PATH has an empty entry ; ./LaunchApp works but LaunchApp segfaults Not a huge issue, since as the above shows there are many workarounds, but still indicative of a bug in the code, and potentially annoying to someone who uses an empty entry instead of . to put the working directory in their PATH. Attached is strace output from the segfault case; it appears that the launcher tries to find the last / char in some path, and then get the length of the string after that, but with no /, it gets NULL and then does a strlen(NULL) which segfaults. Reproducible: Always Steps to Reproduce: 1. Install an RCP application in a directory. 2. cd to that directory 3. Set your PATH to have an empty entry: export PATH=:$PATH 4. Launch the application without using ./
Created attachment 189405 [details] Strace from a segfault'ing launch Shows the strlen(NULL) which causes the segfault, plus the strrchr('/') which fails to find a '/' character and returns NULL.
The launcher tries to find the absolute path to itself by scanning the PATH. It does not know to treat an empty entry as the CWD. This leaves us with a NULL programDir location. The segfault here is in eclipseMain/findLibrary() on the line progLength = pathLength = _tcslen(programDir); Similarly, I expect if the .ini file specifies a --launcher.library argument then there would be one in eclipseCommon/checkPath
Created attachment 191541 [details] patch
Patch was released to HEAD