-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 16.09.2014 15:26, Valentin Hauner wrote:
Hi,
thanks, I've used addr2line and found out that it was the head of thread_func (l. 27 in examples/libedft-example/main.c). So it seems that the stack I'm using for passing arguments to the thread function is the problem. As I am creating a dynamic number of threads, it does not make sense for me to create the stack object(s) statically as you guys do it in examples/sys/utcb-ipc/main.c. So until now, I've allocated memory on the _heap_ with malloc for each thread stack (l. 61 in lib/src/edft.c).
Just to be sure: How large is this per-thread stack? Are you properly aligning it to page boundaries? Otherwise you might miss mapping some parts of the stack. (Mappings always base on hardware memory pages, that's why your stack should be a multiple of a page size large and start at an address that is the start of a page.)
But after creating 4 stacks for 4 example threads statically similiar to the utcb-ipc example, the page fault at 0x1000200 is gone.
It's a bad idea to figure this out before you fix the previous problem. Let's keep complexity low.
Bjoern - -- Dipl.-Inf. Bjoern Doebel Mail: doebel@tudos.org TU Dresden, OS Chair Phone: +49 351 463 38 799 Noethnitzer Str. 46 Fax: +49 351 463 38 284 01187 Dresden, Germany WWW: http://www.tudos.org/~doebel - -- "When the seagulls follow the trawler, it's because they think sardines will be thrown into the sea." (Eric Cantona)