Pelles C forum
Pelles C => Bug reports => Topic started by: dezmand07 on January 05, 2025, 10:46:08 PM
-
Hello. I found a bug in the pocc.exe compiler.
In Windows 11 23H2 (build 23631) compilation is fine.
But in Windows 11 24H2 (build 26100) the error is 0xC0000005
(https://i.ibb.co/ZHG8vm0/1.png) (https://imgbb.com/)
The exception in pocc.exe occurs when closing handles with the CloseHandle function in ntdll.SbSelectProcedure on the movaps instruction.
For Windows 11 24H2 (build 26100) the movaps instruction requires that the operand address be aligned to 16 bytes
(https://i.ibb.co/sm51Z6h/2.png) (https://imgbb.com/)
Fix it please.
-
Bit strange, if only pocc.exe suffer that kind of problem ???
-
No expert here but isn't is also strange that programs created with the theorized non-alignment issue in prior versions of Windows apparently still run fine in Win 11 24H2? I would assume that the issue should affect running programs not just the Pelles Compiling/Linking process ?
Fortunately for me I have a WIN10 system running that could not handle the downgrade to WIN 11 ;D
Unfortunately not the case for my main computing system which is still 23H2 so far but any day now it could go to the dark side...
John Z
-
Hi dezmand07,
Any chance to repeaet the test on Windows 10?
-
Hi Vortex.
I have Windows 10 22H2 (build 19045) installed on a Hyper-V VM.
At the moment, I continue to develop my projects from a virtual machine, since my main operating system is Windows 11 24H2 (build 26100).
I don’t see any problems with IDE Pelles C in Windows 10.
-
Hi,
At the start of this particular thread regarding WIN 11 24H2 'bug'/impact on Pelles C the file ntdll.dll was pointed to as being involved.
The attached shows where two ntdll.dll files are system32 and SysWOW64.
On my WIN 11 23H2 the file version in both places is 10.0.2261.4541 and the create date and file size are shown in the attachment.
Can someone with a WIN 11 24H2 system check on the version of the ntdll.dll files to verify it is different?
John Z
-
Here are he version of NTDLL.DLL before and after installing the V24 version :-[
-
Retrieving the version of a file with Visual Basic script :
' http://blogs.technet.com/b/heyscriptingguy/archive/2005/04/18/how-can-i-determine-the-version-number-of-a-file.aspx
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colFiles = objWMIService.ExecQuery _
("Select * from CIM_Datafile Where Name = 'C:\\Windows\\System32\\ntdll.dll'")
For Each objFile in colFiles
Wscript.Echo objFile.Version
Next
-
John Z,
Windows 11 24H2 (build 26100.2605)
ntdll.dll (System32) - 10.0.26100.2454
ntdll.dll (SysWOW64) - 10.0.26100.2605
-
Thanks all,
Good to know and record.
John Z
-
Is this a bug in Windows 11? I wonder if this was fixed by Microsoft for patch Tuesday. Can anyone test it?
-
If you don't use the IDE for compiling & linking there is no problem
-
If Pelles ever creates a workaround for this, I'd recommend having a way to disable the workaround in the options as it's possible that Microsoft may fix this problem in the future and possibly already has fixed it this patch Tuesday. Could anyone test Pelles C after applying the newest update today? I don't have a Windows 11 computer running at the moment.
-
Not for me >:(
-
This code calls renamed pocc.exe as poccx.exe
An actual pocc.exe error code not even handled.
A poccx.exe have to have a full path to Pelles C bin folder.
Just a temporary solution to 24H2 problem
- rename original pocc.exe to poccx.exe
- copy fake pocc.exe to Pelles c bin folder
// pocc.c
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdio.h>
int __cdecl mainCRTStartup(void)
{
HANDLE hRead, hWrite;
SECURITY_ATTRIBUTES sa;
STARTUPINFO si;
PROCESS_INFORMATION pi;
DWORD nRead, nWrite, nErr;
char *lpszCmdLine, *pChar;
char szProg[1024];
char szBuff[1024];
HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
DWORD nLen = GetModuleFileName(NULL, szProg, sizeof(szProg));
nLen -= 4;
lstrcpy(szProg+nLen, "x.exe ");
OutputDebugString(szProg);
lpszCmdLine = GetCommandLine();
pChar = lpszCmdLine;
if (*pChar == '"') {
pChar++;
while (*pChar && *pChar != '"')
pChar++;
pChar++;
} else {
while (*pChar && *pChar != ' ')
pChar++;
}
while (*pChar == ' ')
pChar++;
lstrcat(szProg, pChar);
OutputDebugString(pChar);
sa.nLength = sizeof(SECURITY_ATTRIBUTES);
sa.lpSecurityDescriptor = NULL;
sa.bInheritHandle = TRUE;
if (!CreatePipe(&hRead, &hWrite, &sa, 0)) {
// ERROR
nErr = 1;
} else {
si.cb = sizeof(STARTUPINFO);
GetStartupInfo(&si);
si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
si.hStdOutput = hWrite;
si.hStdError = hWrite;
si.wShowWindow = SW_SHOW; //SW_HIDE;
si.lpReserved = NULL;
//if (!CreateProcess(szProg, pChar, NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi)) {
if (!CreateProcess(NULL, szProg, NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi)) {
OutputDebugString("ERROR");
nErr = 1;
} else {
CloseHandle(hWrite);
WaitForSingleObject(pi.hProcess, 30000);
GetExitCodeProcess(pi.hProcess, &nErr);
//CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
while (TRUE) {
szBuff[0] = 0;
if (!ReadFile(hRead, szBuff, sizeof(szBuff)-1, &nRead, NULL))
break;
szBuff[nRead] = 0;
WriteFile(hStdOut, szBuff, nRead, &nWrite, NULL);
}
}
CloseHandle(hRead);
}
if (nErr == 0xC0000005) nErr = 0; // exception error
ExitProcess(nErr);
}
-
That seems a better solution than what I proposed. I will try. Thank You Timo
Philippe
-
Hi Timo
I have renamed the old pocc.exe to poccx.exe and unzipped yours.
I always have the error
> porc.exe -N "C:\Users\51966\Documents\DocsPhR\Assembleur\Awpe\Awpe.rc" -Fo"C:\Users\51966\Documents\DocsPhR\Assembleur\Awpe\Compile\Awpe.res"
Building Awpe.tag.
> pocc.exe -Tx64-coff -std:C2X -Zi -Ot -Ob1 -fp:precise -W1 -Gr -Ze -Zx -GX -J "C:\Users\51966\Documents\DocsPhR\Assembleur\Awpe\Create Dlg Sections.c" -Fo"C:\Users\51966\Documents\DocsPhR\Assembleur\Awpe\Compile\Create Dlg Sections.obj"
Building Awpe.tag.
> poasm.exe -AAMD64 -Zi -Gz -Fo"C:\Users\51966\Documents\DocsPhR\Assembleur\Awpe\Compile\Display Data Directories.obj" "C:\Users\51966\Documents\DocsPhR\Assembleur\Awpe\Display Data Directories.asm"
warning: Ignored in 64-bit mode: 'STDCALL'.
*** Error code: -1073741819 ***
Done.
-
Timo,
When the process exits could you return 0 if No errors found and just 1 if an error, like compiling, has been found.
It is for using ERRORLEVEL in a cmd file
If it is possible. I already ask to Pelle here in this forum.
-
So you mean if exception don't happen, a real pocc.exe error code returned ?
Isn't it a bit useless thing with 24H2 ?
In working system fake pocc.exe don't even needed.
-
I can simulate a make
POCC Something.c
IF ERRORLEVEL 1 GOTO FINISHED
POASM Another.asm
IF ERRORLEVEL 1 GOTO FINISHED
POLINK ...
IF ERRORLEVEL 1 GOTO ERRORLINKER
MYPROGRAM.EXE
EXIT
:ERRORLINKER
ECHHO You are bad
:FINISHED
EXIT
-
This code calls renamed pocc.exe as poccx.exe
An actual pocc.exe error code not even handled.
A poccx.exe have to have a full path to Pelles C bin folder.
Just a temporary solution to 24H2 problem
- rename original pocc.exe to poccx.exe
- copy fake pocc.exe to Pelles c bin folder
// pocc.c
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdio.h>
int __cdecl mainCRTStartup(void)
{
HANDLE hRead, hWrite;
SECURITY_ATTRIBUTES sa;
STARTUPINFO si;
PROCESS_INFORMATION pi;
DWORD nRead, nWrite, nErr;
char *lpszCmdLine, *pChar;
char szProg[1024];
char szBuff[1024];
HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
DWORD nLen = GetModuleFileName(NULL, szProg, sizeof(szProg));
nLen -= 4;
lstrcpy(szProg+nLen, "x.exe");
OutputDebugString(szProg);
lpszCmdLine = GetCommandLine();
pChar = lpszCmdLine;
if (*pChar == '"') {
pChar++;
while (*pChar && *pChar != '"')
pChar++;
pChar++;
} else {
while (*pChar && *pChar != ' ')
pChar++;
}
while (*pChar == ' ')
pChar++;
OutputDebugString(pChar);
sa.nLength = sizeof(SECURITY_ATTRIBUTES);
sa.lpSecurityDescriptor = NULL;
sa.bInheritHandle = TRUE;
if (!CreatePipe(&hRead, &hWrite, &sa, 0)) {
// ERROR
} else {
si.cb = sizeof(STARTUPINFO);
GetStartupInfo(&si);
si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
si.hStdOutput = hWrite;
si.hStdError = hWrite;
si.wShowWindow = SW_SHOW; //SW_HIDE;
si.lpReserved = NULL;
if (!CreateProcess(szProg, pChar, NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi)) {
OutputDebugString("ERROR");
} else {
CloseHandle(hWrite);
WaitForSingleObject(pi.hProcess, 30000);
GetExitCodeProcess(pi.hProcess, &nErr);
//CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
while (TRUE) {
szBuff[0] = 0;
if (!ReadFile(hRead, szBuff, sizeof(szBuff)-1, &nRead, NULL))
break;
szBuff[nRead] = 0;
WriteFile(hStdOut, szBuff, nRead, &nWrite, NULL);
}
}
CloseHandle(hRead);
}
if (nErr == 0xC0000005) nErr = 0; // exception error
ExitProcess(nErr);
}
EDIT: fake poasm.exe too
I renamed pocc.exe to poccXX.exe and added fake pocc.exe:
I get no error message and the exe file starts. But, my program does not change. I printed "kkkkk" in the program window before the change. After the change to fake pocc.exe, I changed the text to "xxxxx". When I compile I still get program window with "kkkkk".
I switched back to original pocc.exe and compiles. Now the program window opens with "xxxxx" printed.
Unfortunately, fake pocc.exe does not work correctly, but maybe it can be developed further ;)
I look forward to another test!
-
Unfortunately, fake pocc.exe does not work correctly, but maybe it can be developed further ;)
I look forward to another test!
rename orginal pocc.exe to poccx.exe
With DbgView.exe might be possible to see, if result of GetModuleFileName() and modification have a problem.
I don't use Program Files folder in testings.
Perhaps it's better, that MS develop 24H2 further ;D
This code might be a problem with paths with spaces DWORD nLen = GetModuleFileName(NULL, szProg, sizeof(szProg));
nLen -= 4;
lstrcpy(szProg+nLen, "x.exe");
OutputDebugString(szProg);
-
I have a good solution, it runs, no reason too search for other soluce
I made change using a response file for linking
Whatever you do, find or don't find the key to solve the problem, there is a question behind, if Pelle does not come back?
Will us accept to find each time a solution, nice or not?
AMD compiler is free, on Linux and many AMD libraries. There is alsoa profiler like VTune.
Is it a solutiton?
-
Unfortunately, fake pocc.exe does not work correctly, but maybe it can be developed further ;)
I look forward to another test!
rename orginal pocc.exe to poccx.exe
With DbgView.exe might be possible to see, if result of GetModuleFileName() and modification have a problem.
I don't use Program Files folder in testings.
Perhaps it's better, that MS develop 24H2 further ;D
This code might be a problem with paths with spaces DWORD nLen = GetModuleFileName(NULL, szProg, sizeof(szProg));
nLen -= 4;
lstrcpy(szProg+nLen, "x.exe");
OutputDebugString(szProg);
Have I understood correctly:
- Rename original pocc.exe to poccx.exe
- Place fake pocc.exe in the bin folder
-
NOW IT WORKS!!
;D ;D ;D
I must have done something wrong last time (maybe spaces or something).
THANKS TimoVJL !!
-
Hi Timo,
I tested your method on a simple hello world project. I received the following warning messages :
POLINK: warning: Invalid machine type in object 'crt64.lib(printf.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(fwrite.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(_files.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(_stbuf.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(_printf.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(_fwrite.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(memchr.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(_fflush.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(fileno.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(isatty.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(_mbcurmax.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(_mbrtowc.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(isdigit.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(_prtfld.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(_prttxt.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(malloc.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(fclose.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(write.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(_ioinit.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(_mbtoc32.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(_ctypetab.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(_prtstr.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(_prtint.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(_prtflt.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(constraint_handler_s.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(_getmem.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(_crt0dat.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(free.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(_crtabort.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(errno.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(_bigheap.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(_atexit.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(close.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(remove.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(_osfinfo.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(_cwrite.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(lseek64.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(_maperr.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(_ioxfer.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(_c32tomb.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(_fpunscalel.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(_values.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(_fpscalel.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(localeconv.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(_strerror.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(fputs.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(_exit.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(memcpy.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(exit.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(unlink.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(calloc.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(_fpunscale.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(_fpscale.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(fputc.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(memset.obj)'.
POLINK: warning: Invalid machine type in object 'crt64.lib(_fpnorm.obj)'.
POLINK: error: Unresolved external symbol '__mainCRTStartup' - referenced from '<common>'.
POLINK: error: Unresolved external symbol '__imp_WriteFile' - referenced from 'crt64.lib(write.obj)'.
POLINK: error: Unresolved external symbol '__imp_GetLastError' - referenced from 'crt64.lib(write.obj)'.
POLINK: error: Unresolved external symbol '__imp_WriteConsoleW' - referenced from 'crt64.lib(write.obj)'.
POLINK: error: Unresolved external symbol '__imp_WideCharToMultiByte' - referenced from 'crt64.lib(write.obj)'.
POLINK: error: Unresolved external symbol '__imp_GetStartupInfoW' - referenced from 'crt64.lib(_ioinit.obj)'.
POLINK: error: Unresolved external symbol '__imp_GetStdHandle' - referenced from 'crt64.lib(_ioinit.obj)'.
POLINK: error: Unresolved external symbol '__imp_GetFileType' - referenced from 'crt64.lib(_ioinit.obj)'.
POLINK: error: Unresolved external symbol '__imp_GetCurrentProcess' - referenced from 'crt64.lib(_ioinit.obj)'.
POLINK: error: Unresolved external symbol '__imp_DuplicateHandle' - referenced from 'crt64.lib(_ioinit.obj)'.
POLINK: error: Unresolved external symbol '__imp_IsDBCSLeadByteEx' - referenced from 'crt64.lib(_mbtoc32.obj)'.
POLINK: error: Unresolved external symbol '__imp_MultiByteToWideChar' - referenced from 'crt64.lib(_mbtoc32.obj)'.
POLINK: error: Unresolved external symbol '__imp_VirtualAlloc' - referenced from 'crt64.lib(_getmem.obj)'.
POLINK: error: Unresolved external symbol '__imp_VirtualQuery' - referenced from 'crt64.lib(_getmem.obj)'.
POLINK: error: Unresolved external symbol '__imp_IsDebuggerPresent' - referenced from 'crt64.lib(_crtabort.obj)'.
POLINK: error: Unresolved external symbol '__imp_OutputDebugStringA' - referenced from 'crt64.lib(_crtabort.obj)'.
POLINK: error: Unresolved external symbol '__imp_HeapCreate' - referenced from 'crt64.lib(_bigheap.obj)'.
POLINK: error: Unresolved external symbol '__imp_HeapDestroy' - referenced from 'crt64.lib(_bigheap.obj)'.
POLINK: error: Unresolved external symbol '__imp_HeapAlloc' - referenced from 'crt64.lib(_bigheap.obj)'.
POLINK: error: Unresolved external symbol '__imp_HeapReAlloc' - referenced from 'crt64.lib(_bigheap.obj)'.
POLINK: error: Unresolved external symbol '__imp_HeapFree' - referenced from 'crt64.lib(_bigheap.obj)'.
POLINK: error: Unresolved external symbol '__imp_HeapSize' - referenced from 'crt64.lib(_bigheap.obj)'.
POLINK: error: Unresolved external symbol '__imp_HeapValidate' - referenced from 'crt64.lib(_bigheap.obj)'.
POLINK: error: Unresolved external symbol '__imp_CloseHandle' - referenced from 'crt64.lib(close.obj)'.
POLINK: error: Unresolved external symbol '__imp_SetStdHandle' - referenced from 'crt64.lib(_osfinfo.obj)'.
POLINK: error: Unresolved external symbol '__imp_GetConsoleMode' - referenced from 'crt64.lib(_osfinfo.obj)'.
POLINK: error: Unresolved external symbol '__imp_WriteConsoleA' - referenced from 'crt64.lib(_cwrite.obj)'.
POLINK: error: Unresolved external symbol '__imp_SetFilePointerEx' - referenced from 'crt64.lib(lseek64.obj)'.
POLINK: error: Unresolved external symbol '__imp_ExitProcess' - referenced from 'crt64.lib(_exit.obj)'.
POLINK: error: Unresolved external symbol '__imp_DeleteFileA' - referenced from 'crt64.lib(unlink.obj)'.
POLINK: fatal error: 30 unresolved external(s).
*** Error code: 1 ***
Done.
32-bit Console project :
#include <stdio.h>
int main(void)
{
printf("Hello, world!\n");
return 0;
}
-
Something mixed in project.
You can see with DbgView commandline for pocc.exe.
DebugView v4.90 (https://learn.microsoft.com/en-us/sysinternals/downloads/debugview)
A fake pocc.exe pass commandline to poccx.exe as it is.
Perhaps in output folder is an older object-file from x64 project.
Zip a your project for analyzing.
-
Hi Timo,
Here is log of DbgView :
00000004 38.95228958 [9512] D:\PellesC\Bin\poccx.exe
00000005 38.95232773 [9512] -Tx86-coff -std:C17 -Ot -Ob1 -fp:precise -W1 -Gd -Ze -Zx "C:\test\test.c" -Fo"C:\test\output\test.obj"
Attached is the test project.
-
test.obj was compiled to x64 even commandline was for x86 ?
Perhaps a leftover from x64 project.
Time to give up?
-
Hi Timo & Vortex
I don't understand, for x86 or x64 the command lines are the same. :-\
Philippe
-
Hi Timo and Philippe,
The project was created starting from a newly created empty folder, so no any remnants from an old project. My result is strange, any other one who experienced the same issue?
-
Hello,
I recompiled Timo's code to produce a 32-bit executable. I received the same error messages, unresolved externals and invalid machine types. Strangely, the compiler emits 64-bit code while the project is set to 32-bit.
-
If rather exceuting a process yould simply execute with WinExec : cmd /C "C:\Program Files\PellesC\Bin\poasm.exe" -AAMD64 -Gr -Fl"Asm.lst" -Fo"Asm.obj" "Asm.asm"
I try to set my batch files in the tools menu but it is not possible
-
Hello,
I recompiled Timo's code to produce a 32-bit executable. I received the same error messages, unresolved externals and invalid machine types. Strangely, the compiler emits 64-bit code while the project is set to 32-bit.
confirm, same effect in Window 10 with ANSI or UNICODE versions.
poide Verbose build show right command line
EDIT: an error found and fixed.
Minimal test environment without headers and libs for testing before making changes to original.
Run it with RunPellesC.cmd
Test code not using includes nor libs
// test.c
//int __cdecl main(void)
void __cdecl mainCRTStartup(void)
{
//int
return;
}
; ml.exe -coff hello.asm -link -subsystem:console
.386
.model flat
option casemap:none
exit PROTO C :DWORD
printf PROTO C :PTR,:VARARG
;INCLUDELIB msvcrt
.data
msg db "Hello ASM",10,0
.code
mainCRTStartup PROC C
;invoke printf, ADDR msg
;invoke exit,0
xor eax, eax
ret
mainCRTStartup ENDP
END mainCRTStartup
-
Congratulations Timo, great job. I managed to build 32-bit and 64-bit console applications with the new version of your tool. Many thanks.
-
Thanks TimoVJL,
Can you post an example PellesC.xml file for those of us that have never used the xml feature?
John Z
-
/x Turns off the 'single instance' check. [4.00]
/xml Stores all personal settings in the specified XML-file. [5.00]
with -x -xml let running poide same time to another session and store it settings to xml-file, not in register.
This way it might be possible to run test version from USB-stick, not touching other drives nor register.
-
Ah, ok I got it - Thanks !
Thought it was part of the poccx fix.
John Z
-
Ah, ok I got it - Thanks !
Thought it was part of the poccx fix.
John Z
it is a testbed for it!
-
If I am correct, Timo's pocc is acting like a proxy, a very good idea.
-
Yes, only filters exception error 0xC0000005 off from return value from pocc.exe or poasm.exe
-
I found a solution that seems to fix this problem. By patching pocc.exe to enlarge the stack frame of one of the functions on the problematic call path by 8 bytes, then the memory addresses are aligned correctly.
You can use the pocc.exe patched by me or patch it by yourself. For version 12.0.1.0, only two bytes need to be modified.
First, at file offset 0x20ae64, change 0x20 to 0x28.
Second, at file offset 0x20ae8c, change 0x20 to 0x28.
-
8)
Now those Windows 11 24H2 users can test it.
Perhaps poasm.exe needs similar patch.
-
I have read in magazines that 25h2 is worst than 24H2 :o
-
I found a solution that seems to fix this problem. By patching pocc.exe to enlarge the stack frame of one of the functions on the problematic call path by 8 bytes, then the memory addresses are aligned correctly.
You can use the pocc.exe patched by me or patch it by yourself. For version 12.0.1.0, only two bytes need to be modified.
First, at file offset 0x20ae64, change 0x20 to 0x28.
Second, at file offset 0x20ae8c, change 0x20 to 0x28.
For the poasm.exe v12.0.1.0, at file offset 0x4d3f4 and 0x4d41c, change 0x20 to 0x28.
Or use my patched poasm.exe in attachment.
The patched pocc.exe and poasm.exe, both tested on my Windows 11 Pro 24H2.
Really hope Pelle can continue to maintain this lightweight yet powerful tool. I really don't want to install the huge bloated VS.
-
Hi Master Sunshine!
Exceptional work. I have no clue how you figured this out, but really fantastic. Can't wait to hear more results from 24H2 capable testers.
Frankie - Is it possible that this alignment issue might play a role in the occasional mystery 64 bit compiler issue we experienced?
John Z
Update - Unfortunately it does not, tested with a known offender file, same error
fatal error: Internal error: 'Access violation' at 0x00007ff6de183e99. . . . . NEW
fatal error: Internal error: 'Access violation' at 0x00007ff6de183e99. . . . . OLD
-
If this patch does not work well on your computer, please give me a minimal piece of code that can reproduce the problem, and also your OS version, I will try to analyze it again.
-
Hi Sunshine,
Oh the patch is working I'm sure and in any case I'm on WIN 23H2 which does not show the issue.
I was just trying the patch to see if it affected a 64 bit build that causes the aforementioned error.
Most 64 bit program compile nicely, but a few run into the Access violation error. In some cases rearranging the code can remove the access violation but it is hit and miss. The 32 bit build of the same code never has an issue.
John Z
-
Mr SunShine
Here Rainy day
I think it is more complicated and your analyze is too simple.
First Why when compiling for a console project no problem met?
Second Why when compiling many asm files sometimes I never have the problem and sometime I have it?
I have a project with 7 asm files and 2 c files, I always have the proablem with poasm and not pocc!
When compiling under cmd I NEVER have problem.
I don't think that pelles has a bug. I met this bug many years ago and spoke about in this forum
Thank you for your researches. When I debug into poedit that creates problems under notepad++, nor poedit, not Notepad++ have bugs for this but the environment give them wrong datas. Me I too I search but no success.
-
The problem always exist with pomake launched from poedit
if pocc or poasm where the problem it would always exist whereever it is used, une der poedit or under a dos box (cmd)
A good test would be to rename pomake and create a batch file by hand for compiling a whole project and see...
-
Have a look
******************************
*** Cleaning project files ***
******************************
************************
*** Building RELEASE ***
************************
*********************************
*** Compiling Assembler files ***
*********************************
*************************
*** Compiling C files ***
*************************
*********************************
*** Compiling Resources files ***
*********************************
*********************
*** Linking files ***
*********************
POLINK: warning: Realigned section '.idata$5' in object 'sqlite3.lib(sqlite3.dll)' (from 4 to 8 byte(s)).
POLINK: warning: Realigned section '.idata$4' in object 'sqlite3.lib(sqlite3.dll)' (from 4 to 8 byte(s)).
*********************
*** Project Built ***
*********************
Appuyez sur une touche pour continuer...
Poasm & pocc are ok
Just one compilation a file present into the previous project
> poasm.exe -AAMD64 -Zi -Gz -FlDebug.lst -Fo"C:\Users\51966\Documents\DocsPhR\# Assembleur\Awpe\Compile\F0000.obj" "C:\Users\51966\Documents\DocsPhR\# Assembleur\Awpe\F0000.asm"
warning: Ignored in 64-bit mode: 'STDCALL'.
*** Error code: -1073741819 ***
Done.
Tghe problem is before compiling
-
I can simulate a make
POCC Something.c
IF ERRORLEVEL 1 GOTO FINISHED
POASM Another.asm
IF ERRORLEVEL 1 GOTO FINISHED
POLINK ...
IF ERRORLEVEL 1 GOTO ERRORLINKER
MYPROGRAM.EXE
EXIT
:ERRORLINKER
ECHHO You are bad
:FINISHED
EXIT
this example don't even check return value -1073741819 ?
poide.exe print just every return value.
-
Yes do it and we will show, like in my batch file bellow
-
I found a solution that seems to fix this problem. By patching pocc.exe to enlarge the stack frame of one of the functions on the problematic call path by 8 bytes, then the memory addresses are aligned correctly.
You can use the pocc.exe patched by me or patch it by yourself. For version 12.0.1.0, only two bytes need to be modified.
First, at file offset 0x20ae64, change 0x20 to 0x28.
Second, at file offset 0x20ae8c, change 0x20 to 0x28.
It works but it goes slower.
-
I found a solution that seems to fix this problem. By patching pocc.exe to enlarge the stack frame of one of the functions on the problematic call path by 8 bytes, then the memory addresses are aligned correctly.
You can use the pocc.exe patched by me or patch it by yourself. For version 12.0.1.0, only two bytes need to be modified.
First, at file offset 0x20ae64, change 0x20 to 0x28.
Second, at file offset 0x20ae8c, change 0x20 to 0x28.
It works but it goes slower.
Interesting ???
In Windows 7 no difference
@ECHO OFF
SET INCLUDE=C:\code\PellesC12\include\Win;C:\code\PellesC12\include
@_RunCmdTime.exe C:\code\PellesC12\bin\pocc.exe -Gz -Ze -Zx -W0 C:\code\PellesC\TLPEView\TLPEView.c > NULL
ECHO.
ECHO Patched
@_RunCmdTime.exe pocc.exe -Gz -Ze -Zx -W0 C:\code\PellesC\TLPEView\TLPEView.c > NULL
ECHO.
@_RunCmdTime.exe C:\code\PellesC12\bin\pocc.exe -Gz -Ze -Zx -W0 C:\code\PellesC\TLPEView\TLPEView.c > NULL
ECHO.
ECHO Patched
@_RunCmdTime.exe pocc.exe -Gz -Ze -Zx -W0 C:\code\PellesC\TLPEView\TLPEView.c > NULL
ECHO.
PAUSE
BuildTime Add-In (https://forum.pellesc.de/index.php?topic=3977.msg14602#msg14602)
-
Hi Sunshine,
Oh the patch is working I'm sure and in any case I'm on WIN 23H2 which does not show the issue.
I was just trying the patch to see if it affected a 64 bit build that causes the aforementioned error.
Most 64 bit program compile nicely, but a few run into the Access violation error. In some cases rearranging the code can remove the access violation but it is hit and miss. The 32 bit build of the same code never has an issue.
John Z
Hi John,
According to my recent research, pocc has a special optimization for functions such as exit, _Exit, and abort. It uses the JMP instruction to replace the CALL instruction, but does not align the function stack frame. This problem affects the toolchain and runtime library. I patched several tools that did not work properly and patched all the places that seemed to have problems in the runtime library. Of course, only the 64-bit version needs to be patched. Especially, I patched pocc, let it emit some instructions to align the stack pointer before jump to functions like exit, _Exit and abort. So the user code can call these functions without an access violation. You may find my latest patched version on the GitHub. https://github.com/fengyoulin/pellesc (https://github.com/fengyoulin/pellesc)
After all, I don't have the source code. I can only make small patches based on these binaries. This may not completely solve the problem, or may introduce new problems. I'm doing all this just in the hope that the tool will be usable until Pelle releases his next version.
Good luck to Pelle. Good luck to us.
-
Thank You to search to solve this problem.
Take care of call, I often use jump rather than call
mov rdx,WM_CLOSE
xor r8,r8
xor r9,r9
lea rax,@Eoj + rip
push rax
jmp SendMessage
; =====================================================
-
In France we have a proverb which says that no one is held to the impossible
-
Did the February Patch Tuesday update for Windows 11 version 24H2 fix the problem? A bunch of bugs were fixed in the update.
-
You may find my latest patched version on the GitHub.
Could you post the source code and/or steps for patching the files? There is security implications with downloading executable files from a random location on GitHub and using the files. I imagine some users on here may not be comfortable with doing that.
-
Hi CandCPlusPlus
The downloads are from Pelles Site not Github. Instructions for self modification are here too.
You can use the pocc.exe patched by me or patch it by yourself. For version 12.0.1.0, only two bytes need to be modified.
First, at file offset 0x20ae64, change 0x20 to 0x28.
Second, at file offset 0x20ae8c, change 0x20 to 0x28.
Download a HEX editor - I use Hex Editor
https://mh-nexus.de/en/
then modify the two bytes. Pelles Hex Editor might work too.
Create a copy to trial first - of course.
Instructions for poasm modifications are here too, from Master Sunshine:
For the poasm.exe v12.0.1.0, at file offset 0x4d3f4 and 0x4d41c, change 0x20 to 0x28.
Both of these are on page 3-4 of this thread...
John Z
-
Hi CandCPlusPlus
The downloads are from Pelles Site not Github. Instructions for self modification are here too.
You can use the pocc.exe patched by me or patch it by yourself. For version 12.0.1.0, only two bytes need to be modified.
First, at file offset 0x20ae64, change 0x20 to 0x28.
Second, at file offset 0x20ae8c, change 0x20 to 0x28.
Download a HEX editor - I use Hex Editor
https://mh-nexus.de/en/
then modify the two bytes. Pelles Hex Editor might work too.
Create a copy to trial first - of course.
Instructions for poasm modifications are here too, from Master Sunshine:
For the poasm.exe v12.0.1.0, at file offset 0x4d3f4 and 0x4d41c, change 0x20 to 0x28.
Both of these are on page 3-4 of this thread...
John Z
Thanks. I don't know how I didn't see that before.
-
Excuse me, I don't have the source code.
You can patch it yourself.
pocc.exe:
Hex Compare
Produced: 2025/2/13 18:14:36
Mode: Differences
Left file: pocc.exe
Right file: pocc.patched.exe
000001D0 000001D0 00 00 00 00 40 00 00 40 2E 72 64 61 74 61 00 00 ....@..@.rdata..
------------------------------------------------------------------------------------
000001E0 50 4A 08 00 00 A0 25 00 00 4C 08 00 00 80 25 00 PJ... %..L...€%.
000001E0 D0 4A 08 00 00 A0 25 00 00 4C 08 00 00 80 25 00 ÐJ... %..L...€%.
------------------------------------------------------------------------------------
000001F0 000001F0 00 .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
0009C429 0009C429 BB CD 28 00 48 85 C9 74 05 E8 19 13 1B 00 89 D9 »Í(.H…Ét.è....‰Ù
------------------------------------------------------------------------------------
0009C439 E9 42 E7 16 00 48 83 C4 20 5B C3 0F 1F 00 66 0F éBç..HƒÄ [Ã...f.
0009C439 E8 42 E7 16 00 48 83 C4 20 5B C3 0F 1F 00 66 0F èBç..HƒÄ [Ã...f.
------------------------------------------------------------------------------------
0009C449 0009C449 1F .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
0020ABE2 0020ABE2 00 50 72 DA 48 83 3D 12 9D 16 00 00 75 B0 89 D9 .PrÚHƒ=.....u°‰Ù
------------------------------------------------------------------------------------
0020ABF2 E9 59 30 00 00 48 83 C4 20 5B C3 CC CC CC 53 56 éY0..HƒÄ [ÃÌÌÌSV
0020ABF2 E8 59 30 00 00 48 83 C4 20 5B C3 CC CC CC 53 56 èY0..HƒÄ [ÃÌÌÌSV
------------------------------------------------------------------------------------
0020AC02 0020AC02 57 W
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
0020C244 0020C244 C6 08 48 8D 05 03 1C 0D 00 48 39 C6 72 EE 89 D9 Æ.H......H9Ærî‰Ù
------------------------------------------------------------------------------------
0020C254 E9 27 E9 FF FF EB 16 B9 F0 FF FF FF E8 FB 19 00 é'éÿÿë.¹ðÿÿÿèû..
0020C254 E8 27 E9 FF FF EB 16 B9 F0 FF FF FF E8 FB 19 00 è'éÿÿë.¹ðÿÿÿèû..
------------------------------------------------------------------------------------
0020C264 0020C264 00 .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
0020DD75 0020DD75 0D 96 67 0B 00 FF 15 68 C6 0F 00 B9 FF 00 00 00 .–g..ÿ.hÆ..¹ÿ...
------------------------------------------------------------------------------------
0020DD85 E9 C6 FE FF FF 48 83 C4 20 5B C3 53 48 83 EC 20 éÆþÿÿHƒÄ [ÃSHƒì
0020DD85 E8 C6 FE FF FF 48 83 C4 20 5B C3 53 48 83 EC 20 èÆþÿÿHƒÄ [ÃSHƒì
------------------------------------------------------------------------------------
0020DD95 0020DD95 48 H
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
002DCA50 002DCA50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
------------------------------------------------------------------------------------
002DCA60 00 00 ..
002DCA60 73 75 62 20 72 73 70 2C 38 0A 6F 72 20 72 73 70 sub rsp,8.or rsp
002DCA70 2C 38 0A 6D 6F 76 20 65 63 78 2C 25 30 0A 6A 6D ,8.mov ecx,%0.jm
002DCA80 70 20 5F 45 78 69 74 0A 00 73 75 62 20 72 73 70 p _Exit..sub rsp
002DCA90 2C 38 0A 6F 72 20 72 73 70 2C 38 0A 6D 6F 76 20 ,8.or rsp,8.mov
002DCAA0 65 63 78 2C 25 30 0A 6A 6D 70 20 65 78 69 74 0A ecx,%0.jmp exit.
002DCAB0 00 73 75 62 20 72 73 70 2C 38 0A 6F 72 20 72 73 .sub rsp,8.or rs
002DCAC0 70 2C 38 0A 6A 6D 70 20 61 62 6F 72 74 0A 00 00 p,8.jmp abort...
------------------------------------------------------------------------------------
002DCA62 002DCAD0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ..............
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
002DCB82 002DCBF0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
------------------------------------------------------------------------------------
002DCB92 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
002DCBA2 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
002DCBB2 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
002DCBC2 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
002DCBD2 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
002DCBE2 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
002DCBF2 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40 B6 ..............@¶
002DCC00 40 B6 @¶
------------------------------------------------------------------------------------
002DCC02 002DCC02 30 40 01 00 00 00 58 B6 30 40 01 00 00 00 0@....X¶0@....
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
002EF238 002EF238 4B 2F 2B 40 01 00 00 00 4B 2F 2B 40 01 00 00 00 K/+@....K/+@....
------------------------------------------------------------------------------------
002EF248 75 EC 2A 40 01 00 00 00 60 EC 2A 40 01 00 00 00 uì*@....`ì*@....
002EF258 4A EC 2A 40 01 00 00 00 3A EC 2A 40 01 00 00 00 Jì*@....:ì*@....
002EF248 B1 EA 2D 40 01 00 00 00 89 EA 2D 40 01 00 00 00 ±ê-@....‰ê-@....
002EF258 60 EA 2D 40 01 00 00 00 3A EC 2A 40 01 00 00 00 `ê-@....:ì*@....
------------------------------------------------------------------------------------
002EF268 002EF268 3A EC 2A :ì*
------------------------------------------------------------------------------------
poasm.exe:
Hex Compare
Produced: 2025/2/13 18:24:33
Mode: Differences
Left file: poasm.exe
Right file: poasm.patched.exe
00001748 00001748 03 00 00 00 E8 FF 4E 01 00 E8 7A F6 FF FF 89 D9 ....èÿN..èzöÿÿ‰Ù
------------------------------------------------------------------------------------
00001758 E9 23 C0 04 00 48 83 C4 20 5B C3 0F 1F 40 00 66 é#À..HƒÄ [Ã..@.f
00001758 E8 23 C0 04 00 48 83 C4 20 5B C3 0F 1F 40 00 66 è#À..HƒÄ [Ã..@.f
------------------------------------------------------------------------------------
00001768 00001768 0F .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
0004D7E2 0004D7E2 00 50 72 DA 48 83 3D 32 C2 03 00 00 75 B0 89 D9 .PrÚHƒ=2Â...u°‰Ù
------------------------------------------------------------------------------------
0004D7F2 E9 89 36 00 00 48 83 C4 20 5B C3 CC CC CC 56 57 é‰6..HƒÄ [ÃÌÌÌVW
0004D7F2 E8 89 36 00 00 48 83 C4 20 5B C3 CC CC CC 56 57 è‰6..HƒÄ [ÃÌÌÌVW
------------------------------------------------------------------------------------
0004D802 0004D802 48 H
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
0004F114 0004F114 C6 08 48 8D 05 4B D0 02 00 48 39 C6 72 EE 89 D9 Æ.H..KÐ..H9Ærî‰Ù
------------------------------------------------------------------------------------
0004F124 E9 57 E6 FF FF EB 16 B9 F0 FF FF FF E8 FB 20 00 éWæÿÿë.¹ðÿÿÿèû .
0004F124 E8 57 E6 FF FF EB 16 B9 F0 FF FF FF E8 FB 20 00 èWæÿÿë.¹ðÿÿÿèû .
------------------------------------------------------------------------------------
0004F134 0004F134 00 .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
00051345 00051345 0D 26 8E 02 00 FF 15 C0 C4 02 00 B9 FF 00 00 00 .&Ž..ÿ.ÀÄ..¹ÿ...
------------------------------------------------------------------------------------
00051355 E9 26 FB FF FF 48 83 C4 20 5B C3 53 56 57 41 54 é&ûÿÿHƒÄ [ÃSVWAT
00051355 E8 26 FB FF FF 48 83 C4 20 5B C3 53 56 57 41 54 è&ûÿÿHƒÄ [ÃSVWAT
------------------------------------------------------------------------------------
00051365 00051365 48 H
------------------------------------------------------------------------------------
pocrt64.dll:
Hex Compare
Produced: 2025/2/13 18:26:09
Mode: Differences
Left file: pocrt64.dll
Right file: pocrt64.patched.dll
00000870 00000870 00 B9 06 00 00 00 E8 A5 FB 02 00 B9 01 00 00 00 .¹....è¥û..¹....
------------------------------------------------------------------------------------
00000880 E9 5B F7 01 00 48 83 C4 38 41 5C 5F 5E 5B C3 CC é[÷..HƒÄ8A\_^[ÃÌ
00000880 E8 5B F7 01 00 48 83 C4 38 41 5C 5F 5E 5B C3 CC è[÷..HƒÄ8A\_^[ÃÌ
------------------------------------------------------------------------------------
00000890 00000890 53 S
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
00001AED 00001AED 0D 1E 29 05 00 FF 15 D0 2B 06 00 B9 FF 00 00 00 ..)..ÿ.Ð+..¹ÿ...
------------------------------------------------------------------------------------
00001AFD E9 AE 07 00 00 48 83 C4 20 5B C3 CC CC CC CC CC é®...HƒÄ [ÃÌÌÌÌÌ
00001AFD E8 AE 07 00 00 48 83 C4 20 5B C3 CC CC CC CC CC è®...HƒÄ [ÃÌÌÌÌÌ
------------------------------------------------------------------------------------
00001B0D 00001B0D CC Ì
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
00010410 00010410 E8 AB 45 01 00 48 C7 C0 FF FF FF FF EB 07 31 C9 è«E..HÇÀÿÿÿÿë.1É
------------------------------------------------------------------------------------
00010420 E9 8B 1E FF FF 48 81 C4 D8 00 00 00 41 5F 41 5E é‹.ÿÿH.ÄØ...A_A^
00010420 E8 8B 1E FF FF 48 81 C4 D8 00 00 00 41 5F 41 5E è‹.ÿÿH.ÄØ...A_A^
------------------------------------------------------------------------------------
00010430 00010430 41 A
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
00019C5F 00019C5F E8 5C AD 00 00 48 C7 C0 FF FF FF FF EB 07 31 C9 è\..HÇÀÿÿÿÿë.1É
------------------------------------------------------------------------------------
00019C6F E9 3C 86 FE FF 48 81 C4 D8 00 00 00 41 5F 41 5E é<†þÿH.ÄØ...A_A^
00019C6F E8 3C 86 FE FF 48 81 C4 D8 00 00 00 41 5F 41 5E è<†þÿH.ÄØ...A_A^
------------------------------------------------------------------------------------
00019C7F 00019C7F 41 A
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
0001A4C3 0001A4C3 28 B9 06 00 00 00 E8 52 5F 01 00 B9 01 00 00 00 (¹....èR_..¹....
------------------------------------------------------------------------------------
0001A4D3 E9 08 5B 00 00 48 83 C4 28 C3 CC CC CC 53 48 83 é.[..HƒÄ(ÃÌÌÌSHƒ
0001A4D3 E8 08 5B 00 00 48 83 C4 28 C3 CC CC CC 53 48 83 è.[..HƒÄ(ÃÌÌÌSHƒ
------------------------------------------------------------------------------------
0001A4E3 0001A4E3 EC ì
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
0001A523 0001A523 C9 9C 00 00 48 8D 0D 82 81 04 00 E8 7D 04 FF FF Éœ..H..‚...è}.ÿÿ
------------------------------------------------------------------------------------
0001A533 E9 88 FF FF FF 48 83 C4 20 5B C3 CC CC 89 C8 F7 éˆÿÿÿHƒÄ [ÃÌ̉È÷
0001A533 E8 88 FF FF FF 48 83 C4 20 5B C3 CC CC 89 C8 F7 èˆÿÿÿHƒÄ [ÃÌ̉È÷
------------------------------------------------------------------------------------
0001A543 0001A543 D8 Ø
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
0002005C 0002005C 00 00 75 B0 48 89 E2 31 C9 E8 16 00 00 00 89 D9 ..u°H‰â1Éè....‰Ù
------------------------------------------------------------------------------------
0002006C E9 3F 22 FE FF 48 83 C4 20 5B C3 66 0F 1F 84 00 é?"þÿHƒÄ [Ãf..„.
0002006C E8 3F 22 FE FF 48 83 C4 20 5B C3 66 0F 1F 84 00 è?"þÿHƒÄ [Ãf..„.
------------------------------------------------------------------------------------
0002007C 0002007C 00 .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
000303DC 000303DC 00 00 75 B0 48 89 E2 31 C9 E8 16 00 00 00 89 D9 ..u°H‰â1Éè....‰Ù
------------------------------------------------------------------------------------
000303EC E9 BF 1E FD FF 48 83 C4 20 5B C3 66 0F 1F 84 00 é¿.ýÿHƒÄ [Ãf..„.
000303EC E8 BF 1E FD FF 48 83 C4 20 5B C3 66 0F 1F 84 00 è¿.ýÿHƒÄ [Ãf..„.
------------------------------------------------------------------------------------
000303FC 000303FC 00 .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
00030572 00030572 8D 0D 38 21 03 00 E8 33 A4 FD FF B9 01 00 00 00 ..8!..è3¤ýÿ¹....
------------------------------------------------------------------------------------
00030582 E9 59 FA FE FF 48 83 C4 38 5E 5B C3 CC CC 53 48 éYúþÿHƒÄ8^[ÃÌÌSH
00030582 E8 59 FA FE FF 48 83 C4 38 5E 5B C3 CC CC 53 48 èYúþÿHƒÄ8^[ÃÌÌSH
------------------------------------------------------------------------------------
00030592 00030592 83 ƒ
------------------------------------------------------------------------------------
-
crt64.lib:
Hex Compare
Produced: 2025/2/13 18:29:07
Mode: Differences
Left file: crt64.lib
Right file: crt64.patched.lib
0000D37C 0000D37C 00 B9 06 00 00 00 E8 00 00 00 00 B9 01 00 00 00 .¹....è....¹....
------------------------------------------------------------------------------------
0000D38C E9 00 00 00 00 48 83 C4 38 41 5C 5F 5E 5B C3 6E é....HƒÄ8A\_^[Ãn
0000D38C E8 00 00 00 00 48 83 C4 38 41 5C 5F 5E 5B C3 6E è....HƒÄ8A\_^[Ãn
------------------------------------------------------------------------------------
0000D39C 0000D39C 00 .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
0001112E 0001112E C6 08 48 8D 05 00 00 00 00 48 39 C6 72 EE 89 D9 Æ.H......H9Ærî‰Ù
------------------------------------------------------------------------------------
0001113E E9 00 00 00 00 EB 16 B9 F0 FF FF FF E8 00 00 00 é....ë.¹ðÿÿÿè...
0001113E E8 00 00 00 00 EB 16 B9 F0 FF FF FF E8 00 00 00 è....ë.¹ðÿÿÿè...
------------------------------------------------------------------------------------
0001114E 0001114E 00 .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
00011C5E 00011C5E 0D 00 00 00 00 FF 15 00 00 00 00 B9 FF 00 00 00 .....ÿ.....¹ÿ...
------------------------------------------------------------------------------------
00011C6E E9 00 00 00 00 48 83 C4 20 5B C3 15 00 00 00 18 é....HƒÄ [Ã.....
00011C6E E8 00 00 00 00 48 83 C4 20 5B C3 15 00 00 00 18 è....HƒÄ [Ã.....
------------------------------------------------------------------------------------
00011C7E 00011C7E 00 .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
00045F24 00045F24 C6 08 48 8D 05 00 00 00 00 48 39 C6 72 EE 89 D9 Æ.H......H9Ærî‰Ù
------------------------------------------------------------------------------------
00045F34 E9 00 00 00 00 EB 16 B9 F0 FF FF FF E8 00 00 00 é....ë.¹ðÿÿÿè...
00045F34 E8 00 00 00 00 EB 16 B9 F0 FF FF FF E8 00 00 00 è....ë.¹ðÿÿÿè...
------------------------------------------------------------------------------------
00045F44 00045F44 00 .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
0004CC58 0004CC58 C6 08 48 8D 05 00 00 00 00 48 39 C6 72 EE 89 D9 Æ.H......H9Ærî‰Ù
------------------------------------------------------------------------------------
0004CC68 E9 00 00 00 00 EB 16 B9 F0 FF FF FF E8 00 00 00 é....ë.¹ðÿÿÿè...
0004CC68 E8 00 00 00 00 EB 16 B9 F0 FF FF FF E8 00 00 00 è....ë.¹ðÿÿÿè...
------------------------------------------------------------------------------------
0004CC78 0004CC78 00 .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
0005661E 0005661E C6 08 48 8D 05 00 00 00 00 48 39 C6 72 EE 89 D9 Æ.H......H9Ærî‰Ù
------------------------------------------------------------------------------------
0005662E E9 00 00 00 00 EB 16 B9 F0 FF FF FF E8 00 00 00 é....ë.¹ðÿÿÿè...
0005662E E8 00 00 00 00 EB 16 B9 F0 FF FF FF E8 00 00 00 è....ë.¹ðÿÿÿè...
------------------------------------------------------------------------------------
0005663E 0005663E 00 .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
000570D3 000570D3 28 B9 06 00 00 00 E8 00 00 00 00 B9 01 00 00 00 (¹....è....¹....
------------------------------------------------------------------------------------
000570E3 E9 00 00 00 00 48 83 C4 28 C3 0A 00 00 00 06 00 é....HƒÄ(Ã......
000570E3 E8 00 00 00 00 48 83 C4 28 C3 0A 00 00 00 06 00 è....HƒÄ(Ã......
------------------------------------------------------------------------------------
000570F3 000570F3 00 .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
0005732F 0005732F 0A 00 00 00 48 8D 15 00 00 00 00 E8 00 00 00 00 ....H......è....
------------------------------------------------------------------------------------
0005733F E9 00 00 00 00 48 83 C4 20 5B C3 0B 00 00 00 0D é....HƒÄ [Ã.....
0005733F E8 00 00 00 00 48 83 C4 20 5B C3 0B 00 00 00 0D è....HƒÄ [Ã.....
------------------------------------------------------------------------------------
0005734F 0005734F 00 .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
0006EA76 0006EA76 00 50 72 DA 48 83 3D 00 00 00 00 00 75 B0 89 D9 .PrÚHƒ=.....u°‰Ù
------------------------------------------------------------------------------------
0006EA86 E9 00 00 00 00 48 83 C4 20 5B C3 0A 00 00 00 0D é....HƒÄ [Ã.....
0006EA86 E8 00 00 00 00 48 83 C4 20 5B C3 0A 00 00 00 0D è....HƒÄ [Ã.....
------------------------------------------------------------------------------------
0006EA96 0006EA96 00 .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
000AB056 000AB056 00 50 72 DA 48 83 3D 00 00 00 00 00 75 B0 89 D9 .PrÚHƒ=.....u°‰Ù
------------------------------------------------------------------------------------
000AB066 E9 00 00 00 00 48 83 C4 20 5B C3 0A 00 00 00 0D é....HƒÄ [Ã.....
000AB066 E8 00 00 00 00 48 83 C4 20 5B C3 0A 00 00 00 0D è....HƒÄ [Ã.....
------------------------------------------------------------------------------------
000AB076 000AB076 00 .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
000AB4B9 000AB4B9 8D 15 00 00 00 00 E8 00 00 00 00 B9 01 00 00 00 ......è....¹....
------------------------------------------------------------------------------------
000AB4C9 E9 00 00 00 00 48 83 C4 38 5E 5B C3 0E 00 00 00 é....HƒÄ8^[Ã....
000AB4C9 E8 00 00 00 00 48 83 C4 38 5E 5B C3 0E 00 00 00 è....HƒÄ8^[Ã....
------------------------------------------------------------------------------------
000AB4D9 000AB4D9 0A .
------------------------------------------------------------------------------------
crtmt64.lib:
Hex Compare
Produced: 2025/2/13 18:30:10
Mode: Differences
Left file: crtmt64.lib
Right file: crtmt64.patched.lib
0000FE9A 0000FE9A 00 B9 06 00 00 00 E8 00 00 00 00 B9 01 00 00 00 .¹....è....¹....
------------------------------------------------------------------------------------
0000FEAA E9 00 00 00 00 48 83 C4 38 41 5C 5F 5E 5B C3 6E é....HƒÄ8A\_^[Ãn
0000FEAA E8 00 00 00 00 48 83 C4 38 41 5C 5F 5E 5B C3 6E è....HƒÄ8A\_^[Ãn
------------------------------------------------------------------------------------
0000FEBA 0000FEBA 00 .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
000147AE 000147AE C6 08 48 8D 05 00 00 00 00 48 39 C6 72 EE 89 D9 Æ.H......H9Ærî‰Ù
------------------------------------------------------------------------------------
000147BE E9 00 00 00 00 EB 22 B9 F0 FF FF FF E8 00 00 00 é....ë"¹ðÿÿÿè...
000147BE E8 00 00 00 00 EB 22 B9 F0 FF FF FF E8 00 00 00 è....ë"¹ðÿÿÿè...
------------------------------------------------------------------------------------
000147CE 000147CE 00 .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
000152FA 000152FA 0D 00 00 00 00 FF 15 00 00 00 00 B9 FF 00 00 00 .....ÿ.....¹ÿ...
------------------------------------------------------------------------------------
0001530A E9 00 00 00 00 48 83 C4 20 5B C3 15 00 00 00 1A é....HƒÄ [Ã.....
0001530A E8 00 00 00 00 48 83 C4 20 5B C3 15 00 00 00 1A è....HƒÄ [Ã.....
------------------------------------------------------------------------------------
0001531A 0001531A 00 .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
0004FEB0 0004FEB0 C6 08 48 8D 05 00 00 00 00 48 39 C6 72 EE 89 D9 Æ.H......H9Ærî‰Ù
------------------------------------------------------------------------------------
0004FEC0 E9 00 00 00 00 EB 22 B9 F0 FF FF FF E8 00 00 00 é....ë"¹ðÿÿÿè...
0004FEC0 E8 00 00 00 00 EB 22 B9 F0 FF FF FF E8 00 00 00 è....ë"¹ðÿÿÿè...
------------------------------------------------------------------------------------
0004FED0 0004FED0 00 .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
00056DD8 00056DD8 C6 08 48 8D 05 00 00 00 00 48 39 C6 72 EE 89 D9 Æ.H......H9Ærî‰Ù
------------------------------------------------------------------------------------
00056DE8 E9 00 00 00 00 EB 22 B9 F0 FF FF FF E8 00 00 00 é....ë"¹ðÿÿÿè...
00056DE8 E8 00 00 00 00 EB 22 B9 F0 FF FF FF E8 00 00 00 è....ë"¹ðÿÿÿè...
------------------------------------------------------------------------------------
00056DF8 00056DF8 00 .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
000607D8 000607D8 C6 08 48 8D 05 00 00 00 00 48 39 C6 72 EE 89 D9 Æ.H......H9Ærî‰Ù
------------------------------------------------------------------------------------
000607E8 E9 00 00 00 00 EB 22 B9 F0 FF FF FF E8 00 00 00 é....ë"¹ðÿÿÿè...
000607E8 E8 00 00 00 00 EB 22 B9 F0 FF FF FF E8 00 00 00 è....ë"¹ðÿÿÿè...
------------------------------------------------------------------------------------
000607F8 000607F8 00 .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
000612C3 000612C3 28 B9 06 00 00 00 E8 00 00 00 00 B9 01 00 00 00 (¹....è....¹....
------------------------------------------------------------------------------------
000612D3 E9 00 00 00 00 48 83 C4 28 C3 0A 00 00 00 06 00 é....HƒÄ(Ã......
000612D3 E8 00 00 00 00 48 83 C4 28 C3 0A 00 00 00 06 00 è....HƒÄ(Ã......
------------------------------------------------------------------------------------
000612E3 000612E3 00 .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
00061537 00061537 00 00 00 00 48 8D 0D 00 00 00 00 E8 00 00 00 00 ....H......è....
------------------------------------------------------------------------------------
00061547 E9 00 00 00 00 48 83 C4 20 5B C3 0B 00 00 00 0A é....HƒÄ [Ã.....
00061547 E8 00 00 00 00 48 83 C4 20 5B C3 0B 00 00 00 0A è....HƒÄ [Ã.....
------------------------------------------------------------------------------------
00061557 00061557 00 .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
0007C3F0 0007C3F0 00 00 75 B0 48 89 E2 31 C9 E8 16 00 00 00 89 D9 ..u°H‰â1Éè....‰Ù
------------------------------------------------------------------------------------
0007C400 E9 00 00 00 00 48 83 C4 20 5B C3 66 0F 1F 84 00 é....HƒÄ [Ãf..„.
0007C400 E8 00 00 00 00 48 83 C4 20 5B C3 66 0F 1F 84 00 è....HƒÄ [Ãf..„.
------------------------------------------------------------------------------------
0007C410 0007C410 00 .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
000C1804 000C1804 00 00 75 B0 48 89 E2 31 C9 E8 16 00 00 00 89 D9 ..u°H‰â1Éè....‰Ù
------------------------------------------------------------------------------------
000C1814 E9 00 00 00 00 48 83 C4 20 5B C3 66 0F 1F 84 00 é....HƒÄ [Ãf..„.
000C1814 E8 00 00 00 00 48 83 C4 20 5B C3 66 0F 1F 84 00 è....HƒÄ [Ãf..„.
------------------------------------------------------------------------------------
000C1824 000C1824 00 .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
000C1E0E 000C1E0E 8D 0D 00 00 00 00 E8 00 00 00 00 B9 01 00 00 00 ......è....¹....
------------------------------------------------------------------------------------
000C1E1E E9 00 00 00 00 48 83 C4 38 5E 5B C3 0E 00 00 00 é....HƒÄ8^[Ã....
000C1E1E E8 00 00 00 00 48 83 C4 38 5E 5B C3 0E 00 00 00 è....HƒÄ8^[Ã....
------------------------------------------------------------------------------------
000C1E2E 000C1E2E 0C .
------------------------------------------------------------------------------------
pocrt64.lib:
Hex Compare
Produced: 2025/2/13 18:31:15
Mode: Differences
Left file: pocrt64.lib
Right file: pocrt64.patched.lib
0002DA9E 0002DA9E C6 08 48 8D 05 00 00 00 00 48 39 C6 72 EE 89 D9 Æ.H......H9Ærî‰Ù
------------------------------------------------------------------------------------
0002DAAE E9 00 00 00 00 EB 0A B9 F0 FF FF FF E8 00 00 00 é....ë.¹ðÿÿÿè...
0002DAAE E8 00 00 00 00 EB 0A B9 F0 FF FF FF E8 00 00 00 è....ë.¹ðÿÿÿè...
------------------------------------------------------------------------------------
0002DABE 0002DABE 00 .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
0002F0D2 0002F0D2 C6 08 48 8D 05 00 00 00 00 48 39 C6 72 EE 89 D9 Æ.H......H9Ærî‰Ù
------------------------------------------------------------------------------------
0002F0E2 E9 00 00 00 00 EB 0A B9 F0 FF FF FF E8 00 00 00 é....ë.¹ðÿÿÿè...
0002F0E2 E8 00 00 00 00 EB 0A B9 F0 FF FF FF E8 00 00 00 è....ë.¹ðÿÿÿè...
------------------------------------------------------------------------------------
0002F0F2 0002F0F2 00 .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
0002F76C 0002F76C C6 08 48 8D 05 00 00 00 00 48 39 C6 72 EE 89 D9 Æ.H......H9Ærî‰Ù
------------------------------------------------------------------------------------
0002F77C E9 00 00 00 00 EB 0A B9 F0 FF FF FF E8 00 00 00 é....ë.¹ðÿÿÿè...
0002F77C E8 00 00 00 00 EB 0A B9 F0 FF FF FF E8 00 00 00 è....ë.¹ðÿÿÿè...
------------------------------------------------------------------------------------
0002F78C 0002F78C 00 .
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
0002FE72 0002FE72 C6 08 48 8D 05 00 00 00 00 48 39 C6 72 EE 89 D9 Æ.H......H9Ærî‰Ù
------------------------------------------------------------------------------------
0002FE82 E9 00 00 00 00 EB 0A B9 F0 FF FF FF E8 00 00 00 é....ë.¹ðÿÿÿè...
0002FE82 E8 00 00 00 00 EB 0A B9 F0 FF FF FF E8 00 00 00 è....ë.¹ðÿÿÿè...
------------------------------------------------------------------------------------
0002FE92 0002FE92 00 .
------------------------------------------------------------------------------------
-
We need programs to test, where bug exists
Perhaps checking a crt64.lib for function name.
_assert.obj ?
__crt_assert:
[0000000000000148] E900000000 jmp exit
[000000000000014D] 4883C438 add rsp,38
[0000000000000151] 415C pop r12
[0000000000000153] 5F pop rdi
[0000000000000154] 5E pop rsi
[0000000000000155] 5B pop rbx
[0000000000000156] C3 ret
this crash in Windows 7#include <assert.h>
int main(void)
{
int x = 7;
assert (x==5);
return 0;
}
CRT: unhandled exception (main) -- terminating
-
Hi Master Sunshine,
You wrote -
You can patch it yourself.
I did patch pocc and poide as your instructions were concise and clear. I'm afraid these other ones (crt64,crtmt64,pocrt64) are not so clear that I can do it. Showing binary file comparisons in this manner they are hard (at least for me) to spot the differences, I have no confidence that I could successfully patch the files using those. A patch mistake would be far worse than the issue I fear.
We all appreciate your efforts to patch these to improve the outcomes. Thank you very much.
John Z
-
Hi Sunshine,
Oh the patch is working I'm sure and in any case I'm on WIN 23H2 which does not show the issue.
I was just trying the patch to see if it affected a 64 bit build that causes the aforementioned error.
Most 64 bit program compile nicely, but a few run into the Access violation error. In some cases rearranging the code can remove the access violation but it is hit and miss. The 32 bit build of the same code never has an issue.
John Z
Hi John,
According to my recent research, pocc has a special optimization for functions such as exit, _Exit, and abort. It uses the JMP instruction to replace the CALL instruction, but does not align the function stack frame. This problem affects the toolchain and runtime library. I patched several tools that did not work properly and patched all the places that seemed to have problems in the runtime library. Of course, only the 64-bit version needs to be patched. Especially, I patched pocc, let it emit some instructions to align the stack pointer before jump to functions like exit, _Exit and abort. So the user code can call these functions without an access violation. You may find my latest patched version on the GitHub. https://github.com/fengyoulin/pellesc (https://github.com/fengyoulin/pellesc)
After all, I don't have the source code. I can only make small patches based on these binaries. This may not completely solve the problem, or may introduce new problems. I'm doing all this just in the hope that the tool will be usable until Pelle releases his next version.
Good luck to Pelle. Good luck to us.
https://github.com/fengyoulin/pellesc/blob/main/patcher12/main.c (https://github.com/fengyoulin/pellesc/blob/main/patcher12/main.c)
This is the patcher for several tools and libs that are obviously problematic, you can build it use your PellesC. Some other tools also contain problematic code, but may not necessarily need to be patched. The problem is caused by the stack pointer not being aligned. In some tools, the problem code may not be executed, or two adjacent misaligned function stack frames in the call chain may cause the stack pointer to be realigned. How magical!
On my computer, I patched all the tools that contained the problematic code, I never encountered *** Error code: -1073741819 *** in the past few days.
-
Hi sunshine,
Thanks, could you provide the list of the patched Pelles tools?
-
I'm very happy that SunShine registered on the forum. Without him, no one would have realized that for 12 versions the Pelle Orinius tools were buggy. I use the assembler and debugger every day and I don't see where the problems are. I drew a circle with all the vertices of an octogon, I know I don't have very good eyesight, but what I drew is not a square or a diamond.
I don't understand what you're doing SunShine, it's good of you to want to make sure that the tools work correctly, even if there is an old fart who is complaining, you should ignore him.
-
Master Sunshine,
https://github.com/fengyoulin/pellesc/blob/main/patcher12/main.c (https://github.com/fengyoulin/pellesc/blob/main/patcher12/main.c)
This is the patcher for several tools and libs that are obviously problematic, you can build it use your PellesC. Some other tools also contain problematic code, but may not necessarily need to be patched. The problem is caused by the stack pointer not being aligned. In some tools, the problem code may not be executed, or two adjacent misaligned function stack frames in the call chain may cause the stack pointer to be realigned. How magical!
On my computer, I patched all the tools that contained the problematic code, I never encountered *** Error code: -1073741819 *** in the past few days.
Thank you very much - this is extremely helpful! Excellent help for us not so inclined to assembly and patching thusly. Once I patch all, I'll try the code I know always fails when compiling for 64bit, hopefully the patches are involved. :)
Vortex - the list from the Pelle C patch program is
"poasm.exe"
"pocc.exe"
"pocrt64.dll"
"poedit.exe"
"crt64.lib"
"crtmt64.lib"
"pocrt64.lib"
HellOfMice - Let's not forget Micro$oft also, which until WIN 24H2 was insensitive to the method and alignments used in Pelle C .....
John Z
I also want to point out that it is the Pelles Tools that have the issue, not the code the tools produce.
AFAIK nothing that was built successfully has had any issue under WIN24H2
-
https://github.com/fengyoulin/pellesc/blob/main/patcher12/main.c (https://github.com/fengyoulin/pellesc/blob/main/patcher12/main.c)
This is the patcher for several tools and libs that are obviously problematic, you can build it use your PellesC. Some other tools also contain problematic code, but may not necessarily need to be patched. The problem is caused by the stack pointer not being aligned. In some tools, the problem code may not be executed, or two adjacent misaligned function stack frames in the call chain may cause the stack pointer to be realigned. How magical!
On my computer, I patched all the tools that contained the problematic code, I never encountered *** Error code: -1073741819 *** in the past few days.
Hi Sunshine:
Thank you for this. I compiled and ran the patch and now I can compile from Pelles C IDE. Like you, I get no more *** Error code: -1073741819 ***.
Good job !
-
According to my recent research, pocc has a special optimization for functions such as exit, _Exit, and abort. It uses the JMP instruction to replace the CALL instruction, but does not align the function stack frame.
This problem affects the toolchain and runtime library.
I patched several tools that did not work properly and patched all the places that seemed to have problems in the runtime library.
Of course, only the 64-bit version needs to be patched. Especially, I patched pocc, let it emit some instructions to align the stack pointer before jump to functions like exit, _Exit and abort. So the user code can call these functions without an access violation. You may find my latest patched version on the GitHub. https://github.com/fengyoulin/pellesc (https://github.com/fengyoulin/pellesc)
After all, I don't have the source code. I can only make small patches based on these binaries. This may not completely solve the problem, or may introduce new problems. I'm doing all this just in the hope that the tool will be usable until Pelle releases his next version.
Good luck to Pelle. Good luck to us.
Hi Sunshine,
Thank you for your efforts fixing the Pelles C toolchain and libs. I overwrote my V12 files with your patched files and confirm that the
*** Error code: -1073741819 *** that I experienced in the Pelles IDE has vanished and numerous projects compiled using your patches
compile and execute normally on Windows 11 Pro 24H2. It seems like things generally compile faster now too but I might be imaging things.
I don't know that we'll ever hear from Pelle Orinius, let alone see a new version of Pelles C released - I hope I'm wrong.
But you could not have come along at a better time for those of us that enjoy using Pelles C.
Thank you very much ... I look forward to reading your posts.
-
Hi All,
Attached patch project zip, and output results for anyone interested.
This is Master Sunshine's work, I just packaged the program using Pelles ZIP. Included is a screen capture of the output results.
Still testing, although it fixes the major problem (*** Error code: -1073741819 ***) as others report, unfortunately it does not seem to eliminate the mysterious and intermittent
Fatal error: Internal error: 'Access violation' at 0x00007ff6251c3e99.
that some programs give when trying to compile as 64 bit, yet have no issue as 32 bit.
An amazing piece of work by Master Sunshine!!
John Z
-
Fatal error: Internal error: 'Access violation' at 0x00007ff6251c3e99.
are often an optimizer problem and possible to avoid by changing code,
like in miniz code ?
patch_poc64 is just sunshine's code compiled with Pelles C and using just OS msvcrt.dll and fprintf() to stderr changed to using printf()
Just for fun to avoid Pelles C crt64.lib
-
I found a solution that seems to fix this problem. By patching pocc.exe to enlarge the stack frame of one of the functions on the problematic call path by 8 bytes, then the memory addresses are aligned correctly.
You can use the pocc.exe patched by me or patch it by yourself. For version 12.0.1.0, only two bytes need to be modified.
First, at file offset 0x20ae64, change 0x20 to 0x28.
Second, at file offset 0x20ae8c, change 0x20 to 0x28.
It works but it goes slower.
Tested now again. Now go it faster than when I previously tested. Think it goes faster than original when it worked!
-
https://learn.microsoft.com/en-us/cpp/build/prolog-and-epilog?view=msvc-170 (https://learn.microsoft.com/en-us/cpp/build/prolog-and-epilog?view=msvc-170)
https://www.sqlite.org/download.html (https://www.sqlite.org/download.html) rather than pathching all is moving
-
I am not sure that SQLITE3 is updated very often, I do it but I am not sure there are many people that do it. if you patch SQLITE3 see with their site to tell us there are problems in their sotfware. AN update can just resolve any problem
For the other link I read that there was a norm in the epilog and that MS did not like those who did not like them.
My humor is what it is. If you like good if you don't like good too.
THIS AFTERNOON I TRIED TO DEBUG USING XMM AND AVX2 IT WAS NOT POSSIBLE BUT i think it less important that somerting we resolve with a batch file. There are place which are blocking and are IMPORTANT. I have pelles running from codeblock and notepad++ now. That goes to me.
While is there no stack registers for the FPU87, why XMM0 rather than tem.
Do you use emms instruction after using XMM.
I put my main code in the start function before callink winmain for hiding what i DO. The debugger does not show my code. With all the nop used in alignment are you sure that the good patches are applyed at the good place. You can have self mofied code or unpacked code...
There are a lot of thing to thing
PHILIPPE
-
hI TIMOSHINE & SUNVJL
I have nothing against anyone and surely not against SUNSHINE
i THINK THAT HIS SOLUTION HAS NOT BEEN VERY THOUGHT AND APPLYING A SYSTEMATIC SOLUTIONS CAN HIDE THE REAL ONE;
yOU SHOULD CONTACT OTHERS SOCIETES OR DEVELOPPER ON GIThUB; i HAVE ADDED 2 ISSUES FOR NOTEPAD++ RELATIVES TO THE SAME PROBLEM.
You should search for a replacement for pelles or how we will do it, other programs to develop?
-
YES
-
I am still interest of Windows 11 24H2 ntdll.dll x64 rich header
A tool for find me some details of it
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdio.h>
#pragma comment(lib, "msvcrt")
int ProcessFile(HANDLE hFile, PBYTE pMem);
int __cdecl main(int argc, char **argv)
{
HANDLE hFile, hMapping;
VOID *pMem;
if (argc < 2) {
printf("Usage: PETestRichHdr.exe <file>\n");
return 1;
}
hFile = CreateFile(argv[1], GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
if (hFile != INVALID_HANDLE_VALUE) {
hMapping = CreateFileMapping(hFile, NULL, PAGE_READWRITE, 0, 0, NULL);
if (hMapping) {
pMem = MapViewOfFile(hMapping, FILE_MAP_WRITE, 0, 0, 0);
if (pMem) {
printf("%s\n", argv[1]);
ProcessFile(hFile, pMem);
UnmapViewOfFile(pMem);
} else
printf("File open error");
CloseHandle(hMapping);
} else
printf("FileMapping error");
CloseHandle(hFile);
} else
printf("File open error");
return 0;
}
int ProcessFile(HANDLE hFile, PBYTE pMem)
{
PIMAGE_DOS_HEADER pDosHdr;
pDosHdr = (PIMAGE_DOS_HEADER)pMem;
if (pDosHdr->e_magic != IMAGE_DOS_SIGNATURE)
return 1;
DWORD *pPtr = (DWORD*)(pMem+pDosHdr->e_lfanew);
DWORD *pMin = (DWORD*)(pMem+0x40);
while (pPtr > pMin && *((DWORD*)pPtr) != *((DWORD*)"Rich"))
pPtr--;
if (*pPtr == *((DWORD*)"Rich")) {
DWORD *pPtr2 = pPtr-1;
DWORD dwMask = *(pPtr+1);
DWORD dwTmp = *((DWORD*)"DanS") ^dwMask;
while (*pPtr2 && *pPtr2 != dwTmp)
pPtr2--;
if (*pPtr2) {
DWORD *pPtr3 = pPtr2+4;
//printf("%Xh %\n", *pPtr2^dwMask, *pPtr2^dwMask); //"DanS"
while (*pPtr3 != *((DWORD*)"Rich")) {
//WORD wId, wVer;
dwTmp = *pPtr3^dwMask;
printf("%08x ", *pPtr3^dwMask);
pPtr3++;
//printf("%Xh ", *pPtr3^dwMask);
if (*pPtr3 == *((DWORD*)"Rich")) break;
//printf("%Xh %d\n", LOWORD(*pPtr3^dwMask, *(pPtr3+1)^dwMask);
printf("id:%d\tversion:%d\ttimes:%d\n", HIWORD(dwTmp), LOWORD(dwTmp), *pPtr3^dwMask);
pPtr3++;
}
}
}
return 0;
}
Hi TimoVJL:
I'm not sure if you are asking a question but anyway,
"The Windows SDK documentation describes some, but not all, of the Nt entry points in Ntdll.lib. Most of the documented Nt routines are defined in the Winternl.h header file in the Windows SDK."
quoted from
https://learn.microsoft.com/en-us/windows-hardware/drivers/kernel/libraries-and-headers (https://learn.microsoft.com/en-us/windows-hardware/drivers/kernel/libraries-and-headers)
-
Hello,
Thanks for the patches. They are working fine on Windows 11 2024 H2.
-
Hi Timo,
Here is my report on Win11 2024 H2 :
D:\>PETestRichHdr64.exe C:\Windows\system32\ntdll.dll
File open error
-
Good to know.
I have to find access to Windows 11 24H2 myself, as site users can't / don't like to help me.
It was a your choice ;)
-
Windows 11 market share in total is only about 37% and WIN 11 24H2 is only a small portion of that.
So many forum members won't be able to assist with testing. For me I blocked WIN 11 24H2 until things settle out a bit more.
So I don't think the general lack of response/help is because forum members are unwilling, but more likely are unable. I certainly don't think lack of help/testing is personal towards anyone, especially the longstanding, extremely helpful, forum members like TimoVJL, Frankie, MrBxc etc.
There is clearly some friction on the future use/path for Pelles C, some will stay some will go.
It is easy to get a bit irritated as we are still grieving over the apparent loss of Pelle, and the impact of WIN 11 24H2 issues.
Stay positive, carry on, it will be fine!
John Z
-
I have to find access to Windows 11 24H2 myself, ....
I tried this site https://www.dll-files.com/ntdll.dll.html but it looks like the newest ntdl.dll has not yet been uploaded. My Win 11 23H2 version is 2/11/2025, 10.0.022621.4830, newest one in the DLL site is 10.0.19041.423 - so not there yet.
Maybe someone can zip it and post it for you. Currently about 2Meg unzipped. I don't think that would violate anything.
Could be analyzed without installing/registering it I believe.
John Z
-
No need to send that dll.
Earlier i just asked to run program with it and see result from it's rich header.
If it have file access in system32 folder, just a temporary copy of it in other folder might help.
Idea was to see, what msvc version is currently used in Windows files.
-
It has happened -
Well now I have a desktop on WIN 24H2. I can do testing if anyone wants a test.
Laptop still Win 23H2, so no worries...
John Z