X
91

What to do if ENVI/IDL are crashing on MacOS due to an XML, Xerces or libc++abi “TranscodingException” error

NOTE: This issue could affect any version of ENVI/IDL on any platform but is most likely to occur on MacOS.

 

Problem:

When launching ENVI on MacOS, you may encounter a crash as it loads up. Depending on how ENVI was launched, the crash may or may not be accompanied by the following error message:

 

/Applications/NV5/envi60/bin: ./envi

IDL 9.0.0 (darwin x86_64 m64).

(c) 2023, NV5 Geospatial Solutions, Inc.

Licensed for use by: NV5 Geospatial Solutions

License: XX1234XXX

% Loaded DLM: XML.

libc++abi: terminating with uncaught exception of type

xercesc_3_2::TranscodingException

Abort trap: 6

 

You can also encounter a similar error/crash in IDL when using certain routines, such as XML_PARSE:

 

IDL> a =xml_parse('foo.xml')

% Loaded DLM: XML.

libc++abi: terminating due to uncaught exception of type xercesc_3_2::TranscodingException

Abort

 

Solution:

The problem is most likely due to the LANG environment variable not being set properly on your system causing the Xerces-C++ XML Parser library to crash.

When you run this command in terminal (ENVI license only):

     printenv | grep LANG

Or if you have access to IDL licensing, it is better to check from within IDL to verify with this command:

                IDL> getenv(‘LANG’)

In either case, you should get an output like this which is correct (will vary depending on your region and language):

LANG=en_US.UTF-8

If you run those commands and receive an empty string, LANG is not set properly in your ENVI/IDL environment. This following result is also not correct and could also crash ENVI/IDL:

 LANG=en_US.US-ASCII    

To resolve this crashing issue, make sure to set the LANG environment variable properly in terminal first and then relaunch ENVI/IDL.

export LANG=en_US.UTF-8

*Launch ENVI or IDL*

 

 

 

 

 

Created by BC on 03/04/2024 | Reviewed by MT on 03/15/2024