Forum > Beginners

FPC Fatal:Internal Error 2006012304

(1/3) > >>

TYDQ:
 I am testing my Pascal OS and trying to cross complie my pascal code in aarch64 Architecture to adapt to aarch64 uefi mode.(My code is too large to present it in this forum,so I have to place them to my repository in githubhttps://github.com/TYDQSoft/UEFIPascalOS)
uefiinstaller.pas and uefimain.pas cannot be showed to you due to maximum allowed length so please look up my github to see it.
I am using free pascal compiler version 3.3.1 and cross compiler have been installed on my machine.
This is my shell code for aarch64 architecture:

--- Code: Bash  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---/home/tydq/下载/source/compiler/ppcrossa64 -n -O- -Si -Sc -Sg -Xd -CX -XXs -Tlinux -Cg uefiinstaller.pas        /home/tydq/下载/source/compiler/ppcrossa64 -n -O- -Si -Sc -Sg -Xd -CX -XXs -Tlinux -Cg uefimain.pas        mkdir installer        aarch64-linux-gnu-ld -shared -Bsymbolic --gc-sections -ffreestanding -fno-stack-protector -fno-stack-check -fshort-wchar --no-keep-memory -nostdlib  uefiinstaller.o uefi.o tydqfs.o system.o -e efi_main -o installer.so        aarch64-linux-gnu-objcopy -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel -j .rela -j .rel.* -j .rela.* -j .reloc --target=efi-app-aarch64 --subsystem=10 installer.so installer/bootx64.efi        mkdir kernel        aarch64-linux-gnu-ld -shared -Bsymbolic --gc-sections -ffreestanding -fno-stack-protector -fno-stack-check -fshort-wchar --no-keep-memory -nostdlib uefimain.o uefi.o tydqfs.o system.o -e efi_main -o main.so        aarch64-linux-gnu-objcopy -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel -j .rela -j .rel.* -j .rela.* -j .reloc --target=efi-app-aarch64 --subsystem=10 main.so kernel/bootaarch64.efi        dd if=/dev/zero of=fat.img bs=512 count=131072        /usr/sbin/mkfs.vfat -F 32 fat.img        mmd -i fat.img ::        mmd -i fat.img ::/EFI        mmd -i fat.img ::/EFI/BOOT        mmd -i fat.img ::/EFI/SETUP        mcopy -i fat.img installer/bootx64.efi ::/EFI/BOOT        mcopy -i fat.img kernel/bootx64.efi ::/EFI/SETUP        mkdir iso        cp fat.img iso        xorriso -as mkisofs -R -f -e fat.img -no-emul-boot -o TestOS.iso iso        rm -rf iso        rm -rf *.ppu        rm -rf fat.img        rm -rf *.o        rm -rf installer        rm -rf kernelAfter run bash isobuild.sh,I get two errors that:
uefiinstaller.pas(2,10) Fatal: Internal error 2006012304
Fatal: Compilation aborted
uefimain.pas(2,10) Fatal: Internal error 2006012304
Fatal: Compilation aborted
So does anyone meet this kind of error and how to solve it?

TYDQ:
Does this topic should be moved to FPC development?

Thaddy:
I usually grep the compiler sources to find the internal error and analyze from that spot.
It will show you the condition(s) that are NOT met and you can work from there,
Named internal errors are usually unique.
Run this from the root of the compiler sources:

--- Code: Bash  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---grep -nHIirF -- 2006012304 The error is in symbase.pas and indicates that the stack field of type psymtablestackitem from TSymtableStack is not assigned. That stack var is a Pointer to record(s) of Tsymtablestackitem(s).
With this information it is probably easy to fix: just find where the compiler needs to initialize that field. And that happens in TSymtableStack.Push. Pop will eventually empty the stack and the detructor does that too: in both cases the stack becomes nil again.Ergo, you can not call top on an empty stack which seems reasonable  ;)
I wonder why someone who is trying to build his own compiler can not even make this 30 second analysis.. That is really a bit disapointing. Grep is your friend, remember that.

TYDQ:

--- Quote from: Thaddy on May 26, 2024, 06:16:39 am ---I usually grep the compiler sources to find the internal error and analyze from that spot.
It will show you the condition(s) that are NOT met and you can work from there,
Named internal errors are usually unique.
Run this from the root of the compiler sources:

--- Code: Bash  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---grep -nHIirF -- 2006012304 The error is in symbase.pas and indicates that the stack field of type psymtablestackitem from TSymtableStack is not assigned. That stack var is a Pointer to record(s) of Tsymtablestackitem(s).
With this information it is probably easy to fix: just find where the compiler needs to initialize that field. And that happens in TSymtableStack.Push. Pop will eventually empty the stack and the detructor does that too: in both cases the stack becomes nil again.Ergo, you can not call top on an empty stack which seems reasonable  ;)
I wonder why someone who is trying to build his own compiler can not even make this 30 second analysis.. That is really a bit disapointing. Grep is your friend, remember that.

--- End quote ---
Thank you,grep can find the error occurs but I didn't think even once.
However,how to modify the symbase.pas and initialize the stack to not to be nil?

marcov:
It is a sanity check. The problem is not there, but somewhere else where the pointer isn't assigned.

The best is to try to reduce the problem as much as possible and submit it, so that compiler developers can easily reproduce it.

Usually I simply take a copy of the project, and start removing non relevant stuff to the error location, occasionally checking the error is still there, and reverting the last changes from the copy if it isn't.

Navigation

[0] Message Index

[#] Next page

Go to full version