Alex-Gamper / Ada-NetFramework

Ada bindings to the Microsoft NetFramework Api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NetframeworkTest raised CONSTRAINT_ERROR : netframeworkadaruntime.adb:244 access check failed

luzidchris opened this issue · comments

commented

Hi,

first of all thank you so much for this project! It's pretty exciting that there's the chance to develop Ada-written .NET applications.

Unfortunately, I'm running into an exception error when executing the test project. I've loaded the solution in VisualStudio 2019 (v142, Windows SDK 10). I had to change the GCC/GNAT path of the test project to match my mingw32 installation (using 9.1.0 while project is preset to 9.2.0). All projects are built fine and without any issues.

But when trying to run the test project, the application crashes with the following output:
`
'NetframeworkTest.exe' (Win32): Loaded 'D:\shared\ada\DOTNET_Ada\another\Ada-NetFramework\NetframeworkTest\x64\Debug\NetframeworkTest.exe'. Symbols loaded.
'NetframeworkTest.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'.
'NetframeworkTest.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'.
'NetframeworkTest.exe' (Win32): Loaded 'C:\Windows\System32\KernelBase.dll'.
'NetframeworkTest.exe' (Win32): Loaded 'C:\Windows\System32\api-ms-win-crt-runtime-l1-1-0.dll'.
'NetframeworkTest.exe' (Win32): Loaded 'C:\Windows\System32\ucrtbase.dll'.
'NetframeworkTest.exe' (Win32): Loaded 'C:\Windows\System32\api-ms-win-core-timezone-l1-1-0.dll'.
'NetframeworkTest.exe' (Win32): Loaded 'C:\Windows\System32\api-ms-win-core-file-l2-1-0.dll'.
'NetframeworkTest.exe' (Win32): Loaded 'C:\Windows\System32\api-ms-win-core-localization-l1-2-0.dll'.
'NetframeworkTest.exe' (Win32): Loaded 'C:\Windows\System32\api-ms-win-core-synch-l1-2-0.dll'.
'NetframeworkTest.exe' (Win32): Loaded 'C:\Windows\System32\api-ms-win-core-processthreads-l1-1-1.dll'.
'NetframeworkTest.exe' (Win32): Loaded 'C:\Windows\System32\api-ms-win-core-file-l1-2-0.dll'.
'NetframeworkTest.exe' (Win32): Loaded 'C:\Windows\System32\api-ms-win-crt-math-l1-1-0.dll'.
'NetframeworkTest.exe' (Win32): Loaded 'C:\Windows\System32\api-ms-win-crt-stdio-l1-1-0.dll'.
'NetframeworkTest.exe' (Win32): Loaded 'C:\Windows\System32\api-ms-win-crt-locale-l1-1-0.dll'.
'NetframeworkTest.exe' (Win32): Loaded 'C:\Windows\System32\api-ms-win-crt-heap-l1-1-0.dll'.
'NetframeworkTest.exe' (Win32): Loaded 'C:\Windows\System32\api-ms-win-crt-string-l1-1-0.dll'.
'NetframeworkTest.exe' (Win32): Loaded 'C:\Windows\System32\vcruntime140.dll'.
'NetframeworkTest.exe' (Win32): Loaded 'C:\Windows\System32\api-ms-win-crt-convert-l1-1-0.dll'.
'NetframeworkTest.exe' (Win32): Loaded 'C:\Windows\System32\msvcrt.dll'.
'NetframeworkTest.exe' (Win32): Loaded 'C:\Windows\System32\shell32.dll'.
'NetframeworkTest.exe' (Win32): Loaded 'C:\Windows\System32\shlwapi.dll'.
'NetframeworkTest.exe' (Win32): Loaded 'C:\Windows\System32\gdi32.dll'.
'NetframeworkTest.exe' (Win32): Loaded 'C:\Windows\System32\user32.dll'.
'NetframeworkTest.exe' (Win32): Loaded 'C:\Windows\System32\lpk.dll'.
'NetframeworkTest.exe' (Win32): Loaded 'C:\Windows\System32\usp10.dll'.
'NetframeworkTest.exe' (Win32): Loaded 'C:\Windows\System32\advapi32.dll'.
'NetframeworkTest.exe' (Win32): Loaded 'C:\Windows\System32\sechost.dll'.
'NetframeworkTest.exe' (Win32): Loaded 'C:\Windows\System32\rpcrt4.dll'.
'NetframeworkTest.exe' (Win32): Loaded 'C:\Windows\System32\mscoree.dll'.
'NetframeworkTest.exe' (Win32): Loaded 'C:\Windows\System32\ole32.dll'.
'NetframeworkTest.exe' (Win32): Loaded 'C:\Windows\System32\oleaut32.dll'.
'NetframeworkTest.exe' (Win32): Loaded 'C:\Windows\System32\imm32.dll'.
'NetframeworkTest.exe' (Win32): Loaded 'C:\Windows\System32\msctf.dll'.
The thread 0x2e8c has exited with code 0 (0x0).
'NetframeworkTest.exe' (Win32): Loaded 'C:\Windows\System32\cryptbase.dll'.
'NetframeworkTest.exe' (Win32): Loaded 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscoreei.dll'.
'NetframeworkTest.exe' (Win32): Loaded 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll'.
'NetframeworkTest.exe' (Win32): Loaded 'C:\Windows\System32\vcruntime140_clr0400.dll'.
'NetframeworkTest.exe' (Win32): Loaded 'C:\Windows\System32\ucrtbase_clr0400.dll'.
Exception thrown at 0x000007FEFD86B87D (KernelBase.dll) in NetframeworkTest.exe: 0x04242420 (parameters: 0x0000000031415927, 0x000007FEE1220000, 0x00000000002DED50).
'NetframeworkTest.exe' (Win32): Loaded 'C:\Windows\assembly\NativeImages_v4.0.30319_64\mscorlib\7fab566d563ec7b74b7696d436ef82d6\mscorlib.ni.dll'.
'NetframeworkTest.exe' (Win32): Loaded 'C:\Windows\System32\clbcatq.dll'.
Exception thrown at 0x000007FEFD86B87D (KernelBase.dll) in NetframeworkTest.exe: 0x20474343 (parameters: 0x00000000006460A0).
CONSTRAINT_ERROR
netframeworkadaruntime.adb:244 access check failed
raised CONSTRAINT_ERROR : netframeworkadaruntime.adb:244 access check failed
Call stack traceback locations:
0x13f5c13f1 0x13f6c5d12 0x13f5694f4 0x13f5695cd 0x13f568601 0x13f86ad5a 0x779b556b 0x77c1372b

'NetframeworkTest.exe' (Win32): Loaded 'C:\Windows\System32\cryptsp.dll'.
'NetframeworkTest.exe' (Win32): Loaded 'C:\Windows\System32\rsaenh.dll'.
'NetframeworkTest.exe' (Win32): Loaded 'C:\Windows\System32\RpcRtRemote.dll'.
The thread 0x29c4 has exited with code 0 (0x0).
The thread 0x1d08 has exited with code 0 (0x0).
The thread 0x1cc4 has exited with code 0 (0x0).
The thread 0x2050 has exited with code 0 (0x0).
The thread 0x26dc has exited with code 0 (0x0).
The thread 0x3194 has exited with code 0 (0x0).
The thread 0x33fc has exited with code 0 (0x0).
The thread 0x19a8 has exited with code 0 (0x0).
The program '[0x14AC] NetframeworkTest.exe' has exited with code 0 (0x0).
`

Is there anything, I've to do additionally to setting up the GCC/GNAT environment paths in the project or might there be an issue with 9.1.0?

Thanks & regards,
Chris

Hi Chris

Did the build successfully register the "NetframeworkAdaBridge" project/dll. You will need admin
privs to do this. You can check this by setting a breakpoint on the line 244 and check if the
runtime variable is set correctly (ie not null)

Alex

commented

Hi Alex,

thanks, that worked fine! Unfortunately, I'm now running into exception errors for the "...._Out_Param" tests while all other tests are finished without errors.

The exceptions for the failing tests seem to be different among each other (e.g. Exception thrown at 0x000007FEFEDD465B (oleaut32.dll) in NetframeworkTest.exe: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF @NetFrameworkBase.System.Version.adb:779 - test Test_RefenceType_Out_Param).

I have to investigate more to provide better info and exclude problems resulting from my setup (at least as best as I can..). I'm a bit short of time the next days but will come back on this on weekend. I guess this would also be subject of a different issue thread since this one has definitely been resolved.

Thank you for the quick reply and the fix!!

Regards,
Chris