All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfgang Grandegger <wg@domain.hid>
To: niklaus.giger@domain.hid
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-core] Bug in taskSuspend for user mode vxworks
Date: Sat, 28 Oct 2006 20:36:11 +0200	[thread overview]
Message-ID: <4543A31B.1000500@domain.hid> (raw)
In-Reply-To: <200610281940.10654.niklaus.giger@domain.hid>

Niklaus Giger wrote:
> Am Samstag, 28. Oktober 2006 14:54 schrieb Niklaus Giger:
>> Am Freitag, 27. Oktober 2006 18:38 schrieb Philippe Gerum:
>>> On Wed, 2006-10-25 at 23:46 +0200, Niklaus Giger wrote:
>>>> Hi
>>>>
>>>> While trying to make a small demo app for Xenomai's registry I stumbled
>>>> about the following bug of the vxWorks skin.
>>>>
>>>> taskSuspend provokes (sometimes) a switch to the secondary mode, e.g.
>>>> the
>>>>
>>>> output of the attached demo gives:
>>>>>  reg_demo &
>>>>> ~ $ Xenomai: Switching ConsumerTask to secondary mode after exception
>>>>> #1025
>>> This is the same issue that you raised back then, and that we did not
>>> fix yet:
>>> https://mail.gna.org/public/xenomai-core/2006-09/msg00177.html
>>>
>>> #1025 looks like being an ISI exception due to some unmapped memory
>>> being referred to. You mentioned CONFIG_XENO_OPT_DEBUG as possibly being
>>> part of the problem/solution; could you check whether this error still
>>> occurs when this option is disabled in the nucleus?
>> I recompiled the kernel with CONFIG_XENO_OPT_DEBUG disabled and the error
>> went away.
> Actually I think the problem did not go away, as I did see that 
> in /proc/xenomai/faults the following error is incremented when I call the 
> attache simple program.
> TRAP         CPU0
>   0:            5    (Data or instruction access)
> (Btw which exception is it attached on a PPC405 system?)
> 
> Here is the stack trace of the simplified example attached as seen by the BDI 
> with a hardware breakpoint at 0x300
> #0  0x00000300 in ?? ()
> No symbol table info available.
> #1  0x100b8c48 in ?? ()
> No symbol table info available.
> #2  0x100b8c48 in ?? ()
> No symbol table info available.
> Previous frame inner to this frame (corrupt stack?)
> (gdb)                                     
> 
> Setting a breakpoint at xnpod_fault_handler and a full backtrace gives me 
> (gdb) bt full
> #0  xnpod_fault_handler (fltinfo=0xc1839e18) 
> at /mnt/data.ng/hcu/kernel/ppc/linux-2.6.14/include/asm-generic/xenomai/system.h:200
>         thread = (xnthread_t *) 0xc0214f40
> #1  0xc0048e90 in xnpod_trap_fault (fltinfo=0xc1839e18) 
> at /mnt/data.ng/hcu/kernel/ppc/linux-2.6.14/kernel/xenomai/nucleus/pod.c:2907
> No locals.
> #2  0xc00438f4 in xnarch_trap_fault (event=3246628376, domid=1480937039, 
> data=0xc1839f50) at include2/asm/xenomai/bits/init.h:46
>         fltinfo = {exception = 0, regs = 0xc1839f50}
> #3  0xc011ffb8 in exception_event (event=3221520296, ipd=0x58454e4f, 
> data=0xc1839f50)
>     at /mnt/data.ng/hcu/kernel/ppc/linux-2.6.14/arch/ppc/xenomai/hal.c:385
> No locals.
> #4  0xc003fecc in __ipipe_dispatch_event (event=0, data=0xc1839f50) 
> at /mnt/data.ng/hcu/kernel/ppc/linux-2.6.14/kernel/ipipe/core.c:668
>         start_domain = (struct ipipe_domain *) 0xc0214f40
>         this_domain = (struct ipipe_domain *) 0xc0214f40
>         evhand = (ipipe_event_handler_t) 0xc0048e90 <xnpod_trap_fault+100>
>         pos = (struct list_head *) 0xc0214f40
>         npos = (struct list_head *) 0xc01c6540
>         flags = 167984
>         propagate = 1
> #5  0xc000b02c in do_page_fault (regs=0xc1839f50, address=266719224, 
> error_code=0)
>     at /mnt/data.ng/hcu/kernel/ppc/linux-2.6.14/arch/ppc/mm/fault.c:119
>         vma = (struct vm_area_struct *) 0xff86120
>         mm = (struct mm_struct *) 0xc0200260
>         info = {si_signo = 1, si_errno = -1071644672, si_code = -1071579136, 
> _sifields = {_pad = {0, -1048338784, -1048338608,
>       -1071554848, -1070595192, -1048338768, -1073423884, -1048338608, -1070595192, -1048338752, -1073422700, 
> 0, 1, -1048338704,
>       -1073418440, -1071710208, 14, 1, -1071733764, -1071710208, -1071880896, 
> 167984, 0, 16384, -1071880896, -1048338640, -1073479988,
>       0, 0}, _kill = {_pid = 0, _uid = 3246628512}, _timer = {_tid = 0, 
> _overrun = -1048338784,
>       _pad = 
> 0xc1839e94 "Á\203\237PÀ!^àÀ0\003\210Á\203\236°À\004ÙôÁ\203\237PÀ0\003\210Á\203\236ÀÀ\004Þ\224", 
> _sigval = {
>         sival_int = -1048338608, sival_ptr = 0xc1839f50}, _sys_private 
> = -1071554848}, _rt = {_pid = 0, _uid = 3246628512, _sigval = {
>         sival_int = -1048338608, sival_ptr = 0xc1839f50}}, _sigchld = {_pid = 
> 0, _uid = 3246628512, _status = -1048338608,
>       _utime = -1071554848, _stime = -1070595192}, _sigfault = {_addr = 0x0}, 
> _sigpoll = {_band = 0, _fd = -1048338784}}}
>         code = 196609
>         is_write = 0
>         __func__ = "do_page_fault"
> #6  0xc0003258 in handle_page_fault ()
> No locals.
> (gdb)   
> 
> But I think it has something to do with my toolchain/compiler or my root file 
> system setup. I just found out, that compiling it with the same gcc 3.4 
> compiler for my PowerBook and linking it statically the error got away.

My impression from our last discussion was that your toolchain is 
somehow broken as I was unable to reproduce your problems on (almost) 
the same hardware

> I think I really have to reactivate my old Walnut board to have common 
> platform to test with Wolfgang Grandegger.

It would make more sense to use the ELDK4 for comparison. I don't think 
it depends on the hardware.

Wolfgang.

> 
> 
> ------------------------------------------------------------------------
> 
> /*
>  * Copyright (C) 2006 Niklaus Giger <niklaus.giger@domain.hid>.
>  *
>  * VxWorks is a registered trademark of Wind River Systems, Inc.
>  *
>  * This program is free software; you can redistribute it and/or
>  * modify it under the terms of the GNU General Public License as
>  * published by the Free Software Foundation; either version 2 of the
>  * License, or (at your option) any later version.
>  *
>  * This program is distributed in the hope that it will be useful,
>  * but WITHOUT ANY WARRANTY; without even the implied warranty of
>  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>  * GNU General Public License for more details.
>  *
>  * You should have received a copy of the GNU General Public License
>  * along with this program; if not, write to the Free Software
>  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
>  */
> 
> #include <vxworks/vxworks.h>
> 
> #define ROOT_TASK_PRI        100
> #define ROOT_STACK_SIZE      32*1024
> 
> int root_thread_init(void);
> void root_thread_exit(void);
> 
> #if !defined(__KERNEL__) && !defined(__XENO_SIM__)
> 
> #include <sys/mman.h>
> #include <stdlib.h>
> #include <stdio.h>
> #include <unistd.h>
> 
> #define MODULE_LICENSE(x)
> 
> #define xnprintf printf
> 
> int main (int argc, char *argv[])
> {
>     int tid;
>     mlockall(MCL_CURRENT|MCL_FUTURE);
> 
>     tid = taskSpawn("RootTask",
> 		    ROOT_TASK_PRI,
> 		    0,
> 		    ROOT_STACK_SIZE,
> 		    (FUNCPTR)&root_thread_init,
> 		    0,0,0,0,0,0,0,0,0,0);
>     if (tid)
> 	pause();
> 
>     return 0;
> }
> 
> #endif /* Native, user-space execution */
> 
> MODULE_LICENSE("GPL");
> 
> int root_thread_init (void)
> {
>     printf("\nroot_thread_init 3\n");
>     exit(0);
>     return 0;
> }
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Xenomai-core mailing list
> Xenomai-core@domain.hid
> https://mail.gna.org/listinfo/xenomai-core



  parent reply	other threads:[~2006-10-28 18:36 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-25 21:46 [Xenomai-core] Bug in taskSuspend for user mode vxworks Niklaus Giger
2006-10-27 16:38 ` Philippe Gerum
2006-10-28 12:54   ` Niklaus Giger
2006-10-28 17:16     ` Philippe Gerum
2006-10-28 17:40     ` Niklaus Giger
2006-10-28 18:00       ` Philippe Gerum
2006-10-28 18:28         ` Niklaus Giger
2006-10-28 18:03       ` Philippe Gerum
2006-10-28 18:36       ` Wolfgang Grandegger [this message]
2006-10-29 21:02         ` Niklaus Giger
2006-10-29 21:15           ` Philippe Gerum
2006-10-30  7:31           ` Wolfgang Grandegger
2006-10-30  7:09             ` Niklaus Giger
2006-10-31  8:14               ` Wolfgang Grandegger
2006-10-31 18:51                 ` Niklaus Giger
2006-10-31 19:02                   ` Wolfgang Grandegger
2006-10-31 19:17                     ` Niklaus Giger
2006-10-31 20:07                   ` Wolfgang Grandegger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4543A31B.1000500@domain.hid \
    --to=wg@domain.hid \
    --cc=niklaus.giger@domain.hid \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.