Sign in Join

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

Mailing lists / fpc-pascal / 2021-02

Statically linked-in fpc code

11 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

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

Adriaan van Os

I am getting crashes on Mac OS X 10.8.5 in a C-program with statically linked-in fpc code. The crashes seem related to fpc unit initialisation. This happens with fpc-3.2.0 but not when compiling the same code with fpc-3.0.4. Has something changed from 3.0.4 to 3.2.0 related to unit initialisation ?

Regards,

Adriaan van Os

Jonas Maebe
to Adriaan van Os
Adriaan van Os wrote 5 lines
I am getting crashes on Mac OS X 10.8.5 in a C-program with statically linked-in fpc code. The crashes seem related to fpc unit initialisation. This happens with fpc-3.2.0 but not when compiling the same code with fpc-3.0.4. Has something changed from 3.0.4 to 3.2.0 related to unit initialisation ?

Not that I remember. Where exactly does it crash?

Jonas

Adriaan van Os
to Jonas Maebe
Jonas Maebe wrote 8 lines
On 04/02/2021 21:26, Adriaan van Os via fpc-pascal wrote: > I am getting crashes on Mac OS X 10.8.5 in a C-program with statically > linked-in fpc code. The crashes seem related to fpc unit initialisation. > This happens with fpc-3.2.0 but not when compiling the same code with > fpc-3.0.4. Has something changed from 3.0.4 to 3.2.0 related to unit > initialisation ? Not that I remember. Where exactly does it crash?

It's crazy !
<https://bugs.freepascal.org/view.php?id=38440>

Regards,

Adriaan van Os

Adriaan van Os
to Jonas Maebe
Jonas Maebe wrote 6 lines
On 2021-02-05 09:24, Adriaan van Os via fpc-pascal wrote: > It's crazy ! > <https://bugs.freepascal.org/view.php?id=38440> The default fpc.cfg file contains this (both in 3.0.4 and 3.2.0):

Thanks for tne reply.

Show quoted text 7 lines
# For a debug version compile with debuginfo and all codegeneration checks on #IFDEF DEBUG -gl -Crtoi #WRITE Compiling Debug Version #ENDIF

I find such sneaky configuration files an extremely bad idea !

It seems the stack checking code causes issues for you in 3.2.0 for some reason.

It runs fine when compiling on the same Mac with gcc-3.0.4. So, there must have been a change between 3.0.4 and 3.2.0 ?

Regards,

Adriaan van Os

Adriaan van Os
to Adriaan van Os
Adriaan van Os wrote 19 lines
Jonas Maebe via fpc-pascal wrote: > On 2021-02-05 09:24, Adriaan van Os via fpc-pascal wrote: >> It's crazy ! >> <https://bugs.freepascal.org/view.php?id=38440> > > The default fpc.cfg file contains this (both in 3.0.4 and 3.2.0): > Thanks for tne reply. > # For a debug version compile with debuginfo and all codegeneration > checks on > #IFDEF DEBUG > -gl > -Crtoi > #WRITE Compiling Debug Version > #ENDIF I find such sneaky configuration files an extremely bad idea !

Also

1. Section 1.3.31 of the Programmer's manual says "By default, no stack checking is performed."

2. If it is broken with gpc-3.2.0, such the more reason to put it off. It doesn't do real stack-checking anyway.

Regards,

Adriaan van Os

Jonas Maebe
to Adriaan van Os
Adriaan van Os wrote
Also 1. Section 1.3.31 of the Programmer's manual says "By default, no stack checking is performed."

That is correct.

2. If it is broken with gpc-3.2.0, such the more reason to put it off. It doesn't do real stack-checking anyway.

It's not broken in general. E.g. the compiler cycles fine with -Ct on Darwin.

Jonas

Sven Barth
to Adriaan van Os: Also 1. Section 1.3.31 of the Programmer's manual says "By default, no stack checking is…

Adriaan van Os via fpc-pascal schrieb am
Fr., 5. Feb. 2021, 10:50:

Show quoted text 26 lines
Adriaan van Os via fpc-pascal wrote: > Jonas Maebe via fpc-pascal wrote: >> On 2021-02-05 09:24, Adriaan van Os via fpc-pascal wrote: >>> It's crazy ! >>> <https://bugs.freepascal.org/view.php?id=38440> >> >> The default fpc.cfg file contains this (both in 3.0.4 and 3.2.0): >> > > Thanks for tne reply. > >> # For a debug version compile with debuginfo and all codegeneration >> checks on >> #IFDEF DEBUG >> -gl >> -Crtoi >> #WRITE Compiling Debug Version >> #ENDIF > > I find such sneaky configuration files an extremely bad idea ! Also 1. Section 1.3.31 of the Programmer's manual says "By default, no stack checking is performed."

The default of the compiler *without* a configuration file (maybe we should mention that somewhere in the Programmer's Guide). For example C operators are disabled by default as well (see Programmer's Guide 1.2.10), but the default configuration file enables them.

Regards,
Sven

Michael Van Canneyt
to Sven Barth
Sven Barth wrote 34 lines
Adriaan van Os via fpc-pascal schrieb am Fr., 5. Feb. 2021, 10:50: > Adriaan van Os via fpc-pascal wrote: >> Jonas Maebe via fpc-pascal wrote: >>> On 2021-02-05 09:24, Adriaan van Os via fpc-pascal wrote: >>>> It's crazy ! >>>> <https://bugs.freepascal.org/view.php?id=38440> >>> >>> The default fpc.cfg file contains this (both in 3.0.4 and 3.2.0): >>> >> >> Thanks for tne reply. >> >>> # For a debug version compile with debuginfo and all codegeneration >>> checks on >>> #IFDEF DEBUG >>> -gl >>> -Crtoi >>> #WRITE Compiling Debug Version >>> #ENDIF >> >> I find such sneaky configuration files an extremely bad idea ! > > Also > > 1. Section 1.3.31 of the Programmer's manual says "By default, no stack > checking is performed." > The default of the compiler *without* a configuration file (maybe we should mention that somewhere in the Programmer's Guide). For example C operators are disabled by default as well (see Programmer's Guide 1.2.10), but the default configuration file enables them.
Not sure where the 1.3.31 came from, but stack checking is mentioned in
1.7.72;

https://www.freepascal.org/docs-html/current/prog/progsu72.html#x79-780001.2.72

I added a warning about defaults in the introduction of the section on directives, as it is valid for all defaults mentioned.

Michael.

Michael Van Canneyt
to Michael Van Canneyt
Michael Van Canneyt wrote 41 lines
On Fri, 5 Feb 2021, Sven Barth via fpc-pascal wrote: > Adriaan van Os via fpc-pascal schrieb am > Fr., 5. Feb. 2021, 10:50: > >> Adriaan van Os via fpc-pascal wrote: >>> Jonas Maebe via fpc-pascal wrote: >>>> On 2021-02-05 09:24, Adriaan van Os via fpc-pascal wrote: >>>>> It's crazy ! >>>>> <https://bugs.freepascal.org/view.php?id=38440> >>>> >>>> The default fpc.cfg file contains this (both in 3.0.4 and 3.2.0): >>>> >>> >>> Thanks for tne reply. >>> >>>> # For a debug version compile with debuginfo and all codegeneration >>>> checks on >>>> #IFDEF DEBUG >>>> -gl >>>> -Crtoi >>>> #WRITE Compiling Debug Version >>>> #ENDIF >>> >>> I find such sneaky configuration files an extremely bad idea ! >> >> Also >> >> 1. Section 1.3.31 of the Programmer's manual says "By default, no stack >> checking is performed." >> > > The default of the compiler *without* a configuration file (maybe we should > mention that somewhere in the Programmer's Guide). For example C operators > are disabled by default as well (see Programmer's Guide 1.2.10), but the > default configuration file enables them. Not sure where the 1.3.31 came from, but stack checking is mentioned in 1.7.72;

Make that 1.2.72 :-(

Michael.

Adriaan van Os
to Michael Van Canneyt: Not sure where the 1.3.31 came from, but stack checking is mentioned in 1.7.72;…
Michael Van Canneyt wrote
Not sure where the 1.3.31 came from, but stack checking is mentioned in 1.7.72;

For fpc-3.0.4 stack stacking is mentioned in 1.3.31 as a global directive. For 3.2.0 stack checking is indeed mentioned in 1.2.72 as a local directive. If the directive has changed from global to local, that change (if not doc-only) could have triggered that it is now broken for statically linked-in code.

Anybody made code changes related to stack-checking ?

Regards,

Adriaan van Os