View Issue Details

IDProjectCategoryView StatusLast Update
0020296FPCRTLpublic2016-01-05 18:51
ReporterLudo Brands Assigned ToMarco van de Voort  
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionunable to reproduce 
Platformi386OSWindows  
Product Version2.7.1 
Summary0020296: Recent changes in dwarf crash heaptrc in lnfodwrf.pp
Descriptionlnfodwrf.pp has problems reading the dwarf debug info and crashes in LNFODWRF_SEEK$INT64. fpc 2.5.1 dated april 1 (I don't have the svn version) doesn't have this problem.

Note that lazarus svn defaults now to dwarf on windows.

Steps To Reproduceprogram test;

var p:pointer;
begin
  getmem(p,5);
end.

compile with -gw2 -gl -gh and run. Output:
Heap dump by heaptrc unit
1 memory blocks allocated : 5/8
0 memory blocks freed : 0/0
1 unfreed memory blocks : 5
True heap size : 98304 (80 used in System startup)
True free heap : 98144
Should be : 98152
Call trace for block $00065180 size 5
Runtime error 131 at $0040B451
  $0040B451
  $0040BD4C
  $0040C1F2
  $0040C282
  $00409303
  $0040AFB7
  $00408381
TagsNo tags attached.
Fixed in Revision
FPCOldBugId
FPCTarget
Attached Files

Relationships

has duplicate 0023030 resolvedJonas Maebe Cannot run heaptrc when compiling with Dwarf with sets ( -gw -godwarfsets) on Win64 

Activities

Ludo Brands

2011-09-19 19:50

developer   ~0052039

Debugged lnfodwrf.pp. The problem is that the program assumes that information in .debug_line consists of a contiguous sequence of valid line information blocks. This is a shortcut that apparently worked at one time. Now rubbish is inserted in between line info blocks.
To correct this, compilation units have to be fetched from .debug_info and the DW_AT_stmt_list attribute give the offset in .debug_line.

Marco van de Voort

2011-10-13 21:59

manager   ~0052957

Last edited: 2011-10-13 22:13

debug_info is dwarf2 specific afaik, so probably need to fallback to the old behaviour if debug_info is not found.

(added later), hmm, might be wrong, spec says .debug was renamed to .debug_info, so it is still possible it is in dwarf1, just in different section.

Jonas Maebe

2011-10-14 00:29

manager   ~0052963

FPC does not and has never supported DWARF1.

Reinier Olislagers

2013-03-28 10:35

developer   ~0066596

Can somebody have a look at this? If this is the cause of the problems with debugging Lazarus programs, it would be nice to have this fixed.

Reinier Olislagers

2014-09-06 13:38

developer   ~0076930

This seems fixed meanwhile: with r28606:
Heap dump by heaptrc unit
1 memory blocks allocated : 5/8
0 memory blocks freed : 0/0
1 unfreed memory blocks : 5
True heap size : 98304 (80 used in System startup)
True free heap : 98144
Should be : 98152
Call trace for block $01709350 size 5
  $00401457 line 5 of debug.lpr
  $30303030
  $41003030
  $53554C4C
  $50535245
  $49464F52
  $433D454C
  $72505C3A

Marco van de Voort

2014-09-06 15:55

manager   ~0076937

Old report, seems to be already fixed, as Reinier says.

Issue History

Date Modified Username Field Change
2011-09-19 09:50 Ludo Brands New Issue
2011-09-19 19:50 Ludo Brands Note Added: 0052039
2011-10-13 21:59 Marco van de Voort Note Added: 0052957
2011-10-13 22:00 Marco van de Voort Note Edited: 0052957
2011-10-13 22:13 Marco van de Voort Note Edited: 0052957
2011-10-14 00:29 Jonas Maebe Note Added: 0052963
2012-10-01 10:55 Martin Friebe Relationship added related to 0023030
2012-10-01 13:20 Jonas Maebe Relationship replaced has duplicate 0023030
2013-03-28 10:35 Reinier Olislagers Note Added: 0066596
2014-09-06 13:38 Reinier Olislagers Note Added: 0076930
2014-09-06 14:09 Reinier Olislagers Status new => feedback
2014-09-06 15:55 Marco van de Voort Note Added: 0076937
2014-09-06 15:55 Marco van de Voort Status feedback => resolved
2014-09-06 15:55 Marco van de Voort Resolution open => unable to reproduce
2014-09-06 15:55 Marco van de Voort Assigned To => Marco van de Voort