Exceptions in Windows x64
Original Reporter info from Mantis: Enigma
-
Reporter name:
Original Reporter info from Mantis: Enigma
- Reporter name:
Description:
FPC compiled files (for Win x64) are failing to handle exceptions under Try/Except Try/Finally
Any exception that winx64 executable is generating is causing crash. The problem is looking very simple, in win32 the exceptions handled by setting FS:[0], but in win64 the executable file should contain Exception directory where should be set up addresses of start and end exception handle block and the address of routine that handle exception.
Currently, FPC does not generate Exception directory for x64 files and so any exeption crash execution.
More info on x64 exceptions is there:
http://msdn.microsoft.com/en-us/library/1eyas8tf(VS.80).aspx
Steps to reproduce:
Just compile win x64 executable with the following code (intel assembler style):
try
asm
DB $CC // int 3
end;
except
end;
You can even set any exception there. Do not try to run this example under Debugger, because it will think that DB $CC is a break point, but not an exception generator.
also try this
try
asm
ud2
end;
except
end;
or
try
asm
xor rax, rax
xor [rax], rax
end;
except
end;
Mantis conversion info:
- Mantis ID: 14731
- OS: Windows
- OS Build: Vista/7
- Platform: x64
- Version: 2.5.1
- Monitored by: » mspiller (mspiller), » sethdgrover@gmail.com (Seth Grover)