mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
[GH-ISSUE #65] Problem around SHGetFileInfoW() with FileSel in W10 when getting a shortcut icon #36
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/ultimatepp#36
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @izabala123 on GitHub (Mar 7, 2022).
Original GitHub issue: https://github.com/ultimatepp/ultimatepp/issues/65
In my computer, when opening with FileSel a folder with a shortcut, the program abruptly stops.
When debugging, it seems that in FileSel.cpp, function FileIconMaker::Make(), the program crashes when calling SHGetFileInfoW() with a shortcut.
To reproduce it, just run this:
Changing exe to true, it seems to work.
@mirek-fidler commented on GitHub (Mar 7, 2022):
Cannot reproduce, seems like Windows bug.
What x.lnk links to? File, executable or folder?
We can definitely add a text for .lnk extension and set exe true in that
case...
Mirek
po 7. 3. 2022 v 13:30 odesílatel Iñaki Zabala @.***>
napsal:
@izabala123 commented on GitHub (Mar 8, 2022):
Thank you Mirek.
"x.lnk" doesn't link to anything, it is just how Upp::FileSel looks for icons.
I have done some tests:
I'll follow later doing more tests.
@mirek-fidler commented on GitHub (Mar 8, 2022):
So it does not exist?
Mirek
út 8. 3. 2022 v 8:42 odesílatel Iñaki Zabala @.***>
napsal:
@mirek-fidler commented on GitHub (Mar 8, 2022):
Also, what about clang vs msc?
út 8. 3. 2022 v 9:46 odesílatel Mirek Fidler @.***>
napsal:
@izabala123 commented on GitHub (Mar 8, 2022):
@izabala123 commented on GitHub (Mar 8, 2022):
It's the same in both, in RELEASE both work and in DEBUG both fail.
@mirek-fidler commented on GitHub (Mar 8, 2022):
Last question: Can you send backtrace after the crash?
út 8. 3. 2022 v 11:10 odesílatel Iñaki Zabala @.***>
napsal:
@mirek-fidler commented on GitHub (Mar 8, 2022):
Another weird issue. If you check
exe should actually be true if the extension is .lnk ....
(so I am quite confused about the whole thing...)
@izabala123 commented on GitHub (Mar 8, 2022):
This is true, but as quick == true, final
invalidates previous ifs, so finally exe == false
@izabala123 commented on GitHub (Mar 8, 2022):
I am sorry, but I don't know how to do it. Could you help me?
@mirek-fidler commented on GitHub (Mar 8, 2022):
Run in debugguer until crash, then Debug/Copy backtrace of all threads, paste here.
Would
if(quick && ext != ".lnk")
fix the problem? Although it would sort of spoil background loading of images, so something more elaborate would be needed, but for starters....
(I have retested here, my Win10 is not crashing...)
@izabala123 commented on GitHub (Mar 8, 2022):
Thread ID: 0x3d94
ZwCreateFile()
CreateDirectoryW()
DllUnregisterServer()
DllUnregisterServer()
DllUnregisterServer()
DllUnregisterServer()
DllUnregisterServer()
DllUnregisterServer()
DllUnregisterServer()
DllUnregisterServer()
DllUnregisterServer()
7ffe8f4c06c2 (Powereason.dll)
7ffe8f4c6a21 (Powereason.dll)
7ffe8f4bcb28 (Powereason.dll)
TranslateSecurityAttributes()
TranslateSecurityAttributes()
NGenCreateNGenWorker()
InitializeFusion()
GC_Initialize()
GC_Initialize()
GC_Initialize()
CorExeMain2()
GetAssemblyMDImport()
DllGetClassObjectInternal()
DllGetClassObject()
DllGetClassObject()
RoActivateInstance()
RoActivateInstance()
Ordinal67()
Ordinal67()
CoRegisterClassObject()
Ordinal153()
CoDisableCallCancellation()
Ordinal167()
CoTaskMemRealloc()
CoDisableCallCancellation()
CoRegisterClassObject()
RoActivateInstance()
CoRegisterClassObject()
CoCreateInstance()
CoCreateInstance()
CoCreateInstance()
SHEvaluateSystemCommandTemplate()
Ordinal764()
Ordinal764()
FreeIconList()
FreeIconList()
SHELL32_IconCache_AboutToExtractIcons()
SHGetPropertyStoreForWindow()
SHGetPropertyStoreForWindow()
SHELL32_IconOverlayManagerInit()
CallFileCopyHook()
CallFileCopyHook()
SHGetFileInfoW()
SHGetFileInfo()
GuiMainFn_()
Upp::AppExecute__(app=7ff72d327d91)
WinMain(hInstance=7ff72d310000, __formal=0, lpCmdLine=23df7473dab "", nCmdShow=10)
invoke_main()
__scrt_common_main_seh()
__scrt_common_main()
WinMainCRTStartup()
BaseThreadInitThunk()
RtlUserThreadStart()
Thread ID: 0x4bc8
ZwWaitForWorkViaWorkerFactory()
TpReleaseCleanupGroupMembers()
BaseThreadInitThunk()
RtlUserThreadStart()
Thread ID: 0x5170
ZwWaitForWorkViaWorkerFactory()
TpReleaseCleanupGroupMembers()
BaseThreadInitThunk()
RtlUserThreadStart()
Thread ID: 0x4854
ZwWaitForWorkViaWorkerFactory()
TpReleaseCleanupGroupMembers()
BaseThreadInitThunk()
RtlUserThreadStart()
Thread ID: 0x1284
ZwWaitForMultipleObjects()
WaitForMultipleObjectsEx()
InitializeFusion()
InitializeFusion()
InitializeFusion()
BaseThreadInitThunk()
RtlUserThreadStart()
Thread ID: 0x4fcc
NtWaitForSingleObject()
WaitForSingleObjectEx()
GetMetaDataPublicInterfaceFromInternal()
GetMetaDataPublicInterfaceFromInternal()
GetMetaDataPublicInterfaceFromInternal()
TranslateSecurityAttributes()
TranslateSecurityAttributes()
BaseThreadInitThunk()
RtlUserThreadStart()
Thread ID: 0x11b4
RaiseException()
DllUnregisterServer()
DllUnregisterServer()
BaseThreadInitThunk()
RtlUserThreadStart()
@izabala123 commented on GitHub (Mar 8, 2022):
It's crazy, but it doesn't.. When calling directly FileSel, and tapping on a folder with a shortcut inside, exe == true, but it crashes...
Thread ID: 0x455c
Upp::FileIconMaker::Make()
Upp::scImageMaker::Make(object=)
Upp::LRUCacheUpp::Value,Upp::String::Get(m=)
Upp::MakeValue(m=)
Upp::MakeImage__(m=, paintonly=0)
Upp::MakeImage(m=)
Upp::GetFileIcon(path=26ccf3c1ba8 "C:\Users\0", dir=0, force=0, large=0, quick=1)
Upp::Load(list=, dir=, patterns=cfbcf16478 "*", dirs=0, WhenIcon=cfbcf16470, filesystem=, search=, hidden=0, hiddenfiles=0, lazyicons=1)
Upp::FileSel::SearchLoad()
Upp::FileSel::Load()
Upp::FileSel::GoToPlace()
<lambda_0145840f64cd27820057093f4ff59678>::operator()()
Upp::Function<void _cdecl(void)>::Wrapper<<lambda_0145840f64cd27820057093f4ff59678> >::Execute()
Upp::Function<void cdecl(void)>::operator()()
Upp::ArrayCtrl::DoClick(p=cfbcf16990, flags=8)
Upp::ArrayCtrl::LeftDown(p=cfbcf16b78, flags=8)
Upp::Ctrl::MouseEvent(event=129, p=cfbcf16cf0, zdelta=0, keyflags=8)
Upp::Ctrl::MouseEvent0(event=129, p=cfbcf16db8, zdelta=0, keyflags=8)
Upp::Ctrl::MouseEventH(event=129, p=cfbcf16ef8, zdelta=0, keyflags=8)
Upp::Ctrl::MEvent0(e=129, p=cfbcf17078, zd=0)
Upp::Ctrl::DispatchMouseEvent(e=129, p=cfbcf17210, zd=0)
Upp::Ctrl::DispatchMouseEvent(e=129, p=cfbcf173b0, zd=0)
Upp::Ctrl::DispatchMouseEvent(e=129, p=cfbcf177d0, zd=0)
Upp::Ctrl::DispatchMouse(e=129, p=cfbcf17838, zd=0)
Upp::Ctrl::DoMouse(e=129, p=cfbcf17d10, zd=0)
Upp::Ctrl::WindowProc(message=513, wParam=1, lParam=7077978)
Upp::TopWindow::WindowProc(message=513, wParam=1, lParam=7077978)
Upp::Ctrl::WndProc(hWnd=2d0e68, message=513, wParam=1, lParam=7077978)
CallWindowProcW()
DispatchMessageW()
Upp::Ctrl::sProcessMSG(msg=)
Upp::Ctrl::ProcessEvent(quit=cfbcf18550)
Upp::Ctrl::ProcessEvents(quit=cfbcf18550)
Upp::Ctrl::EventLoop(ctrl=cfbcf18700)
Upp::TopWindow::Run(appmodal=0)
Upp::TopWindow::Execute()
Upp::TopWindow::ExecuteOK()
GuiMainFn()
Upp::AppExecute(app=7ff612177d96)
WinMain(hInstance=7ff612160000, __formal=0, lpCmdLine=26ccd653dab "", nCmdShow=10)
invoke_main()
__scrt_common_main_seh()
__scrt_common_main()
WinMainCRTStartup()
BaseThreadInitThunk()
RtlUserThreadStart()
Thread ID: 0x4a68
ZwWaitForWorkViaWorkerFactory()
TpReleaseCleanupGroupMembers()
BaseThreadInitThunk()
RtlUserThreadStart()
Thread ID: 0x5814
ZwWaitForWorkViaWorkerFactory()
TpReleaseCleanupGroupMembers()
BaseThreadInitThunk()
RtlUserThreadStart()
Thread ID: 0x1cd0
ZwWaitForWorkViaWorkerFactory()
TpReleaseCleanupGroupMembers()
BaseThreadInitThunk()
RtlUserThreadStart()
Thread ID: 0x30bc
ZwWaitForWorkViaWorkerFactory()
TpReleaseCleanupGroupMembers()
BaseThreadInitThunk()
RtlUserThreadStart()
Thread ID: 0x4ef4
ZwWaitForWorkViaWorkerFactory()
TpReleaseCleanupGroupMembers()
BaseThreadInitThunk()
RtlUserThreadStart()
Thread ID: 0x460c
ZwWaitForMultipleObjects()
WaitForMultipleObjectsEx()
RoGetServerActivatableClasses()
RoGetServerActivatableClasses()
RoGetServerActivatableClasses()
RoGetServerActivatableClasses()
BaseThreadInitThunk()
RtlUserThreadStart()
Thread ID: 0x4248
ZwWaitForWorkViaWorkerFactory()
TpReleaseCleanupGroupMembers()
BaseThreadInitThunk()
RtlUserThreadStart()
Thread ID: 0x444
ZwWaitForWorkViaWorkerFactory()
TpReleaseCleanupGroupMembers()
BaseThreadInitThunk()
RtlUserThreadStart()
Thread ID: 0x278c
NtUserGetMessage()
GetMessageA()
Upp::Ctrl::Win32OverwatchThread(__formal=0)
BaseThreadInitThunk()
RtlUserThreadStart()
@mirek-fidler commented on GitHub (Mar 8, 2022):
Have you tried to open that folder from theide? Eventually built in debug mode? Or perhaps UWord?
(Just to try to rule out that this is somehow caused by some other code)
@kov-serg commented on GitHub (Mar 8, 2022):
Did you think about removing Cybereason antivirus or just turn it off for a while?
@mirek-fidler commented on GitHub (Mar 9, 2022):
As it now crashes in U++ code, maybe you should be able to tell why? Like which line this is exactly and what is in the variables on that line?
@izabala123 commented on GitHub (Mar 9, 2022):
I'm sorry, I haven't included this code yet. This is the code of the answer https://github.com/ultimatepp/ultimatepp/issues/65#issuecomment-1062136181 :
@izabala123 commented on GitHub (Mar 9, 2022):
Do you think it may be the culprit? It's true that "Powereason.dll" appears in the debug output. Unfortunately I cannot uninstall it.
@izabala123 commented on GitHub (Mar 9, 2022):
Yes, compiling TheIDE in DEBUG mode, it also crashes in the same situation.
@izabala123 commented on GitHub (Mar 17, 2022):
I have debugged TheIDE running the demo. It seems to stop in Debug.cpp, in line 367, when x.ExceptionCode == 0x406D1388, that is the code MS_VC_EXCEPTION.
I've looked for the source of this exception, and it seems it is raised when a thread wants to set its name for Visual Studio debugger. You can see references here.
As this exception seems harmless, if you agree I would propose to modify TheIDE debugger to ignore this exception.
@mirek-fidler commented on GitHub (Mar 17, 2022):
Ah, there seems to be an important issue that I have missed in your
description: This only happens in debugger?!
Mirek
čt 17. 3. 2022 v 10:09 odesílatel Iñaki Zabala @.***>
napsal:
@izabala123 commented on GitHub (Mar 17, 2022):
Yes, only in debugger. In fact, if I press F5 a couple of times, the computation follows. I noticed this later.