L4Android kernel didn't intialize L4 stack for the server thread.

"Mai, Haohui" <[email protected]>
Newsgroups gmane.comp.micro-kernel.l4.devel
Message-ID <CAKT8GbvNY5m7s6HDUOray0ufW7tu4vYWnh=OBCSLBuxWZsqDWA@mail.gmail.com>
Hi,

It seems that I found a bug in the latest version of L4Android kernel. I'm
familiar enough with the code base so your comments are highly appreciated.

The main thread for L4Linux (i.e., the thread running l4x_server_loop())
didn't initialize l4x_stack before execution. Therefore, this thread
crashes whenever it calls cli() / sti().

Calling vmalloc() and kmalloc() can reproduce this bug reliably. Here is a
patch to fix this problem.

~Haohui

--- a/arch/l4/kernel/main.c
+++ b/arch/l4/kernel/main.c
@@ -2501,6 +2501,8 @@ int __init_refok L4_CV main(int argc, char **argv)
         * for these areas so far */
        //l4x_register_pointer_section(&_edata, 0, "data");

+       l4x_stack_setup(current_thread_info(), l4_utcb(), 0);
+
        /* Send start message to main thread. */
        l4_ipc_send(l4lx_thread_get_cap(main_id),
                    l4_utcb(), l4_msgtag(0, 0, 0, 0), L4_IPC_NEVER);

_______________________________________________
l4-hackers mailing list
[email protected]
http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
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.