tannerhelland / PhotoDemon

A free portable photo editor focused on pro-grade features, high performance, and maximum usability.
https://photodemon.org
Other
1.3k stars 192 forks source link

[bug] PhotoDemon 9.2 pre-alpha: search makes PD crash silently #509

Closed hi5 closed 4 months ago

hi5 commented 6 months ago

Version information

PhotoDemon 9.2 pre-alpha build 230

Describe the bug

To be honest I hardly ever used the search, but when I do so now I can make PD consistently crash silently. By only after adding a layer it seems or in a multilayer image.

How can I reproduce the bug?

  1. Start PD
  2. Create a new image (just empty, dimensions don't matter)
  3. add a new layer (can also remain empty)
  4. start searching, I typed 'drop' - realise I want to search form something else, backspaced it, started typing something else, backspace that and then the search 'hangs' and PD crashes. I doesn't matter what you type, it is nearly always after backspacing the second search that it crashes, not the first one. You can type nonsense too (first 'ababababab backspace it, ejejejejej backspace it -> PD exits)

Expected behavior

No crash :)

Debug logs

I don't see any errors in the log Debug.zip

hi5 commented 6 months ago

To add: this only happens on Windows 10, on W11 no issues.

tannerhelland commented 6 months ago

Thank you for filing this bug report, @hi5 . I apologize for another crash, this time in the search bar!

Over the past few days, I have attempted to replicate this crash on Win 11, two different Win 10 installs, and even a Windows XP VM. (I am setting up a Win 7 VM to test there later today.) I have yet to find a way to reproduce the crash, argh!

I wonder if this means it is not necessarily Windows 10 that is the cause, but something else about the PhotoDemon install on that particular PC.

I am going to apply some (blind) possible fixes to the next nightly build, but in the meantime, can I ask for a possible favor at your convenience?

Please zip up the /Data/PhotoDemon_settings.xml file and attach it here, AFTER - and this is important - taking a quick look inside the file (via Notepad or any other text editor) to make sure there is no identifying information. That is the master PhotoDemon settings file and it will contain values like your last-used folders, so if there is any information you don't want shared, you can of course decline to attach the file here. (Or, if it's not too much work, just erase any folder paths that might be revealing.)

I am interested in reviewing that master settings file to see if there is perhaps some setting I need to reproduce here to make the crash happen. (I have tried gleaning what I can from the debug log you attached, but alas I haven't found a "smoking gun" in there.)

Thank you in advance 🙏

hi5 commented 6 months ago

First of all I think this is very hard bug to trigger and indeed one that might actually be just for me, so I wouldn't delay releasing a new update because surely if it happens often you would have heard about earlier.

When I reported it and tried it again the next day, I could make it happen almost immediately, now it is a bit harder to make it crash they way I described, but I can still manage it. I still haven't found a pattern on how to make it crash for sure, sometimes I can type/backspace for minutes and nothing happens, next time I try PD goes down.

Here are the settings and an animated gif recording of what happens PhotoDemon_settings.zip

I type/backspace a number of times, this all works - on a single layer image. I then add a second layer, type something, backspace, the circle mouse icon appears, then a black window (which is my editor) appears indicating PD has crashed. Not sure if it is actually the second layer that is neede, but I don't recall I can make it crash with just one layer.

This is what is visible in the event viewer "Errors"

Faulting application name: PhotoDemon.exe, version: 9.1.0.230, time stamp: 0x657ccc1d
Faulting module name: KERNELBASE.dll, version: 10.0.19041.3803, time stamp: 0x4f196cbf
Exception code: 0xc000041d
Fault offset: 0x0013f932
Faulting process id: 0x4c
Faulting application start time: 0x01da344c0ee23e84
Faulting application path: c:\Portable\Photodemon\PhotoDemon.exe
Faulting module path: C:\Windows\System32\KERNELBASE.dll
Report Id: ad33e5c5-6368-4fd1-bd18-8bb218ad5939
Faulting package full name: 
Faulting package-relative application ID: 

Faulting application name: PhotoDemon.exe, version: 9.1.0.230, time stamp: 0x657ccc1d
Faulting module name: KERNELBASE.dll, version: 10.0.19041.3803, time stamp: 0x4f196cbf
Exception code: 0xc000008f
Fault offset: 0x0013f932
Faulting process id: 0x4c
Faulting application start time: 0x01da344c0ee23e84
Faulting application path: c:\Portable\Photodemon\PhotoDemon.exe
Faulting module path: C:\Windows\System32\KERNELBASE.dll
Report Id: c4680928-f589-4406-acd0-01cf312360f2
Faulting package full name: 
Faulting package-relative application ID: 

I then remembered I read something about creating "crash dumps" on another forum - see below, I installed procdump and I now have indeed 1 GB worth of DMP files (I tried to analyse it as described below using Windbg but I didn't get very far). If you want to see these DMP files let me know so I can send you an email link to download them.

You could also create a crash dump with procdump, 
this allows to see in the stack trace which module is crashing:
https://technet.microsoft.com/en-us/sysinternals/dd996900.aspx

1. Create new directory c:\dumps
2. Create a lnk file of procdump.exe or procdump64.exe (for 64-bit Windows) e.g. procdump.lnk
3. Open the properties the lnk file 
4. Change the command from c:\path\procdump.exe to
c:\path\procdump.exe -ma -i c:\dumps
5. Important: Click on "Advanced" and check option "As administrator"
6. Run procdump with this link file
7. Wait until the crash occurs.

To analyze the dump yourself , please get windbg from here:
https://developer.microsoft.com/en-us/windows/hardware/download-windbg

Usage:
1. Create new directory c:\Symbols
2. Run Windbg
3. File - Symbol search path, add the following:
srv*C:\SYMBOLS*http://msdl.microsoft.com/download/symbols
4. File - Open crash dump - choose the dmp file
5. Enter the following in the command line (including the ! at the start):
!analyze -v
(including the exclamation mark!) and press ENTER.
6. Wait
7. When the result is there, select all, press Ctrl+C and paste the result to the email body.
hi5 commented 6 months ago

😕 I now managed to make it crash on Win11 too (first time, after many many attempts) - details below.

Event viewer error:

Faulting application name: PhotoDemon.exe, version: 9.1.0.230, time stamp: 0x657ccc1d
Faulting module name: KERNELBASE.dll, version: 10.0.22621.2861, time stamp: 0x9e57f18c
Exception code: 0xc000041d
Fault offset: 0x00149392
Faulting process id: 0x0x88C
Faulting application start time: 0x0x1DA34F08222CFB1
Faulting application path: c:\Portable\PhotoDemonNightly\PhotoDemon.exe
Faulting module path: C:\Windows\System32\KERNELBASE.dll
Report Id: ad42576b-5442-4a18-b431-40fb3141e00b
Faulting package full name: 
Faulting package-relative application ID: 

WER report

Version=1
EventType=APPCRASH
EventTime=133477346830987281
ReportType=2
Consent=1
UploadTime=133477346833905142
ReportStatus=268435456
ReportIdentifier=a8c7a4ad-c3dd-4912-9c08-7380b698ace5
IntegratorReportIdentifier=ad42576b-5442-4a18-b431-40fb3141e00b
Wow64Host=34404
Wow64Guest=332
NsAppName=PhotoDemon.exe
OriginalFilename=PhotoDemon.exe
AppSessionGuid=0000088c-0001-0077-b1cf-2282f034da01
TargetAppId=W:0006ebddca0fdbe81639c796a431d9f38ea300000904!00001747c0c96cdbbca125a4c8edce618a13c8b4ae99!PhotoDemon.exe
TargetAppVer=2023//12//15:21:58:53!840b83!PhotoDemon.exe
BootId=4294967295
TargetAsId=3776
IsFatal=1
EtwNonCollectReason=1
Response.BucketId=41d48ac44d628fcb0069e727a89f1263
Response.BucketTable=1
Response.LegacyBucketId=1182730534680203875
Response.type=4
Sig[0].Name=Application Name
Sig[0].Value=PhotoDemon.exe
Sig[1].Name=Application Version
Sig[1].Value=9.1.0.230
Sig[2].Name=Application Timestamp
Sig[2].Value=657ccc1d
Sig[3].Name=Fault Module Name
Sig[3].Value=KERNELBASE.dll
Sig[4].Name=Fault Module Version
Sig[4].Value=10.0.22621.2861
Sig[5].Name=Fault Module Timestamp
Sig[5].Value=9e57f18c
Sig[6].Name=Exception Code
Sig[6].Value=c000041d
Sig[7].Name=Exception Offset
Sig[7].Value=00149392
DynamicSig[1].Name=OS Version
DynamicSig[1].Value=10.0.22621.2.0.0.256.4
DynamicSig[2].Name=Locale ID
DynamicSig[2].Value=1033
DynamicSig[22].Name=Additional Information 1
DynamicSig[22].Value=13c3
DynamicSig[23].Name=Additional Information 2
DynamicSig[23].Value=13c3b22cf6d8ca8c01ef11e4e6aef978
DynamicSig[24].Name=Additional Information 3
DynamicSig[24].Value=60a3
DynamicSig[25].Name=Additional Information 4
DynamicSig[25].Value=60a3411e28342b41eefb0093d5be82a7
UI[2]=c:\Portable\PhotoDemonNightly\PhotoDemon.exe
LoadedModule[0]=c:\Portable\PhotoDemonNightly\PhotoDemon.exe
LoadedModule[1]=C:\Windows\SYSTEM32\ntdll.dll
LoadedModule[2]=C:\Windows\System32\KERNEL32.DLL
LoadedModule[3]=C:\Windows\System32\KERNELBASE.dll
LoadedModule[4]=C:\Windows\SYSTEM32\MSVBVM60.DLL
LoadedModule[5]=C:\Windows\System32\USER32.dll
LoadedModule[6]=C:\Windows\System32\win32u.dll
LoadedModule[7]=C:\Windows\System32\GDI32.dll
LoadedModule[8]=C:\Windows\System32\gdi32full.dll
LoadedModule[9]=C:\Windows\System32\msvcp_win.dll
LoadedModule[10]=C:\Windows\System32\ucrtbase.dll
LoadedModule[11]=C:\Windows\System32\ADVAPI32.dll
LoadedModule[12]=C:\Windows\System32\msvcrt.dll
LoadedModule[13]=C:\Windows\System32\sechost.dll
LoadedModule[14]=C:\Windows\System32\RPCRT4.dll
LoadedModule[15]=C:\Windows\System32\ole32.dll
LoadedModule[16]=C:\Windows\System32\combase.dll
LoadedModule[17]=C:\Windows\System32\OLEAUT32.dll
LoadedModule[18]=C:\Windows\System32\IMM32.DLL
LoadedModule[19]=C:\Windows\SYSTEM32\kernel.appcore.dll
LoadedModule[20]=C:\Windows\System32\bcryptPrimitives.dll
LoadedModule[21]=C:\Windows\system32\uxtheme.dll
LoadedModule[22]=C:\Windows\SYSTEM32\SXS.DLL
LoadedModule[23]=C:\Windows\System32\MSCTF.dll
LoadedModule[24]=C:\Windows\System32\clbcatq.dll
LoadedModule[25]=C:\Windows\System32\shell32.dll
LoadedModule[26]=C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.22621.2506_none_6eb991c088050a06\comctl32.DLL
LoadedModule[27]=C:\Windows\system32\dataexchange.dll
LoadedModule[28]=C:\Windows\system32\twinapi.appcore.dll
LoadedModule[29]=C:\Windows\WinSxS\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.22621.2506_none_9fa484a5e29783d4\gdiplus.DLL
LoadedModule[30]=C:\Windows\SYSTEM32\TextShaping.dll
LoadedModule[31]=C:\Windows\system32\explorerframe.dll
LoadedModule[32]=C:\Windows\System32\SHCORE.dll
LoadedModule[33]=C:\Windows\System32\SHLWAPI.dll
LoadedModule[34]=C:\Windows\SYSTEM32\shfolder.DLL
LoadedModule[35]=C:\Windows\SYSTEM32\windows.storage.dll
LoadedModule[36]=C:\Windows\SYSTEM32\wintypes.dll
LoadedModule[37]=c:\Portable\PhotoDemonNightly\App\PhotoDemon\Plugins\libdeflate.dll
LoadedModule[38]=c:\Portable\PhotoDemonNightly\App\PhotoDemon\Plugins\libzstd.dll
LoadedModule[39]=c:\Portable\PhotoDemonNightly\App\PhotoDemon\Plugins\liblz4.dll
LoadedModule[40]=c:\Portable\PhotoDemonNightly\App\PhotoDemon\Plugins\lcms2.dll
LoadedModule[41]=C:\Windows\SYSTEM32\CRYPTSP.dll
LoadedModule[42]=C:\Windows\system32\rsaenh.dll
LoadedModule[43]=C:\Windows\SYSTEM32\CRYPTBASE.dll
LoadedModule[44]=C:\Windows\SYSTEM32\bcrypt.dll
LoadedModule[45]=C:\Windows\SYSTEM32\VERSION.DLL
LoadedModule[46]=C:\Windows\System32\Normaliz.DLL
LoadedModule[47]=C:\Windows\System32\setupapi.DLL
LoadedModule[48]=C:\Windows\SYSTEM32\DEVOBJ.dll
LoadedModule[49]=C:\Windows\SYSTEM32\cfgmgr32.dll
LoadedModule[50]=C:\Windows\System32\WINTRUST.dll
LoadedModule[51]=C:\Windows\System32\CRYPT32.dll
LoadedModule[52]=C:\Windows\SYSTEM32\MSASN1.dll
LoadedModule[53]=C:\Windows\SYSTEM32\olepro32.DLL
LoadedModule[54]=C:\Windows\SYSTEM32\textinputframework.dll
LoadedModule[55]=C:\Windows\SYSTEM32\CoreMessaging.dll
LoadedModule[56]=C:\Windows\SYSTEM32\CoreUIComponents.dll
LoadedModule[57]=C:\Windows\System32\psapi.DLL
LoadedModule[58]=c:\Portable\PhotoDemonNightly\App\PhotoDemon\Plugins\charls-2-x86.dll
LoadedModule[59]=c:\Portable\PhotoDemonNightly\App\PhotoDemon\Plugins\eztw32.dll
LoadedModule[60]=C:\Windows\System32\comdlg32.dll
LoadedModule[61]=C:\Windows\SYSTEM32\MSVFW32.dll
LoadedModule[62]=C:\Windows\SYSTEM32\WINMM.dll
LoadedModule[63]=c:\Portable\PhotoDemonNightly\App\PhotoDemon\Plugins\libsharpyuv.dll
LoadedModule[64]=c:\Portable\PhotoDemonNightly\App\PhotoDemon\Plugins\libwebp.dll
LoadedModule[65]=c:\Portable\PhotoDemonNightly\App\PhotoDemon\Plugins\libwebpdemux.dll
LoadedModule[66]=c:\Portable\PhotoDemonNightly\App\PhotoDemon\Plugins\libwebpmux.dll
LoadedModule[67]=c:\Portable\PhotoDemonNightly\App\PhotoDemon\Plugins\pspiHost.dll
LoadedModule[68]=c:\Portable\PhotoDemonNightly\App\PhotoDemon\Plugins\resvg.dll
LoadedModule[69]=C:\Windows\System32\Ws2_32.DLL
LoadedModule[70]=C:\Windows\SYSTEM32\WindowsCodecs.dll
LoadedModule[71]=C:\Windows\System32\PROPSYS.dll
State[0].Key=Transport.DoneStage1
State[0].Value=1
OsInfo[0].Key=vermaj
OsInfo[0].Value=10
OsInfo[1].Key=vermin
OsInfo[1].Value=0
OsInfo[2].Key=verbld
OsInfo[2].Value=22621
OsInfo[3].Key=ubr
OsInfo[3].Value=2861
OsInfo[4].Key=versp
OsInfo[4].Value=0
OsInfo[5].Key=arch
OsInfo[5].Value=9
OsInfo[6].Key=lcid
OsInfo[6].Value=1033
OsInfo[7].Key=geoid
OsInfo[7].Value=176
OsInfo[8].Key=sku
OsInfo[8].Value=4
OsInfo[9].Key=domain
OsInfo[9].Value=0
OsInfo[10].Key=prodsuite
OsInfo[10].Value=256
OsInfo[11].Key=ntprodtype
OsInfo[11].Value=1
OsInfo[12].Key=platid
OsInfo[12].Value=10
OsInfo[13].Key=sr
OsInfo[13].Value=0
OsInfo[14].Key=tmsi
OsInfo[14].Value=222459407
OsInfo[15].Key=osinsty
OsInfo[15].Value=2
OsInfo[16].Key=iever
OsInfo[16].Value=11.1.22621.0-11.0.1000
OsInfo[17].Key=portos
OsInfo[17].Value=0
OsInfo[18].Key=ram
OsInfo[18].Value=32509
OsInfo[19].Key=svolsz
OsInfo[19].Value=930
OsInfo[20].Key=wimbt
OsInfo[20].Value=0
OsInfo[21].Key=blddt
OsInfo[21].Value=220506
OsInfo[22].Key=bldtm
OsInfo[22].Value=1250
OsInfo[23].Key=bldbrch
OsInfo[23].Value=ni_release
OsInfo[24].Key=bldchk
OsInfo[24].Value=0
OsInfo[25].Key=wpvermaj
OsInfo[25].Value=0
OsInfo[26].Key=wpvermin
OsInfo[26].Value=0
OsInfo[27].Key=wpbuildmaj
OsInfo[27].Value=0
OsInfo[28].Key=wpbuildmin
OsInfo[28].Value=0
OsInfo[29].Key=osver
OsInfo[29].Value=10.0.22621.2861.amd64fre.ni_release.220506-1250
OsInfo[30].Key=buildflightid
OsInfo[31].Key=edition
OsInfo[31].Value=Enterprise
OsInfo[32].Key=ring
OsInfo[32].Value=Retail
OsInfo[33].Key=expid
OsInfo[33].Value=RS:19AAF,MD:283BAEF,ME:25762F0,ME:27B9BC4,ME:28279A6
OsInfo[34].Key=fconid
OsInfo[34].Value=19193644,0,2,0;19194292,0,2,0;19195476,0,2,0;19638787,0,2,0;35681102,0,1,0;36803287,0,2,1;36803295,0,2,0;38277973,0,1,0;39263329,1,2,0;39281392,0,2,0;40025975,0,1,0;40616880,0,1,0;40883769,0,1,0;40981503,0,1,0;41135193,0,1,1;41137130,0,1,0;41342175,0,1,0;41655236,0,2,0;42105254,0,2,0;43133808,1,2,1;43169616,0,1,0;43203978,0,2,1;43772553,0,1,0;43844371,0,1,0;43978769,0,1,1;44325080,0,1,0;44521793,0,1,0;44552141,0,1,0;44776738,0,1,0;45185354,0,2,0;45991456,0,1,1;46551074,0,1,0;46557400,0,1,1
OsInfo[35].Key=containerid
OsInfo[36].Key=containertype
OsInfo[37].Key=edu
OsInfo[37].Value=0
OsInfo[38].Key=servicinginprogress
OsInfo[38].Value=0
OsInfo[39].Key=featureupdatependingreboot
OsInfo[39].Value=0
FriendlyEventName=Stopped working
ConsentKey=APPCRASH
AppName=PhotoDemon Photo Editor
AppPath=c:\Portable\PhotoDemonNightly\PhotoDemon.exe
NsPartner=windows
NsGroup=windows8
ApplicationIdentity=F8A6E8461582029D82B1547DFCA1CEC0
MetadataHash=592881405
hi5 commented 6 months ago

I noticed you had an update/commit in build 242 but I'm afraid that didn't resolve it for me, crashed on the first try (type/bs/type/bs -> crash) - Event viewer:

Faulting application name: PhotoDemon.exe, version: 9.1.0.242, time stamp: 0x659c22f4
Faulting module name: KERNELBASE.dll, version: 10.0.19041.3803, time stamp: 0x4f196cbf
Exception code: 0xc000041d
Fault offset: 0x0013f932
Faulting process id: 0x1370
Faulting application start time: 0x01da425636294d36
Faulting application path: C:\Portable\PhotoDemon\PhotoDemon.exe
Faulting module path: C:\Windows\System32\KERNELBASE.dll
Report Id: 23a3921e-4308-40fc-95c9-bb39cb5966dc
Faulting package full name: 
Faulting package-relative application ID: 
tannerhelland commented 6 months ago

Thank you so much for the detailed follow-ups, @hi5 ! I am following each update closely.

It has been difficult to catch up on missed work after a long holiday break, so right now I am focused on knocking out some low-hanging fruit (when I can spare a few minutes here and there), one of which might help with this crash. I am still struggling to replicate the problem locally (even on a recently spun-up Win 7 VM, argh!) but your detail that it can be reproduced across multiple versions of Windows is very helpful.

I will continue whittling away at this over the next few commits in hopes of finding a solution that works. If I can't reproduce the crash locally after a few more days of effort, I might upload a special one-time nightly build that logs detailed information on every search box function in hopes of narrowing the problem down further.

I will report back soon either way. Thank you again for the ongoing help ❤️

hi5 commented 6 months ago

Everyone deserves a long holiday break 😺

Build 246 seems to have improved the situation. I just tried to make it crash for a few minutes and under Windows 10 at the moment I can not make it crash by typing/bs/typing/bs etc and it just keeps working. So far so good.

I'll try Windows 11 as well later this week.

Should a new crash occur I'll post it here.

tannerhelland commented 5 months ago

Thank you so much, @hi5 . I hope the problem is gone for good but if not, I have a few other ideas!

(I wish I didn't have to take such a sloppy approach to fixing this one, but with intermittent errors it's sometimes a matter of shotgun-blasting potential fixes everywhere and hoping one hits!)

hi5 commented 5 months ago

No problems so far on Windows 11 either! 🥳

tannerhelland commented 4 months ago

I'm feeling extra optimistic today, so I'm going to close this issue in hopes that the problem is solved once-and-for-all. 😆 If the crash ever returns, please let me know - and thank you again for all your help with this one!