Autor Beitrag
hui1991
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 433

Windows XP, WIndows Vista
Turbo Delphi Explorer| Delphi, PHP,Blitzbasic
BeitragVerfasst: Mo 06.07.09 10:58 
Hallo,

ich hab eine Software zur Verwaltung geschrieben, diese läuft den ganzen Tag. Es passiert aber öfters das die Software plötzlich sich schließt.
Diesen Fehler habe ich mit Try-Catch abgefangen und in eine Datei geschrieben, jetzt hab ich vom 30.06 bis heute schon 7-mal ein Programmabsturtz wegen diesem Fehler bekommen.
Ich hab gedacht, dass ein Timer den Fehler verursacht. Hat ja auch 2 Tage wunderbar funktioniert, kein Absturz an den Tagen gewesen. Code kann ich nicht zeigen, da ich nicht weiß an welcher Stelle es passiert.

Das sind die Fehlermeldungen:
ausblenden volle Höhe Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
System.Collections.ListDictionaryInternal

-------------------

-------------------

Es wurde versucht, im geschützten Speicher zu lesen oder zu schreiben. Dies ist häufig ein Hinweis darauf, dass anderer Speicher beschädigt ist.

System.Windows.Forms

   bei System.Windows.Forms.SafeNativeMethods.SetWindowPos(HandleRef hWnd, HandleRef hWndInsertAfter, Int32 x, Int32 y, Int32 cx, Int32 cy, Int32 flags)
   bei System.Windows.Forms.Form.set_TopMost(Boolean value)
   bei System.Windows.Forms.Form.CreateHandle()
   bei System.Windows.Forms.Control.get_Handle()
   bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   bei System.Windows.Forms.Application.RunDialog(Form form)
   bei System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
   bei System.Windows.Forms.Form.ShowDialog()
   bei System.Windows.Forms.Application.ThreadContext.OnThreadException(Exception t)
   bei System.Windows.Forms.Control.WndProcException(Exception e)
   bei System.Windows.Forms.Control.ControlNativeWindow.OnThreadException(Exception e)
   bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   bei System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
   bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   bei System.Windows.Forms.Application.Run(Form mainForm)
   bei Software.Program.Main()

Boolean SetWindowPos(System.Runtime.InteropServices.HandleRef, System.Runtime.InteropServices.HandleRef, Int32, Int32, Int32, Int32, Int32)

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
System.Collections.ListDictionaryInternal

-------------------

-------------------

Es wurde versucht, im geschützten Speicher zu lesen oder zu schreiben. Dies ist häufig ein Hinweis darauf, dass anderer Speicher beschädigt ist.

System.Windows.Forms

   bei System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd, Int32 nCmdShow)
   bei System.Windows.Forms.Control.SetVisibleCore(Boolean value)
   bei System.Windows.Forms.Form.SetVisibleCore(Boolean value)
   bei System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
   bei System.Windows.Forms.Form.ShowDialog()
   bei System.Windows.Forms.Application.ThreadContext.OnThreadException(Exception t)
   bei System.Windows.Forms.Control.WndProcException(Exception e)
   bei System.Windows.Forms.Control.ControlNativeWindow.OnThreadException(Exception e)
   bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   bei System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
   bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   bei System.Windows.Forms.Application.Run(Form mainForm)
   bei Software.Program.Main()

Boolean ShowWindow(System.Runtime.InteropServices.HandleRef, Int32)

ausblenden volle Höhe Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
System.Collections.ListDictionaryInternal

-------------------

-------------------

Es wurde versucht, im geschützten Speicher zu lesen oder zu schreiben. Dies ist häufig ein Hinweis darauf, dass anderer Speicher beschädigt ist.

System.Windows.Forms

   bei System.Windows.Forms.SafeNativeMethods.SetWindowPos(HandleRef hWnd, HandleRef hWndInsertAfter, Int32 x, Int32 y, Int32 cx, Int32 cy, Int32 flags)
   bei System.Windows.Forms.Form.set_TopMost(Boolean value)
   bei System.Windows.Forms.Form.CreateHandle()
   bei System.Windows.Forms.Control.get_Handle()
   bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   bei System.Windows.Forms.Application.RunDialog(Form form)
   bei System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
   bei System.Windows.Forms.Form.ShowDialog()
   bei System.Windows.Forms.Application.ThreadContext.OnThreadException(Exception t)
   bei System.Windows.Forms.Control.WndProcException(Exception e)
   bei System.Windows.Forms.Control.ControlNativeWindow.OnThreadException(Exception e)
   bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   bei System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
   bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   bei System.Windows.Forms.Application.Run(Form mainForm)
   bei Software.Program.Main()

Boolean SetWindowPos(System.Runtime.InteropServices.HandleRef, System.Runtime.InteropServices.HandleRef, Int32, Int32, Int32, Int32, Int32)

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
System.Collections.ListDictionaryInternal

-------------------

-------------------

Es wurde versucht, im geschützten Speicher zu lesen oder zu schreiben. Dies ist häufig ein Hinweis darauf, dass anderer Speicher beschädigt ist.

System.Windows.Forms

   bei System.Windows.Forms.UnsafeNativeMethods.PeekMessage(MSG& msg, HandleRef hwnd, Int32 msgMin, Int32 msgMax, Int32 remove)
   bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
   bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   bei System.Windows.Forms.Application.RunDialog(Form form)
   bei System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
   bei System.Windows.Forms.Form.ShowDialog()
   bei System.Windows.Forms.Application.ThreadContext.OnThreadException(Exception t)
   bei System.Windows.Forms.Control.WndProcException(Exception e)
   bei System.Windows.Forms.Control.ControlNativeWindow.OnThreadException(Exception e)
   bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   bei System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
   bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   bei System.Windows.Forms.Application.Run(Form mainForm)
   bei Software.Program.Main()

Boolean PeekMessage(MSG ByRef, System.Runtime.InteropServices.HandleRef, Int32, Int32, Int32)

ausblenden volle Höhe Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
System.Collections.ListDictionaryInternal

-------------------

-------------------

Es wurde versucht, im geschützten Speicher zu lesen oder zu schreiben. Dies ist häufig ein Hinweis darauf, dass anderer Speicher beschädigt ist.

System.Windows.Forms

   bei System.Windows.Forms.SafeNativeMethods.SetWindowPos(HandleRef hWnd, HandleRef hWndInsertAfter, Int32 x, Int32 y, Int32 cx, Int32 cy, Int32 flags)
   bei System.Windows.Forms.Form.set_TopMost(Boolean value)
   bei System.Windows.Forms.Form.CreateHandle()
   bei System.Windows.Forms.Control.get_Handle()
   bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   bei System.Windows.Forms.Application.RunDialog(Form form)
   bei System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
   bei System.Windows.Forms.Form.ShowDialog()
   bei System.Windows.Forms.Application.ThreadContext.OnThreadException(Exception t)
   bei System.Windows.Forms.Control.WndProcException(Exception e)
   bei System.Windows.Forms.Control.ControlNativeWindow.OnThreadException(Exception e)
   bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   bei System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
   bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   bei System.Windows.Forms.Application.Run(Form mainForm)
   bei Software.Program.Main()

Boolean SetWindowPos(System.Runtime.InteropServices.HandleRef, System.Runtime.InteropServices.HandleRef, Int32, Int32, Int32, Int32, Int32)

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
System.Collections.ListDictionaryInternal

-------------------

-------------------

Es wurde versucht, im geschützten Speicher zu lesen oder zu schreiben. Dies ist häufig ein Hinweis darauf, dass anderer Speicher beschädigt ist.

System.Windows.Forms

   bei System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd, Int32 nCmdShow)
   bei System.Windows.Forms.Control.SetVisibleCore(Boolean value)
   bei System.Windows.Forms.Form.SetVisibleCore(Boolean value)
   bei System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
   bei System.Windows.Forms.Form.ShowDialog()
   bei System.Windows.Forms.Application.ThreadContext.OnThreadException(Exception t)
   bei System.Windows.Forms.Control.WndProcException(Exception e)
   bei System.Windows.Forms.Control.ControlNativeWindow.OnThreadException(Exception e)
   bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   bei System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
   bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   bei System.Windows.Forms.Application.Run(Form mainForm)
   bei Software.Program.Main()

Boolean ShowWindow(System.Runtime.InteropServices.HandleRef, Int32)

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
System.Collections.ListDictionaryInternal

-------------------

-------------------

Es wurde versucht, im geschützten Speicher zu lesen oder zu schreiben. Dies ist häufig ein Hinweis darauf, dass anderer Speicher beschädigt ist.

System.Windows.Forms

   bei System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd, Int32 nCmdShow)
   bei System.Windows.Forms.Control.SetVisibleCore(Boolean value)
   bei System.Windows.Forms.Form.SetVisibleCore(Boolean value)
   bei System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
   bei System.Windows.Forms.Form.ShowDialog()
   bei System.Windows.Forms.Application.ThreadContext.OnThreadException(Exception t)
   bei System.Windows.Forms.Control.WndProcException(Exception e)
   bei System.Windows.Forms.Control.ControlNativeWindow.OnThreadException(Exception e)
   bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   bei System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
   bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   bei System.Windows.Forms.Application.Run(Form mainForm)
   bei Software.Program.Main()

Boolean ShowWindow(System.Runtime.InteropServices.HandleRef, Int32)


Würde mich freuen, wenn ihr einen Tipp geben könntet wie man diesen Fehler beseitigt.

Ich dachte das bei C# keine Zugriffverletzungen mehr gibt, aber anscheinend doch.
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19315
Erhaltene Danke: 1747

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mo 06.07.09 11:13 
Kann es sein, dass da ein Speicherleck oder so vorhanden ist? So dass das Programm immer mehr Speicher braucht?
Zur Entdeckung solcher Speicherlecks bei .NET:
www.codeproject.com/..._Leak_Detection.aspx
Und ein Artikel zu Speicherproblemen von MS:
msdn.microsoft.com/d...gazine/cc163528.aspx
Kha
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3803
Erhaltene Danke: 176

Arch Linux
Python, C, C++ (vim)
BeitragVerfasst: Mo 06.07.09 11:39 
Es sieht ja so aus, als ob der Fehler beim Anzeigen einer anderen Exception auftritt - also würde ich mal versuchen, über Application.ThreadException diesen ursprünglichen Fehler abzufangen.
user profile iconhui1991 hat folgendes geschrieben Zum zitierten Posting springen:
Ich dachte das bei C# keine Zugriffverletzungen mehr gibt, aber anscheinend doch.
Nur, wenn du mit unmanaged/unsafe Code herumfummelst und daneben langst - oder eben Microsoft das tut :zwinker: .

_________________
>λ=