External Sigsegv lazarus / 12-Debugger ---------------------------------------------------------------------- kleinewolf7 · 2019-04-06 19:34 My program refuses to run (compiler gives no error, only some hints) and states 'external: sigsegv'. There are 8 units with some procedures/functions that are used in the main program. I never had a problem until a few days. I think there's a problem with 'memory use'. Do I have used too many variables?Functions & procedures? Maybe the 'structure' of the whole program is misbuilt...I'm not a programmer. What can I do to fix this? Hints for an more optimal structure? ---------------------------------------------------------------------- af0815 · 2019-04-06 20:24 The first step is to use buildmodes and activate DEBUG. With this you see more clearly If you are not a programmer, you have to learn it ---------------------------------------------------------------------- Thausand · 2019-04-06 21:07 hi hello, Quote from: kleinewolf7 on April 06, 2019, 09:34:25 pmMy program refuses to run (compiler gives no error, only some hints) and states 'external: sigsegv'. 'external: sigsegv' alway programmer error  QuoteThere are 8 units with some procedures/functions that are used in the main program. Why you have 8 project file ? Unit not need .lpr / .lps. That  is confuse me and confuse Lazarus. Make unit name end ".pas" or ".pp" Need fix first then sigv error and try see why. QuoteHints for an more optimal structure? Make unit name better ---------------------------------------------------------------------- lainz · 2019-04-06 21:31 That usually happens when you're trying to access an object that is not initialized (You did not call .Create), or freeing an already freed object (calling .Free many times). ---------------------------------------------------------------------- Thausand · 2019-04-06 21:41 Quote from: Lainz on April 06, 2019, 11:31:12 pmThat usually happens when you're trying to access an object that is not initialized (You did not call .Create), or freeing an already freed object (calling .Free many times). Hi hello Lainz Program look turbo pascal no OOP. I not understand why not compile mode tp but do compile mode fpc. I try fp think that problem. ---------------------------------------------------------------------- lainz · 2019-04-06 21:47 Well, can be as well accessing and index of an array that's not inside the bounds. ---------------------------------------------------------------------- Peter H · 2019-04-06 22:04 The program runs, when the stack size in project options is set to 20 000 000. It generates the exception with stacksize default or stack size 2 000 000. This on windows 10 64 bit. The problem seems to be in unit "hulp": Procedure dop(el:element;h1,cl:real;as1,as1b:langs; aw:dwars;nas1,nas1b:integer;var d:matrix9); Procedure don(el:element;h1,cl:real;as2,as2b:langs; aw:dwars;nas2,nas2b:integer;VAR d:matrix9); The variable aw is a really large array that contains another large array in each element. With this declaration the program runs with default stacksize: Procedure dop(el:element;h1,cl:real;as1,as1b:langs;var aw:dwars;nas1,nas1b:integer;var d:matrix9); Procedure don(el:element;h1,cl:real;as2,as2b:langs;var aw:dwars;nas2,nas2b:integer;VAR d:matrix9); This is even better, it works also: Procedure dop(el:element;h1,cl:real;as1,as1b:langs;const aw:dwars;nas1,nas1b:integer;var d:matrix9); Procedure don(el:element;h1,cl:real;as2,as2b:langs;const aw:dwars;nas2,nas2b:integer;VAR d:matrix9); (I am a beginner with lazarus, had some fun playing around with this and learning.) ---------------------------------------------------------------------- kleinewolf7 · 2019-04-07 15:39 Thnx guys! I indeed think it's a memory-problem...I'll try it tonight Peter :-) I'm actually a construction engineer and I use sometimes some simple pascal programs to solve some local problems. The problem is that I indeed need and use a lot of values/variables. The same procedures (dop and don) didn't gave any problems until last week,when the program grew. I'll give it a try ---------------------------------------------------------------------- ccrause · 2019-04-08 08:08 Quote from: kleinewolf7 on April 07, 2019, 05:39:22 pmThnx guys! I indeed think it's a memory-problem... Stack checking (-Ct) may help in pinpointing the problem.  Included by default if you use DEBUG mode as suggested by af0815. ---------------------------------------------------------------------- Peter H · 2019-04-09 15:55 @kleinewolf7 I am a beginner in lazarus but not a beginner in programming. However, my professional  pascal experiences ended 30 years ago, when windows and delphi came up. I have studied electric engineering at a time when they punched ALGOL68 code into Hollerith cards and this was not fun, you had to wait some days to get the result. A programmable electronic pocket  calculator was  fun and faster for me. All my subsequent programming skills are learned on the job and out of pure interest. To compile your project in lazarus 2.0 I had to rename all *.lpr files to *.pp, only eurocode2.lpr stays unchanged. Then the project eurocode2 can be opened and compiled in lazarus. If the program is started in debug modus, the program stops with an exception in procedure "don" and when the mouse is pointed to the argument "aw", there appears a debugger window "unable to access memory". So easy is it in lazarus  and if you dont have it I recommend to install lazarus 2.0. I also recommend to increase the default stacksize and to activate stackchecking, in lazarus project options this should make life easier. I believe most programmers -included me- cannot write the program you wrote, because they dont have the necessary expert knowledge. So good luck with this.