Im my latest project I noticed a strange behaviour.
After exiting the program sometimes I got an appcrash C0000005 error.
The circumstances when this error occurs are very random.
Sometimes I could start and use the program whitout a problem,
sometime after every time I started and closed the program: crash.
This is a typical resulting system message:
I stripped the program down to a minimum where this error occurs.[Window Title]
PureBasic_Compilation11.exe
[Main Instruction]
PureBasic_Compilation11.exe funktioniert nicht mehr
[Content]
Windows kann online nach einer Lösung für das Problem suchen.
[V] Problemdetails anzeigen [Online nach einer Lösung suchen und das Programm schließen] [Programm schließen]
Problemsignatur:
Problemereignisname: APPCRASH
Anwendungsname: PureBasic_Compilation11.exe
Anwendungsversion: 0.0.0.0
Anwendungszeitstempel: 52b18c33
Fehlermodulname: PureBasic_Compilation11.exe
Fehlermodulversion: 0.0.0.0
Fehlermodulzeitstempel: 52b18c33
Ausnahmecode: c0000005
Ausnahmeoffset: 0000a345
Betriebsystemversion: 6.1.7601.2.1.0.256.1
Gebietsschema-ID: 1031
Zusatzinformation 1: 8c89
Zusatzinformation 2: 8c89566082489d13c7b32f8a9923c3eb
Zusatzinformation 3: d465
Zusatzinformation 4: d465dd4818e5e09517e9c5df8b9460fb
Lesen Sie unsere Datenschutzbestimmungen online:
http://go.microsoft.com/fwlink/?linkid= ... cid=0x0407
Wenn die Onlinedatenschutzbestimmungen nicht verfügbar sind, lesen Sie unsere Datenschutzbestimmungen offline:
C:\Windows\system32\de-DE\erofflps.txt
I can not trap this error, because with debugger on PB has already
finished, so I cannot check variables, memory and so on. Purifier
wasn't also a help. Threadsafe on or off didn't make any difference.
The source is UTF-8 and compiled to Unicode.
I use some dummy files like these:
Just open an empty txt-file and rename them._Huber - Kopie.ged
_Meyer - Kopie.ged
_Müller - Kopie.ged
_Schmidt - Kopie.ged
_Schulze - Kopie.ged
To provoke the crash run the program and open the above build dummy-
files. But be warned. The error shows up very randomly, sometimes
you have to open the files 2 or 3 times and then close the program
window. Even then sometimes it happens nothing. Sometimes you have
just to open one or two files and then after closing the window the
crash occurs.
It's boring. I don't have any clue what the reason is.
I don't know wether the ListViewGadget has to be there and causes
the crash, but I couldn't provoke the error whithout it. I left
the Procedure in because in my complete program sometimes just
opening and closing the requester and then closing the window caused
the crash.
There may be also some other parts of the program witch are not
neccesary, but without I couldn't also get the crash showing up.
Maybe it has nothing to do with PureBasic, or this snippet, but
I do not have problems with other programs or my other Purebasic
programs. It's really annoying.
So, here is my (#*$&*#/&§!!) test code:
Code: Select all
EnableExplicit
;
#MainWindow = 1
#myList = 1
#OpenGedComFile = 1
;
Global Datei.s
;
Procedure GetGED()
Protected Pattern.s
Pattern.s="GedCom-Dateien (*.ged)|*.ged|Alle Dateien (*.*)|*.*"
Datei=OpenFileRequester("Datei öffnen", Datei, Pattern, 0)
If Datei=""
End
EndIf
EndProcedure
OpenWindow(#MainWindow, 10, 10, 900, 556,"", #PB_Window_SystemMenu|#PB_Window_SizeGadget)
AddKeyboardShortcut(#MainWindow, #PB_Shortcut_Control|#PB_Shortcut_O, #OpenGedComFile)
ListIconGadget(#myList, 0, 0, WindowWidth(#MainWindow), WindowHeight(#MainWindow)-240, "", 10, #PB_ListIcon_GridLines|#PB_ListIcon_AlwaysShowSelection|#PB_ListIcon_FullRowSelect|#PB_ListIcon_MultiSelect)
Define quit=#False
Repeat
Define Event=WaitWindowEvent()
Define EventWindow=EventWindow()
Define EventMenu=EventMenu()
Select EventWindow
Case #MainWindow
Select Event
Case #PB_Event_Menu
Select EventMenu
Case #OpenGedComFile; [STRG][O] neue GEDCOM-Datei laden
Datei=OpenFileRequester("GedCom öffnen...", GetPathPart(Datei), "GedCom Datei (ged)|*.ged",1)
If Datei
If GetExtensionPart(Datei)="ged"
;
EndIf
EndIf
EndSelect
Case #PB_Event_CloseWindow
Quit=#True
EndSelect
EndSelect
Until Quit
End
the crash shows up.
Thank you for reading.