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

Application Errors opening PNG files - PhotoDemon 9.2 pre-alpha (build 339 (and a few before) #551

Closed hi5 closed 3 months ago

hi5 commented 3 months ago

Version information

PhotoDemon 9.2 pre-alpha (build 339), windows 10 - it happened with a few version before too I think but didn't register to me that it was with the 2nd and more images loaded (I often only work on one image at a time)

Describe the bug

I start PD, open a PNG file, that works. Now I open another PNG file and because I still have procdump installed I started noticing that when loading more than one file procdump generated crash dumps.

PD does NOT crash and opens the PNG file just fine, I can open more PNG files, each generating a crash dump but it opens the files just fine and PD doesn't crash. However I do see the following errors appear in the Windows Event Viewer and these WER logs

Log Name:      Application
Source:        Windows Error Reporting
Date:          03/27/2024 22:58:07
Event ID:      1001
Task Category: None
Level:         Information
Keywords:      Classic
User:          N/A
Computer:      DESKTOP-OB43K8S
Description:
Fault bucket 1648914711920368945, type 1
Event Name: APPCRASH
Response: Not available
Cab Id: 0

Problem signature:
P1: PhotoDemon.exe
P2: 9.1.0.339
P3: 65ff8658
P4: KERNELBASE.dll
P5: 10.0.19041.4170
P6: 96969434
P7: c000041d
P8: 0013fa72
P9: 
P10: 

Attached files:
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WERC9A1.tmp.dmp
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WERCA00.tmp.WERInternalMetadata.xml
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WERCA20.tmp.xml
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WERCA28.tmp.csv
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WERCA48.tmp.txt

These files may be available here:
\\?\C:\ProgramData\Microsoft\Windows\WER\ReportArchive\AppCrash_PhotoDemon.exe_c34317ecae2f412e767aabea7c529918d22d75f5_02f517e0_502deca3-08b7-449b-8522-66287c82eaac

Analysis symbol: 
Rechecking for solution: 0
Report Id: 4fd850c5-fec7-4db6-8ee8-a218fc14c030
Report Status: 268435456
Hashed bucket: 41737481df3bc718f6e21f31b4eddd31
Cab Guid: 0
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Windows Error Reporting" />
    <EventID Qualifiers="0">1001</EventID>
    <Version>0</Version>
    <Level>4</Level>
    <Task>0</Task>
    <Opcode>0</Opcode>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2024-03-27T21:58:07.8355896Z" />
    <EventRecordID>55465</EventRecordID>
    <Correlation />
    <Execution ProcessID="0" ThreadID="0" />
    <Channel>Application</Channel>
    <Computer>DESKTOP-OB43K8S</Computer>
    <Security />
  </System>
  <EventData>
    <Data>1648914711920368945</Data>
    <Data>1</Data>
    <Data>APPCRASH</Data>
    <Data>Not available</Data>
    <Data>0</Data>
    <Data>PhotoDemon.exe</Data>
    <Data>9.1.0.339</Data>
    <Data>65ff8658</Data>
    <Data>KERNELBASE.dll</Data>
    <Data>10.0.19041.4170</Data>
    <Data>96969434</Data>
    <Data>c000041d</Data>
    <Data>0013fa72</Data>
    <Data>
    </Data>
    <Data>
    </Data>
    <Data>
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WERC9A1.tmp.dmp
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WERCA00.tmp.WERInternalMetadata.xml
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WERCA20.tmp.xml
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WERCA28.tmp.csv
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WERCA48.tmp.txt</Data>
    <Data>\\?\C:\ProgramData\Microsoft\Windows\WER\ReportArchive\AppCrash_PhotoDemon.exe_c34317ecae2f412e767aabea7c529918d22d75f5_02f517e0_502deca3-08b7-449b-8522-66287c82eaac</Data>
    <Data>
    </Data>
    <Data>0</Data>
    <Data>4fd850c5-fec7-4db6-8ee8-a218fc14c030</Data>
    <Data>268435456</Data>
    <Data>41737481df3bc718f6e21f31b4eddd31</Data>
    <Data>0</Data>
  </EventData>
</Event>

WER REPORT

Version=1
EventType=APPCRASH
EventTime=133560502864785279
ReportType=2
Consent=1
UploadTime=133560502867087969
ReportStatus=268435456
ReportIdentifier=502deca3-08b7-449b-8522-66287c82eaac
IntegratorReportIdentifier=4fd850c5-fec7-4db6-8ee8-a218fc14c030
Wow64Host=34404
Wow64Guest=332
NsAppName=PhotoDemon.exe
OriginalFilename=PhotoDemon.exe
AppSessionGuid=000023a0-0001-0204-4687-89d69180da01
TargetAppId=W:0006cefbd79c323553097a26c295b0c9c00100000904!000090522365e403570e1f971c4321b7457757f1c739!PhotoDemon.exe
TargetAppVer=2024//03//24:01:48:08!856ca9!PhotoDemon.exe
BootId=4294967295
ServiceSplit=40886556
TargetAsId=619
IsFatal=1
EtwNonCollectReason=1
Response.BucketId=41737481df3bc718f6e21f31b4eddd31
Response.BucketTable=1
Response.LegacyBucketId=1648914711920368945
Response.type=4
Sig[0].Name=Application Name
Sig[0].Value=PhotoDemon.exe
Sig[1].Name=Application Version
Sig[1].Value=9.1.0.339
Sig[2].Name=Application Timestamp
Sig[2].Value=65ff8658
Sig[3].Name=Fault Module Name
Sig[3].Value=KERNELBASE.dll
Sig[4].Name=Fault Module Version
Sig[4].Value=10.0.19041.4170
Sig[5].Name=Fault Module Timestamp
Sig[5].Value=96969434
Sig[6].Name=Exception Code
Sig[6].Value=c000041d
Sig[7].Name=Exception Offset
Sig[7].Value=0013fa72
DynamicSig[1].Name=OS Version
DynamicSig[1].Value=10.0.19045.2.0.0.256.48
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=7153
DynamicSig[25].Name=Additional Information 4
DynamicSig[25].Value=7153836c06c08bf9af5967f54f58e0ff
UI[2]=c:\Portable\Photodemon\PhotoDemon.exe
LoadedModule[0]=c:\Portable\Photodemon\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\bcrypt.dll
LoadedModule[16]=C:\Windows\System32\ole32.dll
LoadedModule[17]=C:\Windows\System32\combase.dll
LoadedModule[18]=C:\Windows\System32\OLEAUT32.dll
LoadedModule[19]=C:\Windows\System32\IMM32.DLL
LoadedModule[20]=C:\Windows\SYSTEM32\kernel.appcore.dll
LoadedModule[21]=C:\Windows\System32\bcryptPrimitives.dll
LoadedModule[22]=C:\Windows\system32\uxtheme.dll
LoadedModule[23]=C:\Windows\SYSTEM32\SXS.DLL
LoadedModule[24]=C:\Windows\System32\MSCTF.dll
LoadedModule[25]=C:\Windows\System32\clbcatq.dll
LoadedModule[26]=C:\Windows\System32\shell32.dll
LoadedModule[27]=C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.19041.3636_none_a863d714867441db\comctl32.DLL
LoadedModule[28]=C:\Windows\system32\dataexchange.dll
LoadedModule[29]=C:\Windows\system32\d3d11.dll
LoadedModule[30]=C:\Windows\system32\dcomp.dll
LoadedModule[31]=C:\Windows\system32\dxgi.dll
LoadedModule[32]=C:\Windows\system32\twinapi.appcore.dll
LoadedModule[33]=C:\Windows\WinSxS\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.19041.3996_none_d954cb49e10154a6\gdiplus.DLL
LoadedModule[34]=C:\Windows\SYSTEM32\TextShaping.dll
LoadedModule[35]=C:\Windows\system32\explorerframe.dll
LoadedModule[36]=C:\Windows\System32\SHCORE.dll
LoadedModule[37]=C:\Windows\System32\SHLWAPI.dll
LoadedModule[38]=C:\Windows\SYSTEM32\shfolder.DLL
LoadedModule[39]=C:\Windows\SYSTEM32\windows.storage.dll
LoadedModule[40]=C:\Windows\SYSTEM32\Wldp.dll
LoadedModule[41]=C:\Windows\System32\psapi.DLL
LoadedModule[42]=C:\Windows\SYSTEM32\VERSION.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=19045
OsInfo[3].Key=ubr
OsInfo[3].Value=4170
OsInfo[4].Key=versp
OsInfo[4].Value=0
OsInfo[5].Key=arch
OsInfo[5].Value=9
OsInfo[6].Key=lcid
OsInfo[6].Value=1043
OsInfo[7].Key=geoid
OsInfo[7].Value=176
OsInfo[8].Key=sku
OsInfo[8].Value=48
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=222597987
OsInfo[15].Key=osinsty
OsInfo[15].Value=1
OsInfo[16].Key=iever
OsInfo[16].Value=11.3636.19041.0-11.0.1000
OsInfo[17].Key=portos
OsInfo[17].Value=0
OsInfo[18].Key=ram
OsInfo[18].Value=16259
OsInfo[19].Key=svolsz
OsInfo[19].Value=237
OsInfo[20].Key=wimbt
OsInfo[20].Value=0
OsInfo[21].Key=blddt
OsInfo[21].Value=191206
OsInfo[22].Key=bldtm
OsInfo[22].Value=1406
OsInfo[23].Key=bldbrch
OsInfo[23].Value=vb_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.19041.4170.amd64fre.vb_release.191206-1406
OsInfo[30].Key=buildflightid
OsInfo[31].Key=edition
OsInfo[31].Value=Professional
OsInfo[32].Key=ring
OsInfo[33].Key=expid
OsInfo[34].Key=fconid
OsInfo[35].Key=containerid
OsInfo[36].Key=containertype
OsInfo[37].Key=edu
OsInfo[37].Value=0
FriendlyEventName=Stopped working
ConsentKey=APPCRASH
AppName=PhotoDemon Photo Editor
AppPath=c:\Portable\Photodemon\PhotoDemon.exe
NsPartner=windows
NsGroup=windows8
ApplicationIdentity=D40592C4DB3069D135FED63DDADCD82A
MetadataHash=-1751282341

How can I reproduce the bug?

Open a PNG file, open another PNG file, and then check Windows Event Viewer to see if you see ERRORs

Expected behavior

No errors to appear :)

Debug logs

Debug log DebugReport_0.zip

Edit: also on Windows 11 I can see the above errors and wer appear

tannerhelland commented 3 months ago

Thank you for filing this issue, @hi5 ! It took me some time to figure out that this only happens when loading an image by double-clicking in Windows Explorer (or elsewhere), and having PhotoDemon set to single-session mode.

When an image is double-clicked in Explorer, a new instance of PhotoDemon is launched. That new instance then checks to see if any other instances of PhotoDemon are open, and if they are, the new instance forwards the clicked file information to the previous app instance, then shuts itself down (because the first instance is going to load the image instead).

Unfortunately, before shutting down, the temporary instance of PhotoDemon was trying to unload the newly implemented PDF library.... but that library had never been loaded into that instance because the app was just going to shut down anyway (because the other PhotoDemon instance was handling the actual image load).

Trying to unload a library that was never loaded in the first place caused the silent crash. Argh 🤦

I'm so glad you caught this problem. Thanks again!

hi5 commented 3 months ago

Glad you were able to find the problem and solve it!