* * *

Author Topic: Lazbuild EAccessViolation  (Read 2229 times)

antispam88

  • New member
  • *
  • Posts: 23
Lazbuild EAccessViolation
« on: January 13, 2018, 10:57:35 am »
Hi,

I'm having several packages and projects which I build using lazbuild.
The batch file works sometimes but more often I get exceptions:
Code: Pascal  [Select]
  1. An unhandled exception occurred at $771F1DCA:
  2. EAccessViolation: Access violation
  3. ...
  4. TProject.DoLoadStateFile Statefile not found: C:\src\bin\lib\x86_64-win64\project1.compiled
  5. An unhandled exception occurred at $004769EF:
  6. EAccessViolation: Access violation
  7. ...
  8. An unhandled exception occurred at $02D77993:
  9. EAccessViolation:
  10.  

The batch file looks as following:
Code: Pascal  [Select]
  1. lazbuild --add-package-link src\package1.lpk
  2. lazbuild --add-package-link src\package2.lpk
  3. lazbuild --add-package-link src\package3.lpk
  4. lazbuild -B --build-mode=Release src\project1.lpi
  5. lazbuild -B --build-mode=Release src\project2.lpi
  6.  

Has someone a hint regarding this error?
Or is there an option to get a detailed error log?

Best regards,
antispam88

Lazarus: 1.8.0
FPC: 3.0.4
Windows 10 pro 64 (x86_64-win64-win32/win64)
Windows 7 pro 32 (i386-win32-win32/win64)
« Last Edit: January 13, 2018, 11:04:56 am by antispam88 »

GetMem

  • Hero Member
  • *****
  • Posts: 2927
Re: Lazbuild EAccessViolation
« Reply #1 on: January 13, 2018, 11:12:22 am »
Quote
Or is there an option to get a detailed error log?
Did you try --verbose or/and --verbose-pkgsearch right after -B. What happens if you build your project/package from lazarus?

antispam88

  • New member
  • *
  • Posts: 23
Re: Lazbuild EAccessViolation
« Reply #2 on: January 13, 2018, 11:21:20 am »
Thank you for the hint with the option --verbose, I will try it right now.

If I build those with lazarus everything works as expected.

antispam88

  • New member
  • *
  • Posts: 23
Re: Lazbuild EAccessViolation
« Reply #3 on: January 13, 2018, 12:33:00 pm »
I have tried it:
Code: Pascal  [Select]
  1. An unhandled exception occurred at $00007FFF5972BE4B:
  2. EAccessViolation: Access violation
  3. ...
  4. TProject.DoLoadStateFile Statefile not found: C:\src\bin\lib\i386-win64\project1.compiled
  5. !!!Hint: (lazarus) Project needs building: No state file for Project!!!
  6. An unhandled exception occurred at $0000000100095CE8:
  7. EAccessViolation: Access violation
  8. ...
  9. An unhandled exception occurred at $000000010044F010:
  10. EAccessViolation:
  11.  

Only the line "Hint: (lazarus) Project needs building: No state file for Project" appeared. What does this mean?

Another hint: I use several build modes (--build-mode) for several projects.

Best regards,
antispam88
« Last Edit: January 17, 2018, 09:38:28 pm by antispam88 »

GetMem

  • Hero Member
  • *****
  • Posts: 2927
Re: Lazbuild EAccessViolation
« Reply #4 on: January 13, 2018, 12:51:39 pm »
Are you cross compiling? It looks like you're using the wrong compiler. You should override the default one with  --compiler=<ppcXXX> , where ppc386 is for 32 bit and ppcx64 for 64 bit.

antispam88

  • New member
  • *
  • Posts: 23
Re: Lazbuild EAccessViolation
« Reply #5 on: January 13, 2018, 12:56:26 pm »
Yes I use cross compiling (win32 + win64).

Is this only an option for lazbuild or can I set this via lpi file?

antispam88

  • New member
  • *
  • Posts: 23
Re: Lazbuild EAccessViolation
« Reply #6 on: January 13, 2018, 01:06:42 pm »
Setting the --compiler option doesn't solve the problem :-(
Same errors as before.

My --compiler parameters:
C:\lazarus\fpc\3.0.4\bin\x86_64-win64\ppc386.exe for x86
C:\lazarus\fpc\3.0.4\bin\x86_64-win64\ppcx64.exe for x64
« Last Edit: January 13, 2018, 01:08:40 pm by antispam88 »

GetMem

  • Hero Member
  • *****
  • Posts: 2927
Re: Lazbuild EAccessViolation
« Reply #7 on: January 13, 2018, 04:18:09 pm »
Unfortunately I'm out of ideas. Maybe you should build your applications/packages with Lazarus.

antispam88

  • New member
  • *
  • Posts: 23
Re: Lazbuild EAccessViolation
« Reply #8 on: January 13, 2018, 05:25:42 pm »
The point is that we are using jenkins to build and test our software.
And as I mentioned in my first post, the exception occurs not always.

Is it possible that cleaning the unit output directory or some other directory after each build might help?
Or is there a possibility to use lazarus via command line?

Best regards,
antispam88

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3356
  • I like bugs.
Re: Lazbuild EAccessViolation
« Reply #9 on: January 13, 2018, 06:21:06 pm »
Has someone a hint regarding this error?
Or is there an option to get a detailed error log?
It happens to others, too, but only seldom.
 https://bugs.freepascal.org/view.php?id=32340
We would need a proper debugger backtrace. Actually there is one from Benito van der Zander but it does not reveal any error in the code.
The problem with memory corruption and uninitialized variable issues is that they may trigger in different places.

There is a fundamental problem with LazBuild: it depends on LCL although it is not a GUI application.
Removing the dependency will require serious refactoring at some point.

antispam88

  • New member
  • *
  • Posts: 23
Re: Lazbuild EAccessViolation
« Reply #10 on: January 13, 2018, 06:52:30 pm »
Ok, can you tell me how to do a debugger backtrace of lazbuild?

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3356
  • I like bugs.
Re: Lazbuild EAccessViolation
« Reply #11 on: January 13, 2018, 10:52:07 pm »
Ok, can you tell me how to do a debugger backtrace of lazbuild?
Run it under gdb and then type command "bt" after the crash happened.
LazBuild must be built with debug info.
« Last Edit: January 13, 2018, 11:00:58 pm by JuhaManninen »

antispam88

  • New member
  • *
  • Posts: 23
Re: Lazbuild EAccessViolation
« Reply #12 on: January 14, 2018, 10:18:17 pm »
Hi,

I compiled lazbuild in Debug mode.

When I start the gdb I get following output:
Code: Pascal  [Select]
  1. C:\daten\src\projects\yoda> C:\lazarus\mingw\x86_64-win64\bin\gdb.exe C:\lazarus\lazbuild.exe
  2. GNU gdb (GDB) 7.3.50.20110510-cvs
  3. Copyright (C) 2011 Free Software Foundation, Inc.
  4. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  5. This is free software: you are free to change and redistribute it.
  6. There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
  7. and "show warranty" for details.
  8. This GDB was configured as "x86_64-w64-mingw32".
  9. For bug reporting instructions, please see:
  10. <http://www.gnu.org/software/gdb/bugs/>...
  11. Reading symbols from C:\lazarus\lazbuild.exe...Reading symbols from C:\lazarus\lazbuild.dbg...
  12. warning: section .gnu_debuglink not found in C:\lazarus\lazbuild.dbg
  13. done.
  14. done.

Does this warning "section .gnu_debuglink not found in C:\lazarus\lazbuild.dbg" indicates a problem?

Nevertheless I went on:
Code: Pascal  [Select]
  1. set args -B --build-mode=Release_32_1 --verbose --compiler="C:\lazarus\fpc\3.0.4\bin\x86_64-win64\ppc386.exe" src\project1.lpi
  2. run
  3. //worked
  4. set args -B --build-mode=Release_64_1 --verbose --compiler="C:\lazarus\fpc\3.0.4\bin\x86_64-win64\ppc386.exe" src\project1.lpi
  5. run
  6. //worked
  7. set args -B --build-mode=Release_32_2 --verbose --compiler="C:\lazarus\fpc\3.0.4\bin\x86_64-win64\ppc386.exe" src\project1.lpi
  8. run
  9. //broke

The end of the output was:
Code: Pascal  [Select]
  1. (1008) 11768 lines compiled, 0.7 sec
  2. (1021) 32 warning(s) issued
  3. (1022) 41 hint(s) issued
  4.  
  5. Program received signal SIGSEGV, Segmentation fault.
  6. [Switching to Thread 10128.0x2a08]
  7. 0x00007fff5972be4b in ?? ()

Command bt ouput was:
Code: Pascal  [Select]
  1. #0  0x00007fff5972be4b in ?? ()
  2. #1  0x0000000009037400 in ?? ()
  3. #2  0x000000000f0cfbe0 in ?? ()
  4. #3  0x0000000009037408 in ?? ()
  5. #4  0x5555555555555555 in ?? ()
  6. #5  0x5555555555555555 in ?? ()
  7. #6  0x5555555555555555 in ?? ()
  8. #7  0xffffffffffffffff in ?? ()
  9. #8  0x000000000037a000 in ?? ()
  10. #9  0x0000000009037408 in ?? ()
  11. #10 0x0000000000002a08 in ?? ()
  12. #11 0x0000000000000000 in ?? ()

Doesn't seem to be very helpful. Have I made an error?

Best regards,
antispam88

antispam88

  • New member
  • *
  • Posts: 23
Re: Lazbuild EAccessViolation
« Reply #13 on: January 17, 2018, 09:33:58 pm »
Hi,

does anyone have a suggestion do get a better error analyse?
Are my steps correct?

Best regards,
antispam99

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3356
  • I like bugs.
Re: Lazbuild EAccessViolation
« Reply #14 on: January 18, 2018, 12:39:54 am »
Your backtrace looks like there is no debug info.
Does the problem happen only with a certain program? Then you should upload it here to be tested.

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus