View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0036774 | Lazarus | Utilities | public | 2020-03-08 23:55 | 2021-02-28 14:55 |
Reporter | J. Gareth Moreton | Assigned To | Juha Manninen | ||
Priority | urgent | Severity | crash | Reproducibility | always |
Status | resolved | Resolution | no change required | ||
Platform | x86_64-win64 | OS | Microsoft Windows | ||
Summary | 0036774: Using "make" to build Lazarus results in an access violation | ||||
Description | When attempting to build Lazarus with "make all", the compiler raises an access violation - e.g: ... make -C ide ide make[1]: Entering directory `C:/Users/NLO-012/Documents/Programming/lazarus/ide' ../tools/svn2revisioninc.exe .. revision.inc An unhandled exception occurred at $000000010000919A: EAccessViolation: Access violation $000000010000919A $000000010000F318 $000000010000F0FF $000000010000E40B $000000010000DECE $000000010003980D $0000000100001882 fin$00000010, line 118 of svn2revisioninc.pas $000000010000190D SVNINPATH, line 109 of svn2revisioninc.pas $0000000100003D75 PARAMSVALID, line 572 of svn2revisioninc.pas $00000001000047ED GITREVISIONFROMGITCOMMIT, line 769 of svn2revisioninc.pas $00000001000048E7 main, line 788 of svn2revisioninc.pas $0000000100004906 $00000001000159E0 $0000000100001856 $00007FF91D487BD4 $00007FF91DD8CED1 make[1]: *** [revisioninc] Error 217 make[1]: Leaving directory `C:/Users/NLO-012/Documents/Programming/lazarus/ide' make: *** [ide] Error 2 | ||||
Steps To Reproduce | With the most up-to-date files for Lazarus and FPC, attempt to build Lazarus with the following command line: make clean all FPC="\pp\bin\x86_64-win64\ppcx64.exe" (replace the directory with where the compiler executable gets installed. | ||||
Additional Information | The compiler was built using the following command line: make distclean all install DATA2INC=C:\Users\NLO-012\Documents\Programming\fpc\utils\bin\x86_64-win64\data2inc.exe OPT="-O4" Find attached my error log (generated by specifying "> errorlog.log 2>&1" after the make command. | ||||
Tags | access violation, compiler, lazarus, x86_64, x86_64-win64 | ||||
Fixed in Revision | |||||
LazTarget | - | ||||
Widgetset | |||||
Attached Files |
|
|
|
|
Not it doesn't 1. you are in a lazarus dir 2 you run a svn2revision binary from lazarus that crashes -> lazarus |
|
Okay, sorry. |
|
Please add USESVN2REVISIONINC=0 make option if your Lazarus directory isn't under Subversion version control. |
|
It is under SVN version control. |
|
Can you add "-gl" to OPT, so svn2revision gets built with that as well, and we get better backtrace from svn2revision. |
|
Error log with -gl option. |
|
Issue still occurs as of the latest trunk (for both FPC and Lazarus). |
|
Nice: line 118 of svn2revisioninc.pas P := TProcessUTF8.Create(nil); try P.Options := [poUsePipes, poWaitOnExit]; P.CommandLine := 'svn --version'; try P.Execute; except Result := False; end; finally P.Destroy; //!!!!! end; i thought the P.Free calls destructor and releases memory. |
|
There are lots of P.Destroy there |
|
No, p.free calls p.destroy. It is a non virtual wrapper for p.destroy. |
|
so the problem in codegen - target back to FPC? |
|
Unless you really can point to where the compiler goes wrong, I'd assume it is the code, not the compiler. E.g. maybe something in TProcessUTF8 interacts with the updated tprocess (allthough that is also more than an year old), or simply bugs in svn2* itself. Try stepping through the trpocessutf8 destructor |
|
Unless I'm mistaken, Free is just a safety wrapper for Destroy - it checks to see if the object is not nil before calling Destroy. To hazard a guess, I would say there's a bug in TProcessUTF8.Destroy itself. Logically, P should contain a valid object in that block (if TProcessUTF8.Create raises an exception, the try..finally block isn't even entered), so unless something else is corrupting P, I'm not sure what else it could be. |
|
I took function SvnInPath from svn2revisioninc.pas into my test project. I changed the command line to: P.CommandLine := 'pööö --version'; which certainly does not exist in system path. The code works as expected. Process raises an exception because 'pööö' does not exist. Function SvnInPath catches it and returns False. No other exceptions. No crashes. I am testing with Lazarus trunk and FPC trunk from few weeks ago. J. Gareth Moreton, you built FPC with -O4. Is it safe? Does building with -O3 make a difference? |
|
Juha: do you test with win64? Might be a problem in some windows header. |
|
I was able to build Lazarus trunk (r62767) with ppcrossx64.exe of fpc trunk (r44297). No crash in svn2revsioninc.exe All this on Win10-64. |
|
I tested with Manjaro Linux 64bit. Forgot to mention. |
|
svn2revisioninc.exe crashes also at me as Win64 build (fpc trunk r45361) An unhandled exception occurred at $000000010000904A: EAccessViolation: Access violation $000000010000904A $000000010000F168 $000000010000EF4F $000000010000E25B $000000010000DD1E $000000010003993D $00000001000018A2 fin$00000010, line 118 of svn2revisioninc.pas $000000010000192D SVNINPATH, line 109 of svn2revisioninc.pas $0000000100003D95 PARAMSVALID, line 572 of svn2revisioninc.pas $000000010000480D GITREVISIONFROMGITCOMMIT, line 769 of svn2revisioninc.pas $0000000100004907 main, line 788 of svn2revisioninc.pas $0000000100004926 $0000000100015CB0 $0000000100001876 $00007FFA76C57BD4 $00007FFA780CCE51 |
|
Can you make svn2revisioninc crash stand-alone? If so, with what compiler options was it built? Can you invoke the crash when building with -gh (heaptrace), might give some additional info |
|
I ran "make clean all install FPCOPT="-gh"" - not sure how helpful this heaptrace is: Heap dump by heaptrc unit of "C:\Users\NLO-012\Documents\Programming\lazarus\tools\svn2revisioninc.exe" 15290 memory blocks allocated : 1752068/1752768 15280 memory blocks freed : 1750837/1751528 10 unfreed memory blocks : 1231 True heap size : 688128 (640 used in System startup) True free heap : 684032 Should be : 684328 Call trace for block $000000000159DBA0 size 40 $00000001000106FB $00000001000164D5 $00000001000165BC $00007FFE11E411CF $00007FFE11E0A209 $00007FFE11E3FE3E $000000010000929A $000000010000F388 $000000010000F16F $000000010000E48B $000000010000DF4E $000000010003BF9D $00000001000018B2 fin$00000010, line 118 of svn2revisioninc.pas $000000010000193D SVNINPATH, line 109 of svn2revisioninc.pas $0000000100003DA5 PARAMSVALID, line 572 of svn2revisioninc.pas $000000010000481D GITREVISIONFROMGITCOMMIT, line 769 of svn2revisioninc.pas Call trace for block $0000000001625D00 size 128 $0000000100018057 $00000001000106DB $000000010001626F $00000001000164BE $00000001000165BC $00007FFE11E411CF $00007FFE11E0A209 $00007FFE11E3FE3E $000000010000929A $000000010000F388 $000000010000F16F $000000010000E48B $000000010000DF4E $000000010003BF9D $00000001000018B2 fin$00000010, line 118 of svn2revisioninc.pas $000000010000193D SVNINPATH, line 109 of svn2revisioninc.pas Call trace for block $000000000162DE90 size 176 $0000000100010642 $000000010000DE9A $0000000100037999 $000000010003AC27 $0000000100016493 $00000001000165BC $00007FFE11E411CF $00007FFE11E0A209 $00007FFE11E3FE3E $000000010000929A $000000010000F388 $000000010000F16F $000000010000E48B $000000010000DF4E $000000010003BF9D $00000001000018B2 fin$00000010, line 118 of svn2revisioninc.pas Call trace for block $000000000162DD10 size 152 $0000000100010642 $000000010000DE9A $0000000100023549 $0000000100049630 SETPROCESSHANDLE, line 568 of utf8process.pp $0000000100049E91 EXECUTE, line 665 of utf8process.pp $0000000100001928 SVNINPATH, line 113 of svn2revisioninc.pas $0000000100003DA5 PARAMSVALID, line 572 of svn2revisioninc.pas $000000010000481D GITREVISIONFROMGITCOMMIT, line 769 of svn2revisioninc.pas $0000000100004917 main, line 788 of svn2revisioninc.pas $0000000100004936 $0000000100015FB0 $0000000100001886 $00007FFE106A7BD4 $00007FFE11E0CE51 Call trace for block $000000000159D7A0 size 28 $0000000100010642 $0000000100009223 $000000010000A3AF $000000010003BD24 $000000010003BB8C $000000010003C44C $000000010003C28E $0000000100001916 SVNINPATH, line 111 of svn2revisioninc.pas $0000000100003DA5 PARAMSVALID, line 572 of svn2revisioninc.pas $000000010000481D GITREVISIONFROMGITCOMMIT, line 769 of svn2revisioninc.pas $0000000100004917 main, line 788 of svn2revisioninc.pas $0000000100004936 $0000000100015FB0 $0000000100001886 $00007FFE106A7BD4 $00007FFE11E0CE51 Call trace for block $00000000015B16D0 size 296 $0000000100010642 $000000010000DE9A $000000010003BE19 $00000001000018F3 SVNINPATH, line 108 of svn2revisioninc.pas $0000000100003DA5 PARAMSVALID, line 572 of svn2revisioninc.pas $000000010000481D GITREVISIONFROMGITCOMMIT, line 769 of svn2revisioninc.pas $0000000100004917 main, line 788 of svn2revisioninc.pas $0000000100004936 $0000000100015FB0 $0000000100001886 $00007FFE106A7BD4 $00007FFE11E0CE51 Call trace for block $00000000015B9840 size 76 $0000000100010642 $0000000100009223 $000000010000A3AF $000000010002DF1E $0000000100003B98 PARAMSVALID, line 560 of svn2revisioninc.pas $000000010000481D GITREVISIONFROMGITCOMMIT, line 769 of svn2revisioninc.pas $0000000100004917 main, line 788 of svn2revisioninc.pas $0000000100004936 $0000000100015FB0 $0000000100001886 $00007FFE106A7BD4 $00007FFE11E0CE51 Call trace for block $00000000015D1A80 size 88 $0000000100010642 $0000000100009223 $000000010000A2DA $000000010000A33E $0000000100042659 RESOLVEDOTS, line 179 of lazfileutils.inc $0000000100042DAD EXPANDFILENAMEUTF8, line 406 of winlazfileutils.inc $00000001000038A0 PARAMSVALID, line 525 of svn2revisioninc.pas $000000010000481D GITREVISIONFROMGITCOMMIT, line 769 of svn2revisioninc.pas $0000000100004917 main, line 788 of svn2revisioninc.pas $0000000100004936 $0000000100015FB0 $0000000100001886 $00007FFE106A7BD4 $00007FFE11E0CE51 Call trace for block $000000000159D4A0 size 31 $0000000100010642 $0000000100009223 $000000010000A17B $000000010000B5BE $0000000100043C7B PARAMSTRUTF8WIDE, line 218 of winlazutf8.inc $000000010004363D PARAMSTRUTF8, line 23 of winlazutf8.inc $000000010000385C PARAMSVALID, line 524 of svn2revisioninc.pas $000000010000481D GITREVISIONFROMGITCOMMIT, line 769 of svn2revisioninc.pas $0000000100004917 main, line 788 of svn2revisioninc.pas $0000000100004936 $0000000100015FB0 $0000000100001886 $00007FFE106A7BD4 $00007FFE11E0CE51 Call trace for block $00000000015C16B0 size 216 $0000000100010642 $000000010000DE9A $0000000100002B1C GETREVISIONFROMGITVERSION, line 213 of svn2revisioninc.pas $0000000100004904 main, line 787 of svn2revisioninc.pas $0000000100004936 $0000000100015FB0 $0000000100001886 $00007FFE106A7BD4 $00007FFE11E0CE51 |
|
Also to note, compiling the tool by itself without any compiler options raises an access violation: \pp\bin\x86_64-win64\fpc.exe -Fu..\components\lazutils svn2revisioninc.pas (from the "tools" subdirectory) Then running "svn2revisioninc.exe .. revision.inc": An unhandled exception occurred at $0000000100008E8A: EAccessViolation: Access violation $0000000100008E8A $000000010000EF78 $000000010000ED5F $000000010000E07B $000000010000DB3E $00000001000362ED $0000000100001882 $000000010000190D $0000000100003D75 $00000001000047ED $00000001000048E7 $0000000100004906 $00000001000152E0 $0000000100001856 $00007FFE106A7BD4 $00007FFE11E0CE51 |
|
If -O2 is used instead of -O4, the access violation does not occur. The compiler seems to be producing bad code in this mode. I'll see what I can find. |
|
Maybe related to https://bugs.freepascal.org/view.php?id=37305 |
|
Compiler issue. Resolving. |
Date Modified | Username | Field | Change |
---|---|---|---|
2020-03-08 23:55 | J. Gareth Moreton | New Issue | |
2020-03-08 23:55 | J. Gareth Moreton | File Added: errorlog.log | |
2020-03-08 23:57 | J. Gareth Moreton | Tag Attached: compiler | |
2020-03-08 23:57 | J. Gareth Moreton | Tag Attached: x86_64 | |
2020-03-08 23:57 | J. Gareth Moreton | Tag Attached: x86_64-win64 | |
2020-03-08 23:57 | J. Gareth Moreton | Tag Attached: lazarus | |
2020-03-08 23:57 | J. Gareth Moreton | Tag Attached: access violation | |
2020-03-09 00:13 | J. Gareth Moreton | Priority | normal => urgent |
2020-03-09 00:13 | J. Gareth Moreton | Severity | minor => crash |
2020-03-09 00:13 | J. Gareth Moreton | FPCTarget | => - |
2020-03-09 10:08 | Marco van de Voort | Project | FPC => Lazarus |
2020-03-09 10:09 | Marco van de Voort | Note Added: 0121483 | |
2020-03-09 10:10 | Marco van de Voort | Category | Compiler => Utilities |
2020-03-09 10:10 | Marco van de Voort | Product Version | 3.3.1 => |
2020-03-09 10:10 | Marco van de Voort | LazTarget | => - |
2020-03-09 10:36 | J. Gareth Moreton | Note Added: 0121484 | |
2020-03-09 10:39 | Cyrax | Note Added: 0121485 | |
2020-03-09 11:21 | J. Gareth Moreton | Note Added: 0121487 | |
2020-03-09 12:09 | Bart Broersma | Note Added: 0121490 | |
2020-03-09 22:28 | J. Gareth Moreton | File Added: errorlog2.log | |
2020-03-09 22:28 | J. Gareth Moreton | Note Added: 0121507 | |
2020-03-13 06:25 | J. Gareth Moreton | Note Added: 0121579 | |
2020-03-13 10:46 | Anton Kavalenka | Note Added: 0121584 | |
2020-03-13 10:47 | Anton Kavalenka | Note Added: 0121586 | |
2020-03-13 10:51 | Marco van de Voort | Note Added: 0121587 | |
2020-03-13 11:03 | Anton Kavalenka | Note Added: 0121588 | |
2020-03-13 11:55 | Marco van de Voort | Note Added: 0121589 | |
2020-03-13 17:06 | J. Gareth Moreton | Note Added: 0121595 | |
2020-03-13 21:31 | Juha Manninen | Note Added: 0121597 | |
2020-03-13 22:03 | Marco van de Voort | Note Added: 0121598 | |
2020-03-13 23:29 | Bart Broersma | Note Added: 0121599 | |
2020-03-14 08:57 | Juha Manninen | Note Added: 0121600 | |
2020-06-05 02:50 | Benjamin Rosseaux | Note Added: 0123236 | |
2020-06-06 14:35 | Bart Broersma | Note Added: 0123262 | |
2020-07-13 03:11 | J. Gareth Moreton | Note Added: 0123948 | |
2020-07-13 03:25 | J. Gareth Moreton | Note Added: 0123949 | |
2020-07-13 05:00 | J. Gareth Moreton | Note Added: 0123950 | |
2020-07-13 09:53 | Zeljan Rikalo | Note Added: 0123955 | |
2020-07-13 15:18 | Maxim Ganetsky | Relationship added | related to 0037305 |
2021-02-28 14:55 | Juha Manninen | Assigned To | => Juha Manninen |
2021-02-28 14:55 | Juha Manninen | Status | new => resolved |
2021-02-28 14:55 | Juha Manninen | Resolution | open => no change required |
2021-02-28 14:55 | Juha Manninen | Note Added: 0129238 |