Recent

Author Topic: -Ct causes exception with fpc apache module  (Read 1257 times)

toby

  • Sr. Member
  • ****
  • Posts: 275
-Ct causes exception with fpc apache module
« on: July 23, 2019, 10:44:11 pm »
Hi

I just updated my httpd server and then alway recompile all my fpc cgi and fpc apache modules

i coupled this with wanting to play with some fpc.cfg option to see about speed vs size of executables etc (-XX is wonderful)

i get no compiler errors when i compile any cgi or apache modules

but when i use -Ct  (which i thought caught stack problems in compiling) and restart my server i get
Set default codegeneration checks for stack

An unhandled exception occurred at $B74C5C04:
EStackOverflow: Stack overflow
  $B74C5C04
  $0809203D

when i access any web page or cgi or apache module the first TWO accesses of the server - then all seems okay

i traced it to the apache module (by commenting out the module loading in the httpd.conf)

but the cause is really using the -Ct option when compiling just the apache module (-Ct has no effect on the cgi programs)

i'd love to know what is really going on with -Ct and is there a way to use (it if it actually makes better code) doing some linux system or fpc code fix?

i tried increasing ulimit -s   but it had no effect unless i made it to small and then the httpd worker threads could be made


lucamar

  • Hero Member
  • *****
  • Posts: 4217
Re: -Ct causes exception with fpc apache module
« Reply #1 on: July 24, 2019, 01:08:55 am »
but when i use -Ct  (which i thought caught stack problems in compiling) [...]

I have no idea what your problem might be* but according to the manual (the User Reference actually):
Quote
-Ct   Generate stack checking code. If your program performs a faulty stack operation, a run-rime error will be generated.


*Since you're getting a Stack overflow, maybe you need to use option -Cs?
Quote
-Csxxx   Set stack size to xxx.
But this is just a shot in the dark, just looking for stack related options :-[
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

lucamar

  • Hero Member
  • *****
  • Posts: 4217
Re: -Ct causes exception with fpc apache module
« Reply #2 on: July 30, 2019, 11:31:11 pm »
I don't have much free-time at the moment but I'll give it a look when/if I can (it implies installing Apache in some machine or other, so be patient)

In the meantime, please read this wiki page, at least the first two sections: "Use code tags" and "Sharing large pieces of code". It may seem nitpicking but it's actually important :)
« Last Edit: July 30, 2019, 11:38:33 pm by lucamar »
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

 

TinyPortal © 2005-2018