Saturday, 14 July 2012

Re: [gccsdk] Possible crash with system() call

In message <SNT136-W5279A0B6274CE8B9DF1595F0D60@phx.gbl>
alan buckley <alan_baa@hotmail.com> wrote:

> I've been getting a mysterious crash and think I may have tracked
> it down to the use of a system() call. Unfortunatly I can't be sure
> as it messes up memory completely so the machine isn't in a
> stable state after the crash.
>
> It seems that if my Wimp task claims more memory after
> starting up and then calls:
>
> system("Filer_OpenDir a_directory");
>
> some sort of corruption occurs as after I close my next
> two windows a crash occurs.
>
> This is happening on my Iyonix RISC OS 5.16 128MB consistantly.
> Increasing the Wimp slot seems to fix the problem.
>
> However I can't reproduce it on RISC OS 4.0.2 or RISC OS 5.19
> running on RPCEmu.
>
> I haven't even managed to create a smaller test program to
> reproduce the problem, so it may be something else.
>
> I was hoping someone who is familiar with the system() call
> code could have a look at its code to see if there is some
> edge case I may be hitting.

As long as your program isn't corrupting the memory pool, you shouldn't
get such a crash as you're describing. It looks like if there is not
enough application memory free the system() implementation badly fails.
If that's the case it would be workwhile to get to the bottom of this
but as you can imagine we need a reproducable case because system()
implementation is quite complex.

Are you using the same WimpSlot size for reproducing on RO 4.02 and
RO 5.19 ? Make sure you're using (or not using) DA for reproducing as
well.

> [...]
> P.S. As an aside I'm wondering about using Wimp_StartTask
> instead of a system call and was wondering if anyone knew
> if that is sensible or not.

If your program is already a Wimp task, yes, I think you can use
Wimp_StartTask.

John.
--
John Tytgat, in his comfy chair at home BASS
John.Tytgat@aaug.net ARM powered, RISC OS driven

_______________________________________________
GCCSDK mailing list gcc@gccsdk.riscos.info
Bugzilla: http://www.riscos.info/bugzilla/index.cgi
List Info: http://www.riscos.info/mailman/listinfo/gcc
Main Page: http://www.riscos.info/index.php/GCCSDK

No comments:

Post a Comment