Quoth Juergen Pfeiffer:
>I'm using Linux Kernel 2.6.10 for Coldfire 5485 in an embedded 
>application.
>I developped my own device-driver (Profibus), working on the internal 
>UART of the coldfire.
[...]
Now i have the situation, that when i try to start some user program like 
>"ls" or "ps" ... out of an interactive bash, sometimes i get a message 
>"Segmentation fault" and the program isn't started. Then i try again and 
>this time it works.
[...]
>I deactivated my driver and (bad world) no problem anymore.
>
>So my question is:
>How can an error inside a device driver produce problems in starting 
>user programs?

On !MMU systems there is no memory protection between processes or between
kernel and user space.  So if a driver is randomly stomping over memory
supposedly in user space then it will break things.  Another possibility is
just that you're running out of RAM, or that it's becoming too fragmented,
since kernel and userspace use the same memory pools.

You'll need to carefully go over the code in your driver, looking not just
at the allocations, but also the deallocations and use of pointers.  In
particular look for cases where you're potentially accessing a pointer after
it has been deallocated, or accessing beyond the bounds of a buffer
allocation.  Also watch out for race conditions and similar concurrency
issues (remember that the kernel is potentially reentrant in many places).


_______________________________________________
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

Reply via email to