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

Symptom

The file name and line number are displayed as <unknown>:0, or the file name is correct 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 set to check the CANN software stack memory, you can import the Sanitizer API header file and rebuild the user program so that the check tool can obtain the correct file name and line number. For details, see here.
    • If exception check 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.

    This problem generally 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.