Recent

Author Topic: Lazarus has Synesthesia  (Read 4230 times)

dbannon

  • Hero Member
  • *****
  • Posts: 2203
    • tomboy-ng, a rewrite of the classic Tomboy
Lazarus has Synesthesia
« on: January 03, 2022, 01:26:57 pm »
OK, this is really, really strange.

I'm using lazarus main, initially from last December, now from today. And my object inspector looks like the attached image. Note that properties like Left, PixelsPerInch, Top have a color ??

Sounds like Synesthesia to me, now, Lazarus is intelligent but so intelligent it starts having mental health issues ?  (Yeah, Synesthesia is not a Mental Health thing but ...).

I have created a new config, downloaded fresh source, rebooted, its always there, every project I open.

Go back to an older Lazarus (eg 2.2.0rc2) and its OK again.  What on earth is happening ? Anyone else seen anything like this ?

Linux U20.04, Lazarus-Main

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

PascalDragon

  • Hero Member
  • *****
  • Posts: 4765
  • Compiler Developer
Re: Lazarus has Synesthesia
« Reply #1 on: January 03, 2022, 01:32:24 pm »
What version of FPC are you using? Cause there was a recent change in both FPC and Lazarus that would explain why you're experiencing this.

dbannon

  • Hero Member
  • *****
  • Posts: 2203
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Lazarus has Synesthesia
« Reply #2 on: January 03, 2022, 01:40:59 pm »
fpc-3.2.3 from october last year.

But I am building Lazarus itself with 3.2.0 (I think, will check). I have not had a new FPC since October anyway.

EDIT: No, wrong, I am building Lazarus with that October 3.2.3 too.  I still have an 3.2.0 install, should I try it ?

Davo
« Last Edit: January 03, 2022, 01:44:58 pm by dbannon »
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

PascalDragon

  • Hero Member
  • *****
  • Posts: 4765
  • Compiler Developer
Re: Lazarus has Synesthesia
« Reply #3 on: January 03, 2022, 01:47:07 pm »
If it should turn out that your Lazarus is build with 3.2.3 and not 3.2.0 then you should update your FPC, cause the change I mentioned was merged around a month ago. Only the latest 3.2.3 commit is considered supported and Lazarus only tests against the version number.
If you do indeed build Lazarus with 3.2.0 then we need to dig a bit more...

dbannon

  • Hero Member
  • *****
  • Posts: 2203
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Lazarus has Synesthesia
« Reply #4 on: January 03, 2022, 01:55:04 pm »

OK, thanks PD, I have rebuild with FPC3.2.0 and its fine, no problems. So, sounds like you are aware of whats happening, no bug report needed, I'll pull down a newer FPC tomorrow....

Thanks, that was quite interesting !

I'm trying to imagine what could go wrong in the compiler to produce that strange and very specific effect but still build everything else fine ??

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

PascalDragon

  • Hero Member
  • *****
  • Posts: 4765
  • Compiler Developer
Re: Lazarus has Synesthesia
« Reply #5 on: January 03, 2022, 02:14:23 pm »
It's nothing in the compiler that goes wrong, it's how TColor is declared that is the problem.

In a correctly working Lazarus/FPC combination (namely before the change I mentioned and after it) TColor is essentially declared as

Code: Pascal  [Select][+][-]
  1. type
  2.   TColor = type LongWord;

It's important that it is declared as a unique type as otherwise the type information for TColor and LongWord won't be different.

Now, if you have a wrong combination of Lazarus and FPC (in your case: Lazarus after the fix, FPC before the fix) you'll essentially have the following:

Code: Pascal  [Select][+][-]
  1. type
  2.   TColor = LongWord;

This difference essentially has no problems in normal programs except for a specific one: The IDE registers a property handler for all TColor properties. Now in the second case TypeInfo(TColor) = TypeInfo(LongInt), thus the property handler was registers for all LongInt properties! If the two types are distinct the LongInt properties aren't affected obviously ;)

dbannon

  • Hero Member
  • *****
  • Posts: 2203
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Lazarus has Synesthesia
« Reply #6 on: January 03, 2022, 02:38:54 pm »
Wow, thats subtle ! Thanks for explaining.

I'll stick with FPC 3.20 for now, at least until the next call for testing. It looks like the changes you mention are not going into fixes 3.2 and main is just a bit scary.

Thanks Again !

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

PascalDragon

  • Hero Member
  • *****
  • Posts: 4765
  • Compiler Developer
Re: Lazarus has Synesthesia
« Reply #7 on: January 04, 2022, 09:02:14 am »
It looks like the changes you mention are not going into fixes 3.2 and main is just a bit scary.

What do you mean? The changes for this are in both FPC main and 3.2.3 (which will become the next 3.2.4 release) as well as Lazarus main and the upcoming 2.2 release. It's just that you're using a FPC 3.2.3 that can no longer be considered up to date (3.2.3 is a moving target after all).

dbannon

  • Hero Member
  • *****
  • Posts: 2203
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Lazarus has Synesthesia
« Reply #8 on: January 04, 2022, 11:08:55 am »
OK, my bad. I was looking at the tag "3.2.3" (no action for 7 months) but there is a separate version "fixes_3_2", that does have recent, including the TColor, commits, see attached.

So, when the talk was about "3.2.3", well, it is a touch confusing. But the one to get is obviously, Fixes_3_2 . Good !

Thanks

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

PascalDragon

  • Hero Member
  • *****
  • Posts: 4765
  • Compiler Developer
Re: Lazarus has Synesthesia
« Reply #9 on: January 04, 2022, 01:22:19 pm »
OK, my bad. I was looking at the tag "3.2.3" (no action for 7 months) but there is a separate version "fixes_3_2", that does have recent, including the TColor, commits, see attached.

That tag probably got created during the conversion from SVN to Git.

So, when the talk was about "3.2.3", well, it is a touch confusing. But the one to get is obviously, Fixes_3_2 . Good !

Just keep in mind that if the lowest number is odd (3.2.3, 3.3.1), it's a development version, thus it's always a moving target.

 

TinyPortal © 2005-2018