Re: Huge numbers for incr passed to _sbrk

Freddie Chopin <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
On Thu, 2018-08-23 at 10:22 -0700, Michael Mamic wrote:
> I did not receive that email, but I have followed it's advice and
> updated
> the syscalls file. I still have the same error as before.
> 
> A similar incr value of huge proportions is passed to sbrk when Lua
> is
> initialized. I need to find out why this is happening so I can adjust
> for
> it.

I think you have a problem elsewhere. For example in here you use
f_write() function from FatFS in a wrong way:

https://github.com/Mikestylz/CirnOS/blob/master/syscalls.c#L48

The pointer you pass as the last argument should always be valid, as an
example see here:

http://elm-chan.org/fsw/ff/doc/open.html

FatFS does absolutely no error checking on this pointer and will
happily write to NULL. The second issue is that the value you return
from your _write() will also be extremely wrong, as you just happen to
return a value that is available from address NULL... I there are more
problems like this in the code, then basically anything can happen.

Regards,
FCh
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.