[OpenSmalltalk/opensmalltalk-vm] c7171f: Ensure readable error message for VM module dlopen...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[OpenSmalltalk/opensmalltalk-vm] c7171f: Ensure readable error message for VM module dlopen...

Eliot Miranda-3
 
  Branch: refs/heads/dtl/vm-module-load-error-messages
  Home:   https://github.com/OpenSmalltalk/opensmalltalk-vm
  Commit: c7171f4ac4436cc6e67497dbfef69e761ff2a071
      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/c7171f4ac4436cc6e67497dbfef69e761ff2a071
  Author: David T. Lewis <[hidden email]>
  Date:   2019-10-13 (Sun, 13 Oct 2019)

  Changed paths:
    M platforms/unix/vm/sqUnixExternalPrims.c

  Log Message:
  -----------
  Ensure readable error message for VM module dlopen failures.
If a module such as vm-display-X11 fails to load due to dynamic linking
errors such as symbol not found or missing runtime libary on the target
machine, then provide a meaningful error message.
Eliminate unnecessary check for if (strstr(why,"undefined symbol")) {...}
because it eats errors, e.g. in the case of missing xRender runtime
and VM compiled with xRender dev libaries.
Improve the error message for readability. Add fflush() for stderr
output to prevent messages being lost or mixed with stdout. Remove
redundant and unreachable code.

Note, duplicate error messages on for load failures may occur due
to path setup issues in the /bin/squeak start script, are are not
a VM issue per se.

Example error message for VM compiled with xRender library for large
cursor support, and run on a machine with missing runtime library:

vm-display-X11 tryLoading /usr/local/lib/squeak/5.0-201910110209/vm-display-X11.so: dlopen: libXrender.so.1: cannot open shared object file: No such file or directory