<html><head></head><body><div>Below are more debug messages:</div><div><span><pre><br></pre></span></div><div>On Fri, 2021-11-12 at 19:58 +0100, Abou Al Montacir wrote:</div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><div>Hi Michalis,</div><div><br></div><div>Thank you for the patch. I failed to test it as I need first to fix pasdoc on sparc64.</div><div>For this, I've installed a QEMU VM which took me two days, but now I'm able to debug it.</div><div><br></div><div>The issue with pasdoc, looks very similar with the issue of CGE with Armel. Not sure it is the very same, but I feel there is a regression in FPC 3.2.2 compared with 3.2.0. This makes me more convinced that we need to keep CGE on all these platforms as it give a good test for the compiler, even if not used at all.</div><div><br></div><div>Below is the results of my investigation:</div><pre>(gdb) r</pre><pre>Starting program: /home/user/pasdoc-0.16.0/bin/pasdoc --format html --exclude-generator --implementation-comments=join --output=/tmp/pasdoc.log testcases/ok_helpinsight_comments.pas</pre><pre><br></pre><pre>Breakpoint 3, EXECUTE (this=0x0) at source/component/PasDoc_Base.pas:608</pre><pre>608 ParseFiles;</pre><pre>(gdb) s</pre><pre>PARSEFILES (this=0x0) at source/component/PasDoc_Base.pas:472</pre><pre>472 begin</pre><pre>(gdb) </pre><pre>473 FUnits.clear;</pre><pre>(gdb) n</pre><pre>475 DoMessage(1, pmtInformation, 'Starting Source File Parsing ...', []);</pre><pre>(gdb) n</pre><pre>Info[1]: Starting Source File Parsing ...</pre><pre>476 if FSourceFileNames.IsEmpty then Exit;</pre><pre>(gdb) </pre><pre>478 InputStream := nil;</pre><pre>(gdb) </pre><pre>PARSEFILES (this=0x0) at source/component/PasDoc_Base.pas:479</pre><pre>479 Count := 0;</pre><pre>(gdb) </pre><pre>PARSEFILES (this=0x0) at source/component/PasDoc_Base.pas:480</pre><pre>480 for i := 0 to FSourceFileNames.Count - 1 do</pre><pre>(gdb) </pre><pre>482 p := FSourceFileNames[i];</pre><pre>(gdb) </pre><pre>483 try</pre><pre>(gdb) </pre><pre>Info[2]: Now parsing file testcases/ok_helpinsight_comments.pas...</pre><pre><br></pre><pre>Program received signal SIGBUS, Bus error.</pre><pre>0x000000000025ae50 in REGEXPR$_$TREGEXPR_$__$$_EMITINT$LONGINT ()</pre><pre>(gdb) d</pre><pre>Delete all breakpoints? (y or n) y</pre><pre>(gdb) b PasDoc_Base.pas:483</pre><pre>Breakpoint 4 at 0x13ed5c: file source/component/PasDoc_Base.pas, line 483.</pre><pre>(gdb) r</pre><pre>The program being debugged has been started already.</pre><pre>Start it from the beginning? (y or n) y</pre><pre>Starting program: /home/user/pasdoc-0.16.0/bin/pasdoc --format html --exclude-generator --implementation-comments=join --output=/tmp/pasdoc.log testcases/ok_helpinsight_comments.pas</pre><pre>Info[1]: Starting Source File Parsing ...</pre><pre><br></pre><pre>Breakpoint 4, PARSEFILES (this=0x0) at source/component/PasDoc_Base.pas:483</pre><pre>483 try</pre><pre>(gdb) s</pre><pre>490 InputStream := TFileStream.Create(p, fmOpenRead or fmShareDenyWrite);</pre><pre>(gdb) p p</pre><pre>$1 = 0x0</pre><pre>(gdb) p i</pre><pre>$2 = 0</pre><pre>(gdb) p FSourceFileNames[i]</pre><pre>Cannot access memory at address 0xa0</pre><pre>(gdb) p FSourceFileNames</pre><pre>Cannot access memory at address 0xa0</pre><pre>(gdb) p Self</pre><pre>$3 = 0x0</pre><pre>(gdb) bt</pre><pre>#0 PARSEFILES (this=0x0) at source/component/PasDoc_Base.pas:490</pre><pre>#1 0x000007fefffea5d8 in ?? ()</pre><pre>Backtrace stopped: previous frame identical to this frame (corrupt stack?)</pre><pre>(gdb) </pre><pre><br></pre><div>As you can see the Self (this pointer in GDB stack trace) is nil (0x0).</div><div>This is probably related to a bug in the stack as suggested by GEB warning.</div><div><br></div><div>I think I need to raise a ticket upstream. What do you think?</div><div>Can you help in suggesting a minimal code to reproduce the issue?</div></blockquote><div><br></div><div><br></div><pre>(gdb) b PasDoc_Main.pas:681</pre><pre>Breakpoint 5 at 0x13d5d4: file source/console/PasDoc_Main.pas, line 681.</pre><pre>(gdb) r</pre><pre>Starting program: /home/user/pasdoc-0.16.0/bin/pasdoc --format html --exclude-generator --implementation-comments=join --output=/tmp/pasdoc.log testcases/ok_helpinsight_comments.pas</pre><pre><br></pre><pre>Breakpoint 5, EXECUTE (this=0x0) at source/console/PasDoc_Main.pas:681</pre><pre>681 PasDoc := TPasDoc.Create(nil);</pre><pre>(gdb) n</pre><pre>682 try</pre><pre>(gdb) p PasDoc</pre><pre>$4 = 0x0</pre><pre>(gdb) k</pre><pre>Kill the program being debugged? (y or n) y</pre><pre>[Inferior 1 (process 810) killed]</pre><pre>(gdb) r</pre><pre>Starting program: /home/user/pasdoc-0.16.0/bin/pasdoc --format html --exclude-generator --implementation-comments=join --output=/tmp/pasdoc.log testcases/ok_helpinsight_comments.pas</pre><pre><br></pre><pre>Breakpoint 5, EXECUTE (this=0x0) at source/console/PasDoc_Main.pas:681</pre><pre>681 PasDoc := TPasDoc.Create(nil);</pre><pre>(gdb) s</pre><pre>CREATE (this=0x0, vmt=0x0, AOWNER=0x0) at source/component/PasDoc_Base.pas:248</pre><pre>248 begin</pre><pre>(gdb) n</pre><pre>249 inherited;</pre><pre>(gdb) p Self</pre><pre>$5 = 0x0</pre><pre>(gdb) s</pre><pre>0x00000000001f3cd0 in CLASSES$_$TCOMPONENT_$__$$_CREATE$TCOMPONENT$$TCOMPONENT ()</pre><pre>(gdb) n</pre><pre>Single stepping until exit from function CLASSES$_$TCOMPONENT_$__$$_CREATE$TCOMPONENT$$TCOMPONENT,</pre><pre>which has no line number information.</pre><pre>0x000000000011d9c0 in fpc_pushexceptaddr ()</pre><pre>(gdb) </pre><pre>Single stepping until exit from function fpc_pushexceptaddr,</pre><pre>which has no line number information.</pre><pre>0x00000000001f3d2c in CLASSES$_$TCOMPONENT_$__$$_CREATE$TCOMPONENT$$TCOMPONENT ()</pre><pre>(gdb) </pre><pre>Single stepping until exit from function CLASSES$_$TCOMPONENT_$__$$_CREATE$TCOMPONENT$$TCOMPONENT,</pre><pre>which has no line number information.</pre><pre>CREATE (this=0x0, vmt=0x0, AOWNER=0x0) at source/component/PasDoc_Gen.pas:2786</pre><pre>2786 FClassHierarchy := nil;</pre><pre>(gdb) </pre><pre><br></pre><div>It looks like the compiler fails to allocate any instance of any class, but strange as it managed to cycle itself.</div><pre style="caret-color: rgb(46, 52, 54); color: rgb(46, 52, 54); font-variant-caps: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.4); -webkit-text-stroke-width: 0px; text-decoration: none;">-- <br></pre><pre style="caret-color: rgb(46, 52, 54); color: rgb(46, 52, 54); font-variant-caps: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0.4); -webkit-text-stroke-width: 0px; text-decoration: none;">Cheers,
Abou Al Montacir</pre></body></html>