Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2012-11

Problem with compilation (unknown crash)

8 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michel Catudal

Is there a way to figure out when a crash occurs, in other words get the compiler to tell me the conditions that made it crash the compilation? I am able to create a compiler but it looks like it barfs when trying to create the RTL stuff, it is kind of hard to fix if I don't know what causes the crash.

Here is a part of the last messages :

/home/michel/packages/BUILD/avr32-fpc-2.7.1/compiler/ppc -Ur -Xs -O2 -n -Fuavr32 -Fusystems -Fu/home/michel/packages/BUILD/avr32-fpc-2.7.1/rtl/units/x86_64-linux -Fiavr32 -FE. -FUavr32/units/x86_64-linux -Cg -dRELEASE -davr32 -dGDB -dBROWSERLOG -Sew pp.pas /usr/bin/ld: warning: ./link.res contains output sections; did you forget -T? /bin/mv -f ./pp ppcrossavr32
make[3]: quittant le répertoire « /home/michel/packages/BUILD/avr32-fpc-2.7.1/compiler » make 'FPC=/home/michel/packages/BUILD/avr32-fpc-2.7.1/compiler/ppcrossavr32' 'OPT= -O-' rtlclean rtl CYCLELEVEL=3 make[3]: entrant dans le répertoire « /home/michel/packages/BUILD/avr32-fpc-2.7.1/compiler » make -C /home/michel/packages/BUILD/avr32-fpc-2.7.1/rtl clean make[4]: entrant dans le répertoire « /home/michel/packages/BUILD/avr32-fpc-2.7.1/rtl » /bin/rm -f fpcmade.avr32-embedded Package.fpc ppas.sh script.res link.res /bin/rm -f *.s *_ppas.bat
make -C embedded clean
make[5]: entrant dans le répertoire « /home/michel/packages/BUILD/avr32-fpc-2.7.1/rtl/embedded » /bin/rm -f /home/michel/packages/BUILD/avr32-fpc-2.7.1/rtl/units/avr32-embedded/system.ppu /home/michel/packages/BUILD/avr32-fpc-2.7.1/rtl/units/avr32-embedded/uuchar.ppu /home/michel/packages/BUILD/avr32-fpc-2.7.1/rtl/units/avr32-embedded/objpas.ppu /home/michel/packages/BUILD/avr32-fpc-2.7.1/rtl/units/avr32-embedded/heapmgr.ppu /home/michel/packages/BUILD/avr32-fpc-2.7.1/rtl/units/avr32-embedded/consoleio.ppu /bin/rm -f fpcmade.avr32-embedded Package.fpc ppas.sh script.res link.res /bin/rm -f *.s *_ppas.bat
make[5]: quittant le répertoire « /home/michel/packages/BUILD/avr32-fpc-2.7.1/rtl/embedded » make[4]: quittant le répertoire « /home/michel/packages/BUILD/avr32-fpc-2.7.1/rtl » make -C /home/michel/packages/BUILD/avr32-fpc-2.7.1/rtl 'OPT=-O- ' all make[4]: entrant dans le répertoire « /home/michel/packages/BUILD/avr32-fpc-2.7.1/rtl » make -C embedded all
make[5]: entrant dans le répertoire « /home/michel/packages/BUILD/avr32-fpc-2.7.1/rtl/embedded » /bin/mkdir -p /home/michel/packages/BUILD/avr32-fpc-2.7.1/rtl/units/avr32-embedded /home/michel/packages/BUILD/avr32-fpc-2.7.1/compiler/ppcrossavr32 @rtl.cfg -Ur -Tembedded -Pavr32 -XPavr32-embedded- -Xr -Ur -Xs -O2 -n -Fi../inc -Fi../avr32 -FE. -FU/home/michel/packages/BUILD/avr32-fpc-2.7.1/rtl/units/avr32-embedded -O- -davr32 -dRELEASE -O- -Us -Sg system.pp
Fatal: Compilation aborted
An unhandled exception occurred at $000000000049E010: EAccessViolation: Access violation
$000000000049E010

make[5]: *** [system.ppu] Erreur 217
make[5]: quittant le répertoire « /home/michel/packages/BUILD/avr32-fpc-2.7.1/rtl/embedded » make[4]: *** [embedded_all] Erreur 2
make[4]: quittant le répertoire « /home/michel/packages/BUILD/avr32-fpc-2.7.1/rtl » make[3]: *** [rtl] Erreur 2
make[3]: quittant le répertoire « /home/michel/packages/BUILD/avr32-fpc-2.7.1/compiler » make[2]: *** [cycle] Erreur 2
make[2]: quittant le répertoire « /home/michel/packages/BUILD/avr32-fpc-2.7.1/compiler » make[1]: *** [compiler_cycle] Erreur 2
make[1]: quittant le répertoire « /home/michel/packages/BUILD/avr32-fpc-2.7.1 » make: *** [base.build-stamp.avr32-embedded] Erreur 2

The command used to compile is the following :

PP=ppcx64 make buildbase OS_TARGET=embedded CPU_TARGET=avr32 CROSSOPT=-O-

This is on a Scientific Linux 6.2 platform

Michel

For Linux Software visit http://home.comcast.net/~mcatudal

Reply by email

Jonas Maebe
to Michel Catudal
Michel Catudal wrote
Is there a way to figure out when a crash occurs, in other words get the compiler to tell me the conditions that made it crash the compilation?

By debugging the compiler. Add OPT="-O- -gl" to add debug information and disable optimizations.

Jonas

Reply by email

Michel Catudal
to Jonas Maebe
Jonas Maebe wrote 10 lines
On 12 Nov 2012, at 13:32, Michel Catudal wrote: > Is there a way to figure out when a crash occurs, in other words get the compiler to tell me the conditions that made it crash the compilation? By debugging the compiler. Add OPT="-O- -gl" to add debug information and disable optimizations. Jonas

Isn't this just to add debugging information for using gdb?

The crash here is during compilation

with the -gl flag :

make[5]: entrant dans le répertoire « /home/michel/packages/BUILD/avr32-fpc-2.7.1/rtl/embedded » /home/michel/packages/BUILD/avr32-fpc-2.7.1/compiler/ppcrossavr32 @rtl.cfg -Ur -Tembedded -Pavr32 -XPavr32-embedded- -Xr -Ur -Xs -O2 -n -Fi../inc -Fi../avr32 -FE. -FU/home/michel/packages/BUILD/avr32-fpc-2.7.1/rtl/units/avr32-embedded -O- -gl -davr32 -dRELEASE -O- -gl -Us -Sg system.pp
Fatal: Compilation aborted
An unhandled exception occurred at $000000000049E010: EAccessViolation: Access violation
$000000000049E010

make[5]: *** [system.ppu] Erreur 217
make[5]: quittant le répertoire « /home/michel/packages/BUILD/avr32-fpc-2.7.1/rtl/embedded » make[4]: *** [embedded_all] Erreur 2
make[4]: quittant le répertoire « /home/michel/packages/BUILD/avr32-fpc-2.7.1/rtl » make[3]: *** [rtl] Erreur 2
make[3]: quittant le répertoire « /home/michel/packages/BUILD/avr32-fpc-2.7.1/compiler » make[2]: *** [cycle] Erreur 2
make[2]: quittant le répertoire « /home/michel/packages/BUILD/avr32-fpc-2.7.1/compiler » make[1]: *** [compiler_cycle] Erreur 2
make[1]: quittant le répertoire « /home/michel/packages/BUILD/avr32-fpc-2.7.1 » make: *** [base.build-stamp.avr32-embedded] Erreur 2

whithout it :

make[5]: entrant dans le répertoire « /home/michel/packages/BUILD/avr32-fpc-2.7.1/rtl/embedded » /home/michel/packages/BUILD/avr32-fpc-2.7.1/compiler/ppcrossavr32 @rtl.cfg -Ur -Tembedded -Pavr32 -XPavr32-embedded- -Xr -Ur -Xs -O2 -n -Fi../inc -Fi../avr32 -FE. -FU/home/michel/packages/BUILD/avr32-fpc-2.7.1/rtl/units/avr32-embedded -O- -davr32 -dRELEASE -O- -Us -Sg system.pp
Fatal: Compilation aborted
An unhandled exception occurred at $000000000049E010: EAccessViolation: Access violation
$000000000049E010

make[5]: *** [system.ppu] Erreur 217
make[5]: quittant le répertoire « /home/michel/packages/BUILD/avr32-fpc-2.7.1/rtl/embedded » make[4]: *** [embedded_all] Erreur 2
make[4]: quittant le répertoire « /home/michel/packages/BUILD/avr32-fpc-2.7.1/rtl » make[3]: *** [rtl] Erreur 2
make[3]: quittant le répertoire « /home/michel/packages/BUILD/avr32-fpc-2.7.1/compiler » make[2]: *** [cycle] Erreur 2
make[2]: quittant le répertoire « /home/michel/packages/BUILD/avr32-fpc-2.7.1/compiler » make[1]: *** [compiler_cycle] Erreur 2
make[1]: quittant le répertoire « /home/michel/packages/BUILD/avr32-fpc-2.7.1 » make: *** [base.build-stamp.avr32-embedded] Erreur 2

Michel

For Linux Software visit http://home.comcast.net/~mcatudal

Reply by email

Tomas Hajny
to Michel Catudal
Michel Catudal wrote 15 lines
Le 12/11/2012 07:34, Jonas Maebe a écrit : > > On 12 Nov 2012, at 13:32, Michel Catudal wrote: > >> Is there a way to figure out when a crash occurs, in other words get >> the compiler to tell me the conditions that made it crash the >> compilation? > > By debugging the compiler. Add OPT="-O- -gl" to add debug information > and disable optimizations. > > > Jonas > Isn't this just to add debugging information for using gdb?

No, not only: -gl ensures including line information and allows providing information about source lines related to the stack.

The crash here is during compilation with the -gl flag :

.
.

Make sure to add also "-Xs-" (i.e. OPT="-O- -gl -Xs-").

Tomas

Reply by email

Michel Catudal
to Tomas Hajny
Tomas Hajny wrote 31 lines
On Tue, November 13, 2012 02:08, Michel Catudal wrote: > Le 12/11/2012 07:34, Jonas Maebe a écrit : >> On 12 Nov 2012, at 13:32, Michel Catudal wrote: >> >>> Is there a way to figure out when a crash occurs, in other words get >>> the compiler to tell me the conditions that made it crash the >>> compilation? >> By debugging the compiler. Add OPT="-O- -gl" to add debug information >> and disable optimizations. >> >> >> Jonas >> > Isn't this just to add debugging information for using gdb? No, not only: -gl ensures including line information and allows providing information about source lines related to the stack. > The crash here is during compilation > > with the -gl flag : . . Make sure to add also "-Xs-" (i.e. OPT="-O- -gl -Xs-"). Tomas _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

It gave no additional information :

/home/michel/packages/BUILD/avr32-fpc-2.7.1/compiler/ppcrossavr32 @rtl.cfg -Ur -Tembedded -Pavr32 -XPavr32-embedded- -Xr -Ur -Xs -O2 -n -Fi../inc -Fi../avr32 -FE. -FU/home/michel/packages/BUILD/avr32-fpc-2.7.1/rtl/units/avr32-embedded -O- -gl -Xs- -davr32 -dRELEASE -O- -gl -Xs- -Us -Sg system.pp
Fatal: Compilation aborted
An unhandled exception occurred at $000000000049E010: EAccessViolation: Access violation
$000000000049E010

make[5]: *** [system.ppu] Erreur 217
make[5]: quittant le répertoire « /home/michel/packages/BUILD/avr32-fpc-2.7.1/rtl/embedded » make[4]: *** [embedded_all] Erreur 2
make[4]: quittant le répertoire « /home/michel/packages/BUILD/avr32-fpc-2.7.1/rtl » make[3]: *** [rtl] Erreur 2
make[3]: quittant le répertoire « /home/michel/packages/BUILD/avr32-fpc-2.7.1/compiler » make[2]: *** [cycle] Erreur 2
make[2]: quittant le répertoire « /home/michel/packages/BUILD/avr32-fpc-2.7.1/compiler » make[1]: *** [compiler_cycle] Erreur 2
make[1]: quittant le répertoire « /home/michel/packages/BUILD/avr32-fpc-2.7.1 » make: *** [base.build-stamp.avr32-embedded] Erreur 2

Michel

For Linux Software visit http://home.comcast.net/~mcatudal

Reply by email

Jonas Maebe
to Michel Catudal: Isn't this just to add debugging information for using gdb? The crash here is during…
Michel Catudal wrote 9 lines
Le 12/11/2012 07:34, Jonas Maebe a écrit : > > On 12 Nov 2012, at 13:32, Michel Catudal wrote: > >> Is there a way to figure out when a crash occurs, in other words get the compiler to tell me the conditions that made it crash the compilation? > > By debugging the compiler. Add OPT="-O- -gl" to add debug information and disable optimizations. > Isn't this just to add debugging information for using gdb?

Mostly yes, that's why I answered "by debugging the compiler". The compiler has no logic built in to analyse why it crashes. And in your case, it seems even the stack is corrupt.

Note that the AVR32 port is far from complete and probably still contains a multitude of bugs (even if you do get it to generate code, it's likely that it will be incorrect in many cases).

Jonas

Reply by email

Tomas Hajny
to Michel Catudal: It gave no additional information : /home/michel/packages/BUILD/avr32-fpc-2.7.1/compiler/p…
Michel Catudal wrote 39 lines
Le 13/11/2012 03:12, Tomas Hajny a ĂŠcrit : > On Tue, November 13, 2012 02:08, Michel Catudal wrote: >> Le 12/11/2012 07:34, Jonas Maebe a ĂŠcrit : >>> On 12 Nov 2012, at 13:32, Michel Catudal wrote: >>> >>>> Is there a way to figure out when a crash occurs, in other words get >>>> the compiler to tell me the conditions that made it crash the >>>> compilation? >>> By debugging the compiler. Add OPT="-O- -gl" to add debug information >>> and disable optimizations. >>> >>> >>> Jonas >>> >> Isn't this just to add debugging information for using gdb? > No, not only: -gl ensures including line information and allows > providing > information about source lines related to the stack. > >> The crash here is during compilation >> >> with the -gl flag : > . > . > > Make sure to add also "-Xs-" (i.e. OPT="-O- -gl -Xs-"). > It gave no additional information : /home/michel/packages/BUILD/avr32-fpc-2.7.1/compiler/ppcrossavr32 @rtl.cfg -Ur -Tembedded -Pavr32 -XPavr32-embedded- -Xr -Ur -Xs -O2 -n -Fi../inc -Fi../avr32 -FE. -FU/home/michel/packages/BUILD/avr32-fpc-2.7.1/rtl/units/avr32-embedded -O- -gl -Xs- -davr32 -dRELEASE -O- -gl -Xs- -Us -Sg system.pp Fatal: Compilation aborted An unhandled exception occurred at $000000000049E010: EAccessViolation: Access violation $000000000049E010

.
.

Oops. :-( Could you please check the options used when building your (cross-) compiler (i.e. compilation of ppcrossavr32 mentioned above). I have no direct experience with cross-compilers myself and it might be that different options are used for building the cross-compiler and for compiling with this cross-compiler in our makefiles. If the command line generated by our makefiles includes those -O- -gl -Xs- options (similarly to the command line used when compiling system.pp indicated above), it probably means that the stack is probably corrupted somehow and the only chance is really running the compilation (using the same parameters listed above) inside gdb as suggested by Jonas.

Tomas

Reply by email

Michel Catudal
to Jonas Maebe: Mostly yes, that's why I answered "by debugging the compiler". The compiler has no logic…
Jonas Maebe wrote 14 lines
On 13 Nov 2012, at 02:08, Michel Catudal wrote: > Le 12/11/2012 07:34, Jonas Maebe a écrit : >> On 12 Nov 2012, at 13:32, Michel Catudal wrote: >> >>> Is there a way to figure out when a crash occurs, in other words get the compiler to tell me the conditions that made it crash the compilation? >> By debugging the compiler. Add OPT="-O- -gl" to add debug information and disable optimizations. >> > Isn't this just to add debugging information for using gdb? Mostly yes, that's why I answered "by debugging the compiler". The compiler has no logic built in to analyse why it crashes. And in your case, it seems even the stack is corrupt. Note that the AVR32 port is far from complete and probably still contains a multitude of bugs (even if you do get it to generate code, it's likely that it will be incorrect in many cases).

I am aware of that, but I need it to compile in order to fix the bugs. I had no problem compiling with the 2.6.0 tree. The compiler is created, it barfs when trying to create the RTL files. It must be the new compiler that crashes. It looks like a game with gdb is needed.

For the compiler I updated the code to follow the changes in other processors so it would compile, there are quite a few changes between 2.6.0 and 2.7.1 As for the RTL the only changes I made was to add support for the processors that I have. The current code only had support for the uc3b1256 which isn't one that I have.

Michel

For Linux Software visit http://home.comcast.net/~mcatudal

Reply by email