Recent

Author Topic: recompiled an 2012 appl gives runtime error  (Read 373 times)

fikkies

  • Newbie
  • Posts: 4
recompiled an 2012 appl gives runtime error
« on: July 20, 2019, 09:28:02 pm »
I build a (rather complex) application in 2012 and I still use it.
It was build in 32 bits and also workes fine on recent 64 bit (Linux Mint)
Of course after 7 years some changes are nessecary and no problem compiling but when I run I get -- Acces Violation Press OK to ignore --
before the app itself starts, and the application stops.
on Debugging I get - for me unknown -  assembler codes.

Main question. Is there an old error  in the application or is the Lazarus 2012 version not (backward) compatible to the 1.8.2  version.

Frits


Thaddy

  • Hero Member
  • *****
  • Posts: 8458
Re: recompiled an 2012 appl gives runtime error
« Reply #1 on: July 20, 2019, 09:34:44 pm »
On some points, both the compiler and Lazarus are not fully backwards compatible.
The compiler issues are usually minor and documented in the release notes, including work-arounds tips how to modify your code.
They can have a major effect, though, if you are not aware of those changes.
Lazarus is (was) less well documented on breaking changes.

BTW: same issues exist with e.g. Delphi.

The most likely is, however, that there was already a bug in the existing code that is now revealed because of the compiler being more strict.
(e.g. less forgiving in the case of use-after-free)
« Last Edit: July 20, 2019, 09:43:00 pm by Thaddy »
Read the manuals and if you are a professional get a proper education in computer science. Makes the forum a lot cleaner.

fikkies

  • Newbie
  • Posts: 4
Re: recompiled an 2012 appl gives runtime error
« Reply #2 on: July 20, 2019, 09:49:23 pm »
thanks
Any way, I will have to break up all the modules and compile - debug them one by one,  starting with the database.

frits

af0815

  • Sr. Member
  • ****
  • Posts: 320
Re: recompiled an 2012 appl gives runtime error
« Reply #3 on: July 21, 2019, 09:02:16 am »
You can still create an old compiler side by side and recompile with it.
regards
Andreas

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 5515
    • wiki
Re: recompiled an 2012 appl gives runtime error
« Reply #4 on: July 21, 2019, 11:31:35 am »
When you get the asm code, have you tried the stack window? And the thread window (changing to each thread, watching the stack)

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7297
Re: recompiled an 2012 appl gives runtime error
« Reply #5 on: July 21, 2019, 01:57:05 pm »
I wouldn't really phrase it as the newer versions necessarily "more strict". That implies deliberation, which it is probably not.

More a result of chance memory layouts.

Thaddy

  • Hero Member
  • *****
  • Posts: 8458
Re: recompiled an 2012 appl gives runtime error
« Reply #6 on: July 21, 2019, 05:43:18 pm »
More a result of chance memory layouts.
With which you had a higher chance of succeeding on dangling pointers before 3.0.0. Hence my comment.
Read the manuals and if you are a professional get a proper education in computer science. Makes the forum a lot cleaner.