Curl Command Fails After MindIE Is Installed

Symptom

After the MindIE environment variable file is executed via the following command, the error message "symbol lookup error: /usr/lib64/libldap.so.2: undefined symbol: EVP_md2" is displayed, as shown in the following figure.

source /usr/local/Ascend/mindie/set_env.sh

Cause Analysis

The EVP_md2 function insecure, and MindIE legacy compilation is not enabled by default because of its dependency on OpenSSL. Therefore, the EVP_md2 function is not provided. After MindIE environment variables are sourced, the libcrypto.so file provided by the MindIE installation package has a higher priority. Consequently, curl command, which depends on the EVP_md2 function, fails, resulting in an execution error.

Solution

  • Method 1:

    Open a new terminal and run the curl command. If the terminal automatically executes set_env.sh to source MindIE environment variables, run the unset LD_LIBRARY_PATH command to prevent the system from preferentially searching for libcrypto.so in the installation package.

  • Method 2:

    Run the curl command on another host or a container where the cURL function is normal.

  • Method 3:

    Use LD_PRELOAD to specify the original crypto.so.3 in the system. See the following example:

    LD_PRELOAD=/usr/lib64/libssl.so.3:/usr/lib64/libcrypto.so.3 curl http://<ip>:<port>/<your_path>