Recent

Author Topic: interface and GUID something  (Read 2628 times)

egsuh

  • Hero Member
  • *****
  • Posts: 1773
interface and GUID something
« on: February 20, 2026, 08:31:02 am »
Hello,

I'm defining interface (of course not interface section, but a descendant of IInterface) without GUID.
But this causes compile problems sometimes -- not always.
It causes "internal error 200611031' at any random place of the unit containing interface.

This disappears if I build? (shift-F9) the project.
Does interface need a GUID definition? If then how can I use it?  I can create a GUID by simply clicking Ctrl-Shift-G.

cdbc

  • Hero Member
  • *****
  • Posts: 2716
    • http://www.cdbc.dk
Re: interface and GUID something
« Reply #1 on: February 20, 2026, 08:38:51 am »
Hi
Yes COM interfaces need (operates better) with a GUID, I always assign a GUID to my interfaces COM or CORBA!!! (the corba one can just be its type-name as a string)
The AS & IS operators depend heavily on it.
Just do [Ctrl + Shift + G] every time, saves you the hassle  ;D
Regards Benny
« Last Edit: February 20, 2026, 08:40:36 am by cdbc »
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

440bx

  • Hero Member
  • *****
  • Posts: 6317
Re: interface and GUID something
« Reply #2 on: February 20, 2026, 08:48:13 am »
It causes "internal error 200611031' at any random place of the unit containing interface.
You should probably report that as a bug along with example code that causes the internal error.

AFAIK, internal errors are considered compiler bugs.  IOW, something that should never take place.
FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

cdbc

  • Hero Member
  • *****
  • Posts: 2716
    • http://www.cdbc.dk
Re: interface and GUID something
« Reply #3 on: February 20, 2026, 10:43:51 am »
Hi
Yeah, @440bx is right, provide some sample code and I'll compile it with trunk and see what happens, bets are, it's already fixed there...
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

egsuh

  • Hero Member
  • *****
  • Posts: 1773
Re: interface and GUID something
« Reply #4 on: February 20, 2026, 11:38:03 am »
Well, if I can replicate it then I'll post the example.

Thaddy

  • Hero Member
  • *****
  • Posts: 18914
  • Glad to be alive.
Re: interface and GUID something
« Reply #5 on: February 21, 2026, 11:10:37 am »
That internal error stems from the symsym.pas procedure Tprocsym.deref in the compiler sources.
As far as I can see that can only happen if you mix interface references and class references to the same entity where either one of them has gone out of scope or free'd and it is referenced afterwards: the procdefdereflist is already destroyed but you are trying to use it. (It is always created!)
It should be reported, but we really need an example of how you use your interfaced code to see if the above is indeed the case and if the internal error is still thrown in fixes or trunk.
Note that the code path that throws the internal error also indicates that you made an error in the way you use interfaces. So even if the internal error does not occur, there is still your own error in the code, which may manifest itself as a warning or error, but also as e.g. a memory leak or a double free exception.
« Last Edit: February 21, 2026, 11:17:54 am by Thaddy »
Recovered from removal of tumor in tongue following tongue reconstruction with a part from my leg.

egsuh

  • Hero Member
  • *****
  • Posts: 1773
Re: interface and GUID something
« Reply #6 on: February 22, 2026, 06:37:07 am »
Quote
As far as I can see that can only happen if you mix interface references and class references to the same entity where either one of them has gone out of scope or free'd and it is referenced afterwards:

I said the error occurs during compilation.

Anyway I'm trying to create a miniature structure of what I've defined, but cannot post the whole project as is, as there are many units  used.

Thaddy

  • Hero Member
  • *****
  • Posts: 18914
  • Glad to be alive.
Re: interface and GUID something
« Reply #7 on: February 22, 2026, 08:24:13 am »
I said the error occurs during compilation.
Of course... That is obvious.
Recovered from removal of tumor in tongue following tongue reconstruction with a part from my leg.

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1225
Re: interface and GUID something
« Reply #8 on: March 12, 2026, 10:05:56 pm »
Hello,

I'm defining interface (of course not interface section, but a descendant of IInterface) without GUID.
But this causes compile problems sometimes -- not always.
It causes "internal error 200611031' at any random place of the unit containing interface.

This disappears if I build? (shift-F9) the project.
Does interface need a GUID definition? If then how can I use it?  I can create a GUID by simply clicking Ctrl-Shift-G.

Solved?

egsuh

  • Hero Member
  • *****
  • Posts: 1773
Re: interface and GUID something
« Reply #9 on: March 13, 2026, 03:31:00 am »
Quote
Solved?

No. This happens when I change something of the code and press Ctrl-F9. Does not happen when I press Shift-F9.
I'm trying to create a small replication, but not successful yet. It is possible that the cause of error may be somewhere else, in my own codes ---- but this is weird because the error occurs at compilation time, not runtime.

 

TinyPortal © 2005-2018