Recent

Author Topic: Strange Error in My Code and I don't know what to do.  (Read 425 times)

TYDQ

  • Full Member
  • ***
  • Posts: 170
Strange Error in My Code and I don't know what to do.
« on: February 11, 2026, 09:18:58 am »
These days I am using free pascal compiler latest stable version and I got some strange error.
I want to search for a symbol with Google City Hash(in unihash.pas) with my algoritm in assembly text file(system.s), but I got the error internally in my unias,like that:
Code: Text  [Select][+][-]
  1. ERROR in Column 206,Row 20
  2.   .size fpc_setjmp, .Le0 - fpc_setjmp
  3.                     ^^^^
  4. ERROR Detail:Label .Le0 does not exist in the file.
I tried to find the error,but I discovered that the hash value in same symbol (.Le0) generated former and latter is not same,does it is the error in compiler or the value management of fpc is not same?
« Last Edit: February 11, 2026, 10:38:26 am by TYDQ »

jamie

  • Hero Member
  • *****
  • Posts: 7543
Re: Strange Error in My Code and I don't know what to do.
« Reply #1 on: February 11, 2026, 11:57:16 am »
Are you using generics?
The only true wisdom is knowing you know nothing

Zvoni

  • Hero Member
  • *****
  • Posts: 3269
Re: Strange Error in My Code and I don't know what to do.
« Reply #2 on: February 11, 2026, 12:12:12 pm »
the only fishy thing i could see, is that his label ".Le0:" in system.s is preceeded by an empty Label ".Lc49:" (and there are more labels like this following later on --> ".Le1" and others)

OTOH, i have no clue whatsoever about Assembler
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

jamie

  • Hero Member
  • *****
  • Posts: 7543
Re: Strange Error in My Code and I don't know what to do.
« Reply #3 on: February 11, 2026, 12:34:36 pm »
I didn't look at the sample code but I do know using the generic collections I do get errors like that mainly on larger programs I do have some opinion about some of the coding practices in those collections but I'll keep that to myself for now.
The only true wisdom is knowing you know nothing

TYDQ

  • Full Member
  • ***
  • Posts: 170
Re: Strange Error in My Code and I don't know what to do.
« Reply #4 on: February 11, 2026, 01:02:02 pm »
Are you using generics?
No,I am not using generics but I have no clue about errors in the hash function.
So where the error occurs that one symbol with two different hash value?

TYDQ

  • Full Member
  • ***
  • Posts: 170
Re: Strange Error in My Code and I don't know what to do.
« Reply #5 on: February 11, 2026, 01:03:58 pm »
the only fishy thing i could see, is that his label ".Le0:" in system.s is preceeded by an empty Label ".Lc49:" (and there are more labels like this following later on --> ".Le1" and others)

OTOH, i have no clue whatsoever about Assembler
This is fpc generated assembly for LoongArch64. I don't know how fpc generated this assembly.

bytebites

  • Hero Member
  • *****
  • Posts: 778
Re: Strange Error in My Code and I don't know what to do.
« Reply #6 on: February 11, 2026, 07:55:44 pm »
Line 6619 in uniasinfo.pas obviously array too small.
Code: Pascal  [Select][+][-]
  1.   SetLengthWithZeroMemory(TempParamTypeList.ParamType,2);                  

Actual issue is in unianalysis.pas line 2693
Code: Pascal  [Select][+][-]
  1.        Result.SymbolList.SymbolList.SymbolName[Result.SymbolList.SymbolList.SymbolCount-1]:=
  2.        BasePart.LabelName;
  3.        Result.SymbolList.SymbolList.SymbolNameHash[Result.SymbolList.SymbolList.SymbolCount-1]:=
  4.        unihash_generate_value(BasePart.LabelName);
  5.        Result.SymbolList.SymbolList.SymbolSectionName[Result.SymbolList.SymbolList.SymbolCount-1]:=
  6.        Result.Section[SectionIndex-1].SectionName;
  7.        Result.SymbolList.SymbolList.SymbolNameHash[Result.SymbolList.SymbolList.SymbolCount-1]:=  //overwrites previous correct hash!
  8.        Result.Section[SectionIndex-1].SectionHash;
  9.        Result.SymbolList.SymbolList.SymbolValue[Result.SymbolList.SymbolList.SymbolCount-1]:=StartOffset;
  10.  

TYDQ

  • Full Member
  • ***
  • Posts: 170
Re: Strange Error in My Code and I don't know what to do.
« Reply #7 on: February 12, 2026, 01:17:35 am »
Line 6619 in uniasinfo.pas obviously array too small.
Code: Pascal  [Select][+][-]
  1.   SetLengthWithZeroMemory(TempParamTypeList.ParamType,2);                  

Actual issue is in unianalysis.pas line 2693
Code: Pascal  [Select][+][-]
  1.        Result.SymbolList.SymbolList.SymbolName[Result.SymbolList.SymbolList.SymbolCount-1]:=
  2.        BasePart.LabelName;
  3.        Result.SymbolList.SymbolList.SymbolNameHash[Result.SymbolList.SymbolList.SymbolCount-1]:=
  4.        unihash_generate_value(BasePart.LabelName);
  5.        Result.SymbolList.SymbolList.SymbolSectionName[Result.SymbolList.SymbolList.SymbolCount-1]:=
  6.        Result.Section[SectionIndex-1].SectionName;
  7.        Result.SymbolList.SymbolList.SymbolNameHash[Result.SymbolList.SymbolList.SymbolCount-1]:=  //overwrites previous correct hash!
  8.        Result.Section[SectionIndex-1].SectionHash;
  9.        Result.SymbolList.SymbolList.SymbolValue[Result.SymbolList.SymbolList.SymbolCount-1]:=StartOffset;
  10.  
Thanks a lot for you pointing out my problem.

 

TinyPortal © 2005-2018