PRB: SymGetLineFromAddr May Fail With Error 487 (220913)



The information in this article applies to:

  • Microsoft Win32 Application Programming Interface (API), when used with:
    • the operating system: Microsoft Windows 95
    • the operating system: Microsoft Windows 98
    • the operating system: Microsoft Windows Millennium Edition
    • the operating system: Microsoft Windows NT 4.0
    • the operating system: Microsoft Windows 2000
    • the operating system: Microsoft Windows XP

This article was previously published under Q220913

SYMPTOMS

The SymGetLineFromAddr() ImageHlp API sometimes fails with error 487 when it cannot find the source line information corresponding to the specific virtual address.

CAUSE

By default the symbol handler does not load the line number information. Moreover, the symbol information for a module is positioned based on the symbol search path associated with the process.

MORE INFORMATION

An application specifies the SYMOPT_LOAD_LINES mask in the SymSetOptions() API to indicate that the symbol handler loads the line number information when the symbols are located for a module. The symbol information for a module is loaded when the bInvade parameter is passed as TRUE and SymInitialize() is called. Alternatively, an application can also use SymLoadModule to load the symbol information of a specified module or the symbol handler loads it as deferred until a reference is made requiring the symbols be loaded. If the SYMOPT_LOAD_LINES option is not set before the symbol information is loaded, the SymGetLineFromAddr() API fails and GetLastError() returns the 487 error (ERROR_INVALID_ADDRESS).

Finally, the symbol handler uses the symbol search path to locate the symbol file. If the symbol file cannot be located by the symbol handler, SymGetLineFromAddr() API fails with the same error.

Modification Type:MinorLast Reviewed:9/27/2004
Keywords:kbAPI kbBug kbDebug kbKernBase kbprb KB220913