https://bugs.winehq.org/show_bug.cgi?id=52763
Bug ID: 52763 Summary: 3c9d2cbaea2039d8ce5d8180ed231b0be6cfa072 breaks ConEmu in win10 mode Product: Wine Version: 7.5 Hardware: x86-64 URL: https://conemu.github.io/en/Downloads.html OS: Linux Status: NEW Keywords: download, regression Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: xerox.xerox2000x@gmail.com Regression SHA1: 3c9d2cbaea2039d8ce5d8180ed231b0be6cfa072 Distribution: Debian
ConEmu in win10 is broken since aforementioned commit. The ConEmu console reports an error and than bails out.
The bug is only present when version is set to win10
Expected behaviour: Have an interactive ConEmu console Actual behaviour: Conemu console unusable
3c9d2cbaea2039d8ce5d8180ed231b0be6cfa072 is the first bad commit commit 3c9d2cbaea2039d8ce5d8180ed231b0be6cfa072 Author: Rémi Bernon rbernon@codeweavers.com Date: Thu Mar 31 12:06:41 2022 +0200
kernelbase: Allocate HLOCAL / HGLOBAL from a static handle table.
Sharing the table pointers through KernelBaseGetGlobalData to check for handle validity in kernel32, and as native does it.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
dlls/kernel32/heap.c | 20 +++++--- dlls/kernel32/tests/heap.c | 9 ---- dlls/kernelbase/memory.c | 115 ++++++++++++++++++++++++--------------------- 3 files changed, 75 insertions(+), 69 deletions(-)
https://bugs.winehq.org/show_bug.cgi?id=52763
--- Comment #1 from Louis Lenders xerox.xerox2000x@gmail.com --- Additional note: It`s also broken in win81 mode, but not win7...
https://bugs.winehq.org/show_bug.cgi?id=52763
Louis Lenders xerox.xerox2000x@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |rbernon@codeweavers.com
https://bugs.winehq.org/show_bug.cgi?id=52763
Gijs Vermeulen gijsvrm@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|3c9d2cbaea2039d8ce5d8180ed2 |ConEmu doesn't work with |31b0be6cfa072 breaks ConEmu |winver > Win8.1 | in win10 mode |
https://bugs.winehq.org/show_bug.cgi?id=52763
--- Comment #2 from Louis Lenders xerox.xerox2000x@gmail.com --- Below part of +relay,seh log. Maybe this part is releveant??
Remi, any chance this could be looked at before regression gets into new release?
0024:Call KERNEL32.lstrcmpW(0266401c L"Tahoma",02a61d80 L"Tahoma") ret=00447f80 0024:Ret KERNEL32.lstrcmpW() retval=00000000 ret=00447f80 0024:Call user32.GetKeyState(00000014) ret=004c997a 0024:Ret user32.GetKeyState() retval=00000000 ret=004c997a 0024:Call user32.GetKeyState(00000090) ret=004c9995 0024:Ret user32.GetKeyState() retval=00000000 ret=004c9995 0024:Call user32.GetKeyState(00000091) ret=004c99b0 0024:Ret user32.GetKeyState() retval=00000000 ret=004c99b0 0024:Call user32.GetKeyboardLayout(00000024) ret=00411079 0024:Ret user32.GetKeyboardLayout() retval=04090409 ret=00411079 0024:Call KERNEL32.GetLastError() ret=00515b81 0024:Ret KERNEL32.GetLastError() retval=00000005 ret=00515b81 0024:Call kernelbase.FlsGetValue(00000002) ret=00517dca 0024:Call ntdll.RtlFlsGetValue(00000002,0032dd6c) ret=7b079ea9 0024:Ret ntdll.RtlFlsGetValue() retval=00000000 ret=7b079ea9 0024:Ret kernelbase.FlsGetValue() retval=0069f5d8 ret=00517dca 0024:Call gdi32.CreateCompatibleDC(7a01009c) ret=004cabd6 0024:Call ntdll.RtlRunOnceExecuteOnce(7e427754,7e3b698b,00000000,00000000) ret=7b077808 0024:Ret ntdll.RtlRunOnceExecuteOnce() retval=00000000 ret=7b077808 0024:Ret gdi32.CreateCompatibleDC() retval=72410065 ret=004cabd6 0024:Call gdi32.CreateCompatibleBitmap(7a01009c,000002c8,00000010) ret=004cabea 0024:Ret gdi32.CreateCompatibleBitmap() retval=0b0900c3 ret=004cabea 0024:Call gdi32.SelectObject(72410065,0b0900c3) ret=004cabfd 0024:Ret gdi32.SelectObject() retval=01890034 ret=004cabfd 0024:Call gdi32.CreateSolidBrush(00423607) ret=004cace4 0024:Ret gdi32.CreateSolidBrush() retval=0b1000c2 ret=004cace4 0024:Call gdi32.CreatePen(00000000,00000001,00a1a193) ret=004cacfb 0024:Ret gdi32.CreatePen() retval=113000c1 ret=004cacfb 0024:Call gdi32.SelectObject(72410065,113000c1) ret=004cad09 0024:Ret gdi32.SelectObject() retval=01b00027 ret=004cad09 0024:Call KERNEL32.MulDiv(0000000c,ffffffa0,00000060) ret=00475ef0 0024:Ret KERNEL32.MulDiv() retval=fffffff4 ret=00475ef0 0024:Call gdi32.CreateFontIndirectW(0032e544) ret=004cad7e 0024:Ret gdi32.CreateFontIndirectW() retval=0d0a00c0 ret=004cad7e 0024:Call gdi32.SelectObject(72410065,0d0a00c0) ret=004cad8c 0024:Ret gdi32.SelectObject() retval=018a002d ret=004cad8c 0024:Call user32.FillRect(72410065,0032e5c8,0b1000c2) ret=004cadb7 0024:Ret user32.FillRect() retval=00000001 ret=004cadb7 0024:Call gdi32.MoveToEx(72410065,00000000,00000000,00000000) ret=004cade8 0024:Ret gdi32.MoveToEx() retval=00000001 ret=004cade8 0024:Call gdi32.LineTo(72410065,000002c9,00000000) ret=004cadf3 0024:Ret gdi32.LineTo() retval=00000001 ret=004cadf3 0024:Call KERNEL32.GetTickCount() ret=004e8a9a 0024:Ret KERNEL32.GetTickCount() retval=00e87874 ret=004e8a9a 0024:Call KERNEL32.GetTickCount() ret=004e8a9a 0024:Ret KERNEL32.GetTickCount() retval=00e87874 ret=004e8a9a 0024:Call KERNEL32.GetTickCount() ret=004f944b 0024:Ret KERNEL32.GetTickCount() retval=00e87874 ret=004f944b 0024:Call KERNEL32.GetTickCount() ret=004f944b 0024:Ret KERNEL32.GetTickCount() retval=00e87874 ret=004f944b 0024:Call KERNEL32.GetTickCount() ret=004f944b 0024:Ret KERNEL32.GetTickCount() retval=00e87874 ret=004f944b 0024:Call KERNEL32.GetTickCount() ret=004f944b 0024:Ret KERNEL32.GetTickCount() retval=00e87874 ret=004f944b 0024:Call KERNEL32.GetTickCount() ret=004f944b 0024:Ret KERNEL32.GetTickCount() retval=00e87874 ret=004f944b 0024:Call KERNEL32.GetTickCount() ret=004f944b 0024:Ret KERNEL32.GetTickCount() retval=00e87874 ret=004f944b 0024:Call KERNEL32.GetTickCount() ret=004f944b 0024:Ret KERNEL32.GetTickCount() retval=00e87874 ret=004f944b 0024:Call KERNEL32.GetTickCount() ret=004f944b 0024:Ret KERNEL32.GetTickCount() retval=00e87874 ret=004f944b 0024:Call KERNEL32.GetTickCount() ret=004f944b 0024:Ret KERNEL32.GetTickCount() retval=00e87874 ret=004f944b 0024:Call KERNEL32.GetTickCount() ret=004f944b 0024:Ret KERNEL32.GetTickCount() retval=00e87874 ret=004f944b 0024:Call KERNEL32.GetTickCount() ret=004f944b 0024:Ret KERNEL32.GetTickCount() retval=00e87874 ret=004f944b 0024:Call KERNEL32.GetTickCount() ret=004f944b 0024:Ret KERNEL32.GetTickCount() retval=00e87874 ret=004f944b 0024:Call KERNEL32.GetTickCount() ret=004f944b 0024:Ret KERNEL32.GetTickCount() retval=00e87874 ret=004f944b 0024:Call KERNEL32.GetTickCount() ret=004f944b 0024:Ret KERNEL32.GetTickCount() retval=00e87874 ret=004f944b 0024:Call KERNEL32.GetTickCount() ret=004f944b 0024:Ret KERNEL32.GetTickCount() retval=00e87874 ret=004f944b 0024:Call KERNEL32.GetTickCount() ret=004f944b 0024:Ret KERNEL32.GetTickCount() retval=00e87874 ret=004f944b 0024:Call KERNEL32.GetTickCount() ret=004f944b 0024:Ret KERNEL32.GetTickCount() retval=00e87874 ret=004f944b 0024:Call KERNEL32.GetTickCount() ret=004f944b 0024:Ret KERNEL32.GetTickCount() retval=00e87874 ret=004f944b 0024:Call KERNEL32.GetTickCount() ret=004f944b 0024:Ret KERNEL32.GetTickCount() retval=00e87874 ret=004f944b 0024:Call KERNEL32.GetTickCount() ret=004f944b 0024:Ret KERNEL32.GetTickCount() retval=00e87874 ret=004f944b 0024:Call KERNEL32.GetTickCount() ret=004f944b 0024:Ret KERNEL32.GetTickCount() retval=00e87874 ret=004f944b 0024:Call KERNEL32.GetTickCount() ret=004f944b 0024:Ret KERNEL32.GetTickCount() retval=00e87874 ret=004f944b 0024:Call KERNEL32.GetTickCount() ret=004f944b 0024:Ret KERNEL32.GetTickCount() retval=00e87874 ret=004f944b 0024:Call KERNEL32.GetTickCount() ret=004f944b 0024:Ret KERNEL32.GetTickCount() retval=00e87874 ret=004f944b 0024:Call KERNEL32.GetTickCount() ret=004f944b 0024:Ret KERNEL32.GetTickCount() retval=00e87874 ret=004f944b 0024:Call KERNEL32.GetTickCount() ret=004f944b 0024:Ret KERNEL32.GetTickCount() retval=00e87874 ret=004f944b 0024:Call KERNEL32.GetTickCount() ret=004f944b 0024:Ret KERNEL32.GetTickCount() retval=00e87874 ret=004f944b 0024:Call KERNEL32.GetTickCount() ret=004f944b 0024:Ret KERNEL32.GetTickCount() retval=00e87874 ret=004f944b 0024:Call KERNEL32.GetTickCount() ret=004f944b 0024:Ret KERNEL32.GetTickCount() retval=00e87874 ret=004f944b 0024:Call KERNEL32.GetTickCount() ret=004f944b 0024:Ret KERNEL32.GetTickCount() retval=00e87874 ret=004f944b 0024:Call KERNEL32.lstrlenW(02689320 L" \00ab 220308[32]") ret=004caea7 0024:Call ntdll.wcslen(02689320 L" \00ab 220308[32]") ret=7b06dcef 0024:Ret ntdll.wcslen() retval=0000000d ret=7b06dcef 0024:Ret KERNEL32.lstrlenW() retval=0000000d ret=004caea7 0024:Call gdi32.GetTextExtentPoint32W(72410065,02689320 L" \00ab 220308[32]",0000000d,0032e4dc) ret=004caeb6 0024:Ret gdi32.GetTextExtentPoint32W() retval=00000001 ret=004caeb6 0024:Call KERNEL32.lstrlenW(0267a9b8 L" ") ret=004cb4db 0024:Call ntdll.wcslen(0267a9b8 L" ") ret=7b06dcef 0024:Ret ntdll.wcslen() retval=00000001 ret=7b06dcef 0024:Ret KERNEL32.lstrlenW() retval=00000001 ret=004cb4db 0024:Call KERNEL32.lstrlenW(00000000) ret=004cb509 0024:Call ntdll.wcslen(00000000) ret=7b06dcef 0024:trace:seh:dispatch_exception code=c0000005 flags=0 addr=7BC62EE6 ip=7bc62ee6 tid=0024 0024:trace:seh:dispatch_exception info[0]=00000000 0024:trace:seh:dispatch_exception info[1]=00000000 0024:warn:seh:dispatch_exception EXCEPTION_ACCESS_VIOLATION exception (code=c0000005) raise
https://bugs.winehq.org/show_bug.cgi?id=52763
--- Comment #3 from Louis Lenders xerox.xerox2000x@gmail.com --- diff --git a/dlls/kernelbase/memory.c b/dlls/kernelbase/memory.c index 21e7c5ef9d9..f974a4085ca 100644 --- a/dlls/kernelbase/memory.c +++ b/dlls/kernelbase/memory.c @@ -607,7 +607,7 @@ struct mem_entry
C_ASSERT(sizeof(struct mem_entry) == 2 * sizeof(void *));
-#define MAX_MEM_HANDLES 0x10000 +#define MAX_MEM_HANDLES 0x8000 static struct mem_entry mem_entries[MAX_MEM_HANDLES]; static struct mem_entry *next_free_mem = mem_entries;
By applying patch that caused regression step by step, i found decreasing MAX_MEM_HANDLES like something above fixes the bug for me.
Remi, could you shed a light on this bug? Thanks
https://bugs.winehq.org/show_bug.cgi?id=52763
--- Comment #4 from Rémi Bernon rbernon@codeweavers.com --- I would expect the regression to be coming from the limitation of the number of handles, when they were previously dynamically allocated and virtually unlimited, and I'm quite surprised that reducing the number of handles fixes anything.
Native uses 64k handles, though there's maybe a way to increase that I haven't found it.
https://bugs.winehq.org/show_bug.cgi?id=52763
--- Comment #5 from Rémi Bernon rbernon@codeweavers.com --- FWIW I'm not able to reproduce the issue with 6d4ec1255acceec7152ed98764ee29991ac04f10 (Wine 7.6+). I've downloaded portable ConEmu from https://www.fosshub.com/ConEmu.html, tried an existing and a fresh prefix, setting Windows version to Win 10 and ran either ConEmu64.exe or ConEmu.exe without any obvious issue.
https://bugs.winehq.org/show_bug.cgi?id=52763
--- Comment #6 from Louis Lenders xerox.xerox2000x@gmail.com --- (In reply to Rémi Bernon from comment #5)
FWIW I'm not able to reproduce the issue with 6d4ec1255acceec7152ed98764ee29991ac04f10 (Wine 7.6+). I've downloaded portable ConEmu from https://www.fosshub.com/ConEmu.html, tried an existing and a fresh prefix, setting Windows version to Win 10 and ran either ConEmu64.exe or ConEmu.exe without any obvious issue.
Hmm, that`s weird then. It doesn`t work here. It appears the problem for me is happening in ConEmuC.exe (that is called by ConEmu.exe i guess). The following does not work for me:
wine ConEmuC.exe /c echo hello
No output, just 013c:err:seh:NtRaiseException Unhandled exception code c0000005
Tested in current git and Staging-7.6 (wine version set to win10).
Maybe someone else could give it a try, to see if it`s a problem on my side?
https://bugs.winehq.org/show_bug.cgi?id=52763
--- Comment #7 from Rémi Bernon rbernon@codeweavers.com --- That works fine for me as well.
Could you make a log with +globalmem? With and without the MAX_MEM_HANDLES change that fixes the issue for you would be nice.
https://bugs.winehq.org/show_bug.cgi?id=52763
--- Comment #8 from Louis Lenders xerox.xerox2000x@gmail.com --- Created attachment 72241 --> https://bugs.winehq.org/attachment.cgi?id=72241 +globalmem logs
Hi, see attachment.
The command ran: 'wine ConEmuC.exe /c echo hahaha'
One with plain wine (failingcall.txt) and one with MAX_MEM_HANDLES set to 0x8000 (succeedingcall.txt). Regards
https://bugs.winehq.org/show_bug.cgi?id=52763
--- Comment #9 from Rémi Bernon rbernon@codeweavers.com --- Created attachment 72242 --> https://bugs.winehq.org/attachment.cgi?id=72242 Allocate kernelbase handle table dynamically.
Does this patch fix anything?
It's a bit weird, and I'm now suspecting that having the handle table statically defined makes kernelbase.dll takes much more space to load, and could be forcing some other DLL to be moved to another unexpected load address.
https://bugs.winehq.org/show_bug.cgi?id=52763
--- Comment #10 from Louis Lenders xerox.xerox2000x@gmail.com --- (In reply to Rémi Bernon from comment #9)
Created attachment 72242 [details] Allocate kernelbase handle table dynamically.
Does this patch fix anything?
It's a bit weird, and I'm now suspecting that having the handle table statically defined makes kernelbase.dll takes much more space to load, and could be forcing some other DLL to be moved to another unexpected load address.
Yes that fixes the bug! Thanks! Both ConEmuC and Conemu work again as expected (windows version set to win10)
I wonder then why the bug was only present then on win81 and win10, and not win7. Any idea?
https://bugs.winehq.org/show_bug.cgi?id=52763
--- Comment #11 from Rémi Bernon rbernon@codeweavers.com --- Nice, I sent it upstream. I have no idea why it's version specific, no. It looks like the crash is coming from some prompt formatting, perhaps ConEmu is going through another codepath depending on the version (I saw that it displays the version in the prompt), that by chance doesn't trigger the issue.
https://bugs.winehq.org/show_bug.cgi?id=52763
Louis Lenders xerox.xerox2000x@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED Fixed by SHA1| |c0584779f89e2f6372039a2e6db | |2d59b8025f5e7
--- Comment #12 from Louis Lenders xerox.xerox2000x@gmail.com --- Hi ,this is fixed by c0584779f89e2f6372039a2e6db2d59b8025f5e7
Thanks Remi!
https://bugs.winehq.org/show_bug.cgi?id=52763
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #13 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 7.7.