6050
BUS Error When Running or Starting IDL 6.3 on Mac OSX
Topic:
In IDL 6.3, when a user or program makes its first
graphics or
widget call and the
DISPLAY environment variable is not set, IDL 6.3 can crash reporting the Bus Error message. The following errors are actual screen shots from a
Terminal window on two different Mac systems:
Example: 1 (user is able to launch idl but receives the error as soon as the plot command is used.)
IDL> plot,indgen(10)
Bus error
Example: 2 (user is unable to launch IDL.)
% idl
IDL Version 6.3, Mac OS X (darwin ppc m32). (c) 2006, Research Systems, Inc.
Installation number: xxxxxx.
Licensed for personal use by XXXXX only.
All other use is strictly prohibited.
Bus error
This problem is most common on IDL for Mac OS X, when IDL has been launched from Mac's (not X11's) native Terminal application. (Note that calling idlde in this DISPLAY-less scenario fails in the middle of IDL initialization with no error displayed.) This problem might also occur on other UNIX / X platforms, but would be unusual since the DISPLAY variable is almost always properly set in those environments.
The workaround for this is quite straightforward: Simply make sure that a DISPLAY variable is properly defined in your terminal's environment. The Discussion below gives details on how to do this.Discussion:
This behavior is new to IDL starting with version 6.3. Before that Mac users could successfully start an independent X11 process, then later start IDL from a native Mac Terminal window, and IDL graphics calls would work even if the Terminal had no defined DISPLAY environment variable. Technically this scenario should always have thrown an error, but it is only new code in IDL 6.3 supporting multi-monitor displays that made IDL 6.3 incompatible with this scenario. IDL 6.3 graphics or widget calls cannot properly communicate with the Display's controller, triggering the Bus Error. Exelis VIS has already developed the workaround for this incompatibility for IDL's next release.
RESOLUTION: To fix this problem you simply have to define a proper DISPLAY variable in your terminal's environment. We would recommend accomplishing this through a shell resource file in your home directory. Thus, if your terminal "shell" is a bash shell (most common on Mac), then you could create or append to a file in your home directory named .bashrc with the following line:
If your terminal "shell" is a c-shell or tc-shell, then the home directory file to use/create would be .cshrc, and this would be the line that is needed:
If you do not know which shell your terminal uses, you can find that out with the UNIX command "echo $SHELL". Note that you do not have to make the above calls in a shell resource file; you could always make those calls on the fly right before you call IDL or IDLDE. Finally, note that it is critical that you have started your Mac's X11 application before you make the IDL or IDLDE call from the native Mac Terminal.Solution: