How to Report a C++ Compiler or Linker Problem

From RAD Studio
Jump to: navigation, search

Go Up to C++ Compiler


How to report a Compiler problem

Enable Diagnostic Verbosity

  • Go to Tools > Options > Compiling and Running.
  • Change the Verbosity drop down to Diagnostic.

Verbosity.png

  • Do a build of the project.
  • Save the messages from the Output tab of the Messages Pane to a text file.

Save messages.png

  • Attach the text file to your bug report.

Include Preprocessed files

When reporting a compiler crash, the report should contain a narrowed down testcase that illustrates the crash. If that is not possible, then include a Preprocessed copy of the source file that causes the crash.

To create a Preprocessed file, right click on the source file that crashes in the Project Manager and select Preprocess. The IDE will create a .i file. Save that file and include it with the report.

Preprocess.png

You must add the compiler command line to your report, as shown in the Output tab of the Message View.

Copy.png

Command Line: Build vs Output Tab

It is easier to copy the Command Line from the Build tab but it is preferable to copy the Command Line included with your report from from the Output tab because the Build tab wraps long command lines.

How to report a Linker problem

With the case of the linker crashes, R&D team usually needs the whole linkset to reproduce the issue.

Attention: Only objects and libraries are necessary, if you cannot provide the source code is generally fine for linker issues.

Get Linker Team to Lookup XXX#### Code

If it is a Fatal: Error detected (XXX####), the linker team can look up the error (the three letters represent a linker source file and the numbers the line number) and maybe provide some guidelines about what might be happening. In some cases, this points to the compiler generating a bad object file.

Posible workarounds for Linker problems

Turn Off Incremental Linking

Turn off Incremental linking; Clean the Project and Rebuild. This can help with ilink32 but does not help with ilink64 as -Gn is hardcoded in the IDE for WIN64.

Bump Heap Sizes (For Out of memory)

For ilink64, if the error is Fatal: Out of memory, the -GH switch can help. First you need to make ilink64 LARGE ADDRESS AWARE. To do that use the editbin utility provided with Visual Studio:

editbin.exe /LARGEADDRESSAWARE $BDS/bin/ilink64.exe

Then you use the -GH switch to increase the heap that was overflowed. For example, a typical failure might report:

Turbo Incremental Link64 6.72 Copyright (c) 1997-2015 Embarcadero Technologies,

Inc.

Overrun on linker heap: dwarf_info

...

dwarf_info 0x06039000 0x06000000

...

Fatal: Out of memory

The dwarf_info heap overflowed. To remedy we ask the linker to allocate a bigger size via: -GHdwarf_info=0x0E000000. You might find that after increasing one heap, another one overflows. So the final command line might read:

-GHinfo=0x24000000 -GHdwarf_info=0x0E000000 -GHbss=0x0E000000 -GHdwarf_str=0x0A000000 -GHdwarf_line=0x06000000 -GHcode=0x0E000000

Out of Memory and Unknown Heap error

Sometimes ilink32 raises an OOM and then Unknown Heap error (normally that unknown heap is tds).

This workaround may help:

In the IDE:

  1. Go Project > Options > C++ Linker > Advanced > Additional options
  2. Add -GHtds=0x0A000000.
  3. Try to link again.

See Also