winsiderss / systeminformer

A free, powerful, multi-purpose tool that helps you monitor system resources, debug software and detect malware. Brought to you by Winsider Seminars & Solutions, Inc. @ http://www.windows-internals.com
https://systeminformer.sourceforge.io
MIT License
10.99k stars 1.4k forks source link

Systeminformer crashes when attempting to open file location of WSL process. #2262

Open kotenok2000 opened 5 hours ago

kotenok2000 commented 5 hours ago

Brief description of your issue

When i right click boinc and press "Open frile location" it crashes.

Steps to reproduce (optional)

Run ununtu on WSL1 Attempt to open bash executable location

Expected behavior (optional)

Open E:\wsl\ubuntu\rootfs\home\user\BOINC\

Actual behavior (optional)

image

Environment (optional)

3.1.24305.0
10.0.22631.4317
kotenok2000 commented 5 hours ago

SystemInformer_DumpFile_JHUPZSVDCHMQMQA.zip

ge0rdi commented 4 hours ago

It crashes because processItem->FileNameWin32 is null (for some reason) and there is no check for that (FileName is checked instead): https://github.com/winsiderss/systeminformer/blob/561370ad9dafe5b5fe74fc8171e950615db0e25c/SystemInformer/mainwnd.c#L1888-L1894

The fix of the crash would be trivial (just add proper check), but there is some deeper issue as SI was unable to obtain Win32 file name for the process image.

kotenok2000 commented 4 hours ago

It worked in the past.

kotenok2000 commented 4 hours ago

Image file name is visible in properties image

ge0rdi commented 3 hours ago

It seems that General tab of process properties resolves Win32 file name on its own and doesn't use the one from processItem.

But processItem->FileNameWin32 seems to be populated when processes are enumerated: https://github.com/winsiderss/systeminformer/blob/561370ad9dafe5b5fe74fc8171e950615db0e25c/SystemInformer/procprv.c#L1202-L1205

So it is weird why it was uninitialized in your case ...

ge0rdi commented 3 hours ago

If you enable File name column (in main window), will it show proper name in case of those WSL processes?

kotenok2000 commented 3 hours ago

No.

ge0rdi commented 3 hours ago

So it would seem that PhGetProcessImageFileNameWin32 has some problem with resolving the file name.

General tab uses PhGetFileName as fallback (when PhGetProcessImageFileNameWin32 failed) and it seems to work in this case. Maybe we should do the same in PhpFillProcessItem when populating ProcessItem->FileNameWin32. @dmex @jxy-s