msSanitizer Exception Report Does Not Display the Correct File Name and Line Number

Symptom

The file name and line number are displayed as "<unknown>:0", or the file name is displayed correctly but the line number is displayed as "0".

Solution

  • The file name and line number are displayed as "<unknown>:0".
    The msSanitizer tool fails to parse the correct file name and line number. You can use either of the following methods to solve the problem:
    • If the "--check-cann-heap=yes" option is enabled to check the CANN software stack memory, you can import the Sanitizer API header file and recompile the user program to enable the detection tool to obtain the correct file name and line number, for details, please refer to the new API provided by the mssanitizer detection tool.
    • If exception detection is being performed on the operator, the possible cause is that the -g option is not enabled during operator compilation. The correct file name and line number can be generated only after the -g option is enabled. For details, see kernel launch symbol.
  • The file name is correct, but the line number is "0".

    Generally, this problem occurs because the -O2 or -O3 compilation option is used to compile the operator code. When the compiler optimizes the operator code, the code line changes. You can use -O0 to disable compiler optimization during operator compilation to solve this problem.