Re: g++, strange behavior issues

Steve deRosier <[email protected]>
Newsgroups gmane.linux.uclinux.devel
Message-ID <CALLGbRLk_SjyrT7eznU9E83=Qv7JQ2KbsNYV8ZmiwUREfEHdUw@mail.gmail.com>
Also there's macros in Linux that return/test for errors via setting
pointers to values < 4096.  Because "these addresses are NEVER valid".
;) Not sure how uCLinux deals with this, other than people avoiding
putting valid memory address near 0.

Just another challenge with micros.

On Thu, Feb 13, 2014 at 12:37 AM, Angelo Dureghello <[email protected]> wrote:
> That was exactly my case, a null pointer, and ram starts from 0x0 in the map
> :).
> I will keep in mind this thing for the future.
>
> Still thanks.
>
> Regards
> Angelo
>
>
> On 13/02/2014 03:29, Gavin Lambert wrote:
>>
>> Quoth Larry Baker:
>>>
>>> Yes, this is indeed what can happen on a system like uClinux that does
>>> not have an MMU (memory management unit).  The tiny controller chips
>>> that uClinux targets do not protect any part of the memory from being
>>> accidentally corrupted.  As long as the memory being accessed exists,
>>> there is no hardware fence between a user program and the rest of memory.
>>
>> It's especially fun when address 0 is valid memory (which is not
>> uncommon).
>> Then you don't get crashes from null pointer accesses, which most
>> developers
>> expect (and some can be lazy about protecting against, thinking that
>> they'll
>> find it during debugging).
>>
>> I always try to configure the target device's memory map such that
>> addresses
>> near 0 remain invalid, whenever possible -- but some targets don't support
>> that.
>>
>>
>
> _______________________________________________
> uClinux-dev mailing list
> [email protected]
> http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
> This message was resent by [email protected]
> To unsubscribe see:
> http://mailman.uclinux.org/mailman/options/uclinux-dev
_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev
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.