Page 2 of 4

Re: Random crash

Posted: Sat Jan 18, 2014 11:42 am
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.

Re: Random crash

Posted: Sat Jan 18, 2014 12:04 pm
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?

Re: Random crash

Posted: Sat Jan 18, 2014 4:34 pm
by Rings
no crash here.
if anybody except the poster can reproduce the error,
i'm willing to move this topic into bug reports.

Re: Random crash

Posted: Sun Jan 19, 2014 11:22 am
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.

Re: Random crash

Posted: Sun Jan 19, 2014 1:59 pm
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.

Re: Random crash

Posted: Mon Jan 20, 2014 8:49 am
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.

Re: Random crash

Posted: Mon Jan 20, 2014 10:34 am
by dman
I have tested this, No crash.

Re: Random crash

Posted: Mon Jan 20, 2014 1:00 pm
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?

Re: Random crash

Posted: Mon Jan 20, 2014 1:31 pm
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

Re: Random crash

Posted: Mon Jan 20, 2014 4:42 pm
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.

Re: Random crash

Posted: Mon Jan 20, 2014 4:48 pm
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.

Re: Random crash

Posted: Sat Mar 29, 2014 12:51 pm
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.

Re: Random crash

Posted: Fri Apr 04, 2014 11:11 am
by Lord
Lord wrote:..
It seems that the bug has flown away.
...
Bad news. Nothing has flown away. :evil:
The bug is still there. :(

Re: Random crash

Posted: Fri Apr 04, 2014 12:15 pm
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

Re: Random crash

Posted: Fri Apr 04, 2014 1:41 pm
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.