Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

[MBS] DirectorySizeMBS crash c0000005? (MBS Xojo Plugin Mailinglist archive)

Back to the thread list
Previous thread: Re: [MBS] window.BackingScaleFactorMBS functionality for Windows?
Next thread: [MBS] [ANN] 15.0pr8


[MBS] PortAudio   -   Garth Hjelte
  [MBS] DirectorySizeMBS crash c0000005?   -   Jean-Luc Arnaud
   Re: [MBS] DirectorySizeMBS crash c0000005?   -   Christian Schmitz
    Re: [MBS] DirectorySizeMBS crash c0000005?   -   Jean-Luc Arnaud
   Re: [MBS] DirectorySizeMBS crash c0000005?   -   Christian Schmitz
    Re: [MBS] DirectorySizeMBS crash c0000005?   -   Jean-Luc Arnaud

[MBS] DirectorySizeMBS crash c0000005?
Date: 26.01.15 18:05 (Mon, 26 Jan 2015 18:05:37 +0100)
From: Jean-Luc Arnaud
Hi all,

Using DirectorySizeMBS as shown in the MBS doc, I get the size of my
data folder, and then (5-10 seconds later), my app crashes with a
c0000005 code (Access Violation).

In the Run event of a thread:

Dim d as DirectorySizeMBS
Dim Size As UInt64

d= Source.CalculateDirectorySizeMBS(True,6,False,-1)
SizeÐPhysicalTotalSize
File_Folder_Info=SizeUnit(Size)+", "+Str(d.FilesCount)+"
fichiers, "+Str(d.FolderCount)+" dossiers"

Then File_Folder_Info is displayed in the GUI using a thread:

Window1.SizeCalc_Timer.Mode=Timer.ModeSingle

Could this be due to the DirectorySizeMBS function, or am I doing
something wrong?

TIA

Re: [MBS] DirectorySizeMBS crash c0000005?
Date: 27.01.15 13:55 (Tue, 27 Jan 2015 13:55:55 +0100)
From: Christian Schmitz

> Am 27.01.2015 um 11:33 schrieb Jean-Luc Arnaud <<email address removed>>:
>
>> Oh. Did you monitor app? Running out of memory?
> Yes, and it does not run out of memory (10 600 KB max used)

Okay. Is there something recursive? Did you try setting RecursionLimit to 5 or 10?
That could lead to an out of memory error on stack if it goes .

I'll improve that and detect reparse points and ignore them.

> In the doc, I found the "Close" function for DirectorySizeMBS. Tried it,
> unsuccessfully.

That is same as destructor.

> It seems like the plugin and this function modify something in memory,
> leading to an access violation more or less quickly after result is
> returned. The crash often appends as soon as I click on a button, but
> may happen with no user action (and no MBS plugin call).

We'll track it down.

I'll email you a new plugin, so we can verify the problem still exists in current code.

Sincerely
Christian

Re: [MBS] DirectorySizeMBS crash c0000005?
Date: 27.01.15 15:32 (Tue, 27 Jan 2015 15:32:29 +0100)
From: Jean-Luc Arnaud
> Okay. Is there something recursive?
I don't think so.
> Did you try setting RecursionLimit to 5 or 10?
Same result.

> I'll email you a new plugin, so we can verify the problem still exists in current code.
Same result too.

I have extracted code in a sample project. I will sent this to you (off
list).

Many thanks for your help.

Jean-Luc Arnaud

Le 27/01/2015 13:55, Christian Schmitz a écrit :
>> Am 27.01.2015 um 11:33 schrieb Jean-Luc Arnaud <<email address removed>>:
>>
>>> Oh. Did you monitor app? Running out of memory?
>> Yes, and it does not run out of memory (10 600 KB max used)
> Okay. Is there something recursive? Did you try setting RecursionLimit to 5 or 10?
> That could lead to an out of memory error on stack if it goes .
>
> I'll improve that and detect reparse points and ignore them.
>
>> In the doc, I found the "Close" function for DirectorySizeMBS. Tried it,
>> unsuccessfully.
> That is same as destructor.
>
>> It seems like the plugin and this function modify something in memory,
>> leading to an access violation more or less quickly after result is
>> returned. The crash often appends as soon as I click on a button, but
>> may happen with no user action (and no MBS plugin call).
> We'll track it down.
>
> I'll email you a new plugin, so we can verify the problem still exists in current code.
>
> Sincerely
> Christian
>

_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] DirectorySizeMBS crash c0000005?
Date: 26.01.15 19:14 (Mon, 26 Jan 2015 19:14:24 +0100)
From: Christian Schmitz

> Hi all,
>
> Using DirectorySizeMBS as shown in the MBS doc, I get the size of my
> data folder, and then (5-10 seconds later), my app crashes with a
> c0000005 code (Access Violation).

Oh. Did you monitor app? Running out of memory?

> d= Source.CalculateDirectorySizeMBS(True,6,False,-1)

Did you try with maybe 2 instead of -1?

> Could this be due to the DirectorySizeMBS function, or am I doing
> something wrong?

you could write a debug message before and after the Calculate call to see if it happens while plugin is running.

Sincerely
Christian

Re: [MBS] DirectorySizeMBS crash c0000005?
Date: 27.01.15 11:33 (Tue, 27 Jan 2015 11:33:51 +0100)
From: Jean-Luc Arnaud
> Oh. Did you monitor app? Running out of memory?
Yes, and it does not run out of memory (10 600 KB max used)

> Did you try with maybe 2 instead of -1?
Tried, but still crashing. In addition, I need to calculate all levels
of subfolders.

> you could write a debug message before and after the Calculate call to see if it happens while plugin is running.
In the doc, I found the "Close" function for DirectorySizeMBS. Tried it,
unsuccessfully.
Tried to change the ticks parameter of the CalculateDirectorySizeMBS,
tried to set up the Yieldticks parameter, tried to use the class inside
and outside a thread. What I noticed is that modifying ticks or
Yieldticks parameters changes the delay before crash.
And before crashing, the thread was stopped (when in a thread).

It seems like the plugin and this function modify something in memory,
leading to an access violation more or less quickly after result is
returned. The crash often appends as soon as I click on a button, but
may happen with no user action (and no MBS plugin call).

What could I do to solve this issue?

Jean-Luc Arnaud

Le 26/01/2015 19:14, Christian Schmitz a écrit :
>> Hi all,
>>
>> Using DirectorySizeMBS as shown in the MBS doc, I get the size of my
>> data folder, and then (5-10 seconds later), my app crashes with a
>> c0000005 code (Access Violation).
> Oh. Did you monitor app? Running out of memory?
>
>> d= Source.CalculateDirectorySizeMBS(True,6,False,-1)
> Did you try with maybe 2 instead of -1?
>
>> Could this be due to the DirectorySizeMBS function, or am I doing
>> something wrong?
> you could write a debug message before and after the Calculate call to see if it happens while plugin is running.
>
> Sincerely
> Christian
>

_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info