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
Original bug ID: 4788 Reporter: sacerdot Status: closed (set by @xavierleroy on 2015-12-11T18:21:24Z) Resolution: fixed Priority: normal Severity: minor Version: 3.11.0 Target version: 4.01.0+dev Fixed in version: 4.01.0+dev Category: ~DO NOT USE (was: OCaml general) Related to:#3928 Monitored by:@hcarty db
Bug description
Debug symbols for executables compiled with -g are read directly from the executable file, but the latter is searched in the current directory. Thus,
if the program does a Sys.chdir to another directory, the executable is not found. The very misleading error message the user gets is "(Program not linked with -g, cannot print stack backtrace)" in place of "Executable program not found in $CURRENTDIR". Obviously, an even better solution would be to always look for the executable in the path the program was launched.
The program in attachment shows the problem (unless you run it from /tmp, of course :-)
Really? My impression was that under Linux bytecode full path is taken on startup from /proc/self/exe. Other OSes search system $PATH for argv[0]. In both cases current directory should not affect the process. But I agree that something like "Bytecode file not found, cannot print stack backtrace" would be better.
I've changed the error message in case the executable file is not found (branch 4.01, rev 13966 and 13967).
The solution is not perfect, because when the current directory contains another a.out compiled by OCaml with symbols, you get a bogus backtrace instead of an error message. Backtraces are for debugging, so I guess we can live with this.
Original bug ID: 4788
Reporter: sacerdot
Status: closed (set by @xavierleroy on 2015-12-11T18:21:24Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 3.11.0
Target version: 4.01.0+dev
Fixed in version: 4.01.0+dev
Category: ~DO NOT USE (was: OCaml general)
Related to: #3928
Monitored by: @hcarty db
Bug description
Debug symbols for executables compiled with -g are read directly from the executable file, but the latter is searched in the current directory. Thus,
if the program does a Sys.chdir to another directory, the executable is not found. The very misleading error message the user gets is "(Program not linked with -g, cannot print stack backtrace)" in place of "Executable program not found in $CURRENTDIR". Obviously, an even better solution would be to always look for the executable in the path the program was launched.
The program in attachment shows the problem (unless you run it from /tmp, of course :-)
File attachments
The text was updated successfully, but these errors were encountered: