Random crash

Just starting out? Need help? Post your questions and find answers here.
User avatar
Lord
Addict
Addict
Posts: 900
Joined: Tue May 26, 2009 2:11 pm

Re: Random crash

Post by Lord »

My update on this issue:

The crash with the snippet above still happens.
Very rarely, but happens.

I tried a new Win7 installation in a VM.
Result: same random crash

Then - after making a complete backup of my sytem -
I formatted my system drive an installed Win7 again.
Then I installed all MS updates to get an up to date
system.
In this virgin system I installed only PB 5.21 LTS(x86),
no other software.
Result: same randow crash.

At last, I could try the compiled code on a laptop from
a friend of mine.
Result: random crash.

So the question is: What do these and earlier mentioned
test scenarios in common?
Right, PureBasic.

So I still think there must be a bug in PureBasic which
causes the crash.
Image
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: Random crash

Post by PB »

I didn't get any crashes with your test code. Stats in my sig.

I remember reading something once about a crash with requesters,
and it was fixed by putting CoInitialize_(0) at the start of the code,
and CoUninitialize_() at the end. Maybe wrap your test code with
those and see if you still get the crashes?
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Re: Random crash

Post by Rings »

no crash here.
if anybody except the poster can reproduce the error,
i'm willing to move this topic into bug reports.
SPAMINATOR NR.1
User avatar
Lord
Addict
Addict
Posts: 900
Joined: Tue May 26, 2009 2:11 pm

Re: Random crash

Post by Lord »

Hi PB!
PB wrote:...
I remember reading something once about a crash with requesters,
and it was fixed by putting CoInitialize_(0) at the start of the code,
and CoUninitialize_() at the end. Maybe wrap your test code with
those and see if you still get the crashes?
Thank you for your answer.
I tried CoInitialize_(0) and CoUninitialize_() but still get the exception.

@Rings
Any better ideas to pinpoint this "bug"?
I tried different versions of PB: It seems that it started with PB 5.20 LTS
as on previous versions I couldn't reproduce the crash (I know, this is no
proof, as it is hard to provoke this error).
I tried 2 different computer, both have Intel i5, but different OS: Win7 and Win8
I tried different OS in a VM: Win7 and XP
It makes no difference wether the code is execute with or without debugger
(the debugger doesn't catch the error) nor if the code is run as executable.
Image
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Re: Random crash

Post by rsts »

Tried a few dozen times on Win 8.1 x64 PB 5.21 LTS x64. (AMD processor)

Could not reproduce an error.

Will keep trying throughout the day on PB 32 and 64 bit.
User avatar
Lord
Addict
Addict
Posts: 900
Joined: Tue May 26, 2009 2:11 pm

Re: Random crash

Post by Lord »

rsts wrote:Tried a few dozen times on Win 8.1 x64 PB 5.21 LTS x64. (AMD processor)

Could not reproduce an error.

Will keep trying throughout the day on PB 32 and 64 bit.
Thank you for your effort.

I will keep you up to date on this topic here if there are any news.
Image
dman
User
User
Posts: 48
Joined: Thu Oct 01, 2009 2:10 pm

Re: Random crash

Post by dman »

I have tested this, No crash.
PureBasic
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: Random crash

Post by PB »

> After exiting the program sometimes I got an appcrash C0000005 error

"AppCrash C0000005" errors are not always the fault of the running exe.
Sometimes other factors* can cause the crash of a running exe (in your case,
"PureBasic_Compilation.exe") rather than the crashed exe itself being to blame.

So, until you can prove otherwise with reproducible steps that at least one
other person in these forums can verify, I'd say that's what's been happening.

*Source: http://www.sevenforums.com/bsod-help-su ... 00005.html
Look how many games this guy has, that are crashing with "AppCrash C0000005"!
Do you really think they are all buggy executables by their respective developers?
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
auser
Enthusiast
Enthusiast
Posts: 195
Joined: Wed Sep 06, 2006 6:59 am

Re: Random crash

Post by auser »

I would recommend to take a look with Process Monitor: http://technet.microsoft.com/en-us/sysi ... s/bb896645 - You should see there about 10 further lines from your exe after it finished already (e.g. Registry stuff and so on). Create a filter to exlucde everything that is not your test.exe and search for Buffer Overflow and other bad stuff. Since it's independent from the PB-Debugger you could get a clue that way (maybe it's something related to user-rights or network-shares).

Or maybe you could try to use WinAPI command instead of built in OpenFileRequester to compare if the result differs:

Code: Select all

Define Path.s=GetPathPart(ProgramFilename())
Define Pattern.s="GedCom Datei (ged)|*.ged"
Define Datei.s
Define ofname.openfilename
Define *filter
Define *filename
Define quit=#False

OpenWindow(1, 10, 10, 900, 556,"", #PB_Window_SystemMenu|#PB_Window_SizeGadget)
AddKeyboardShortcut(1, #PB_Shortcut_Control|#PB_Shortcut_O, 1)

Repeat
  Define Event=WaitWindowEvent()
  Define EventMenu=EventMenu()
 
  Select Event
     
    Case #PB_Event_Menu
      Select EventMenu
         
        Case 1         
          *filter = AllocateMemory(StringByteLength(Pattern)+4)
          *filename = AllocateMemory(65536)
          Define x.i
          
          For x = 0 To StringByteLength(Pattern)   
            If Not PeekC(@Pattern+x) = '|'
              PokeC(*filter+x,PeekC(@Pattern+x))
            EndIf 
            CompilerIf #PB_Compiler_Unicode
              x + 1
            CompilerEndIf 
          Next   

          ofname\lStructsize = SizeOf(ofname)
          ofname\lpstrFilter = *filter
          ofname\nMaxFile = 65536
          ofname\lpstrFile = *filename
          ofname\lpstrTitle = @"GedCom öffnen..."

          If GetOpenFileName_(@ofname)
            Datei = PeekS(ofname\lpstrFile,65536)
          EndIf 
          
          FreeMemory(*filter)
          FreeMemory(*filename)
         
      EndSelect
     
    Case #PB_Event_CloseWindow
      Quit=#True
     
  EndSelect
 
Until Quit

End

Greetings,
auser
User avatar
Lord
Addict
Addict
Posts: 900
Joined: Tue May 26, 2009 2:11 pm

Re: Random crash

Post by Lord »

PB wrote:> After exiting the program sometimes I got an appcrash C0000005 error

"AppCrash C0000005" errors are not always the fault of the running exe.
Sometimes other factors* can cause the crash of a running exe (in your case,
"PureBasic_Compilation.exe") rather than the crashed exe itself being to blame.

So, until you can prove otherwise with reproducible steps that at least one
other person in these forums can verify, I'd say that's what's been happening.

*Source: http://www.sevenforums.com/bsod-help-su ... 00005.html
Look how many games this guy has, that are crashing with "AppCrash C0000005"!
Do you really think they are all buggy executables by their respective developers?
I don't know, why that guy has so many different games wich chrashes.
I know, that I have one constellation where an exe produced with PureBasic
causes on my computer and at least on one Laptop a crash. If I avoid
OpenFileRequester() and avoid Purebasic-versions after PB 5.20 I don't have
these random exceptions. That is all I (can) say. All other programs I'm
running (including PB generated exe) are working fine in this respect.
Image
User avatar
Lord
Addict
Addict
Posts: 900
Joined: Tue May 26, 2009 2:11 pm

Re: Random crash

Post by Lord »

Hi auser!
auser wrote:I would recommend to take a look with Process Monitor: http://technet.microsoft.com/en-us/sysi ... s/bb896645 - You should see there about 10 further lines from your exe after it finished already (e.g. Registry stuff and so on). Create a filter to exlucde everything that is not your test.exe and search for Buffer Overflow and other bad stuff. Since it's independent from the PB-Debugger you could get a clue that way (maybe it's something related to user-rights or network-shares).

Or maybe you could try to use WinAPI command instead of built in OpenFileRequester to compare if the result differs:

Code: Select all

....
...
I tried the API variation of OpenFileRequester() and it also throws that exception.
I think I tried this in a early stage of my attempts to locate the reason an error,
but I forgot to mention that. Sorry for that.

I will try your recommendation in capturing the exception with Process Monitor and
report back.
Image
User avatar
Lord
Addict
Addict
Posts: 900
Joined: Tue May 26, 2009 2:11 pm

Re: Random crash

Post by Lord »

Update on this topic:

I now tried for almost two weeks to reproduce the
IMA with the new PB 5.22 LTS with no success.
It seems that the bug has flown away.
I know, that the absence of occuring of an IMA
doesn't mean that it was fixed or was not a PB
problem, as nobody else could reproduce the IMA
and myself was not always able to get this be-
haviour appearing.
I will still have an eye on this.

P.S.
I didn't change anything on my machine except
installing new 5.22 LTS.
Previous versions (including 5.22 Betas) still throw
out this error. So I'm still convinced that this was
a PB bug.
Image
User avatar
Lord
Addict
Addict
Posts: 900
Joined: Tue May 26, 2009 2:11 pm

Re: Random crash

Post by Lord »

Lord wrote:..
It seems that the bug has flown away.
...
Bad news. Nothing has flown away. :evil:
The bug is still there. :(
Image
infratec
Always Here
Always Here
Posts: 7581
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Random crash

Post by infratec »

Hi,

try this:

Code: Select all

OpenWindow(#MainWindow, 10, 10, 900, 556,"", #PB_Window_SystemMenu|#PB_Window_SizeGadget)
CreateMenu(0, WindowID(#MainWindow))
AddKeyboardShortcut(#MainWindow, #PB_Shortcut_Control|#PB_Shortcut_O, #OpenGedComFile)
Maybe it helps.

Bernd
User avatar
Lord
Addict
Addict
Posts: 900
Joined: Tue May 26, 2009 2:11 pm

Re: Random crash

Post by Lord »

Hello Bernd!

Thank you for another helping hand.

Unfortunatly this way doesn't work either.
As the problem occured first in a much bigger program,
there were also a menu. I stripped it down and left
the keyboard shortcut because I could faster handle
it for testing.
The IMA occures with and without a menu.
Image
Post Reply