[EMAIL PROTECTED] wrote: > Hi, > running a simple test application which spawns a periodic task writing on a > serial interface > the system hangs performing the rt_dev_close. > The test program ran fine with xeno 2.2.6 with "Shared Interrupts" enabled, > so as with > xeno 2.3.1 with "Shared Interrupts" disabled. It fails with xeno 2.3.1 with > "Shared Interrupts" enabled, so the problem seems to be in the shared > interrupts handling area. > kernel is 2.6.20 adeos patched > > Any suggestion?
Argh, not good. Sounds like our IRQ detachment code is still racy.
>
> Many Thanks
>
> here follows the kernel dumps:
>
> BUG: unable to handle kernel NULL pointer dereference at virtual address
> 00000008
> printing eip:
> *pde = 00000000
> Oops: 0000 [#1]
> SMP
> Modules linked in: xeno_16550A ipv6 nfs lockd sunrpc ide_scsi i2c_i801
> i2c_core sg shpchp rng_core evdev ehci_hcd uhci_hcd intel
> _agp agpgart e1000 serio_raw pcspkr
> CPU: 0
> EIP: 0060: Not tainted VLI
> EFLAGS: 00010046 (2.6.20.1-xeno-2.3.1 #16)
> EIP is at xnintr_edge_shirq_handler+0xda/0x2f0
Do you know how to resolve this address into source code?
CONFIG_DEBUG_INFO needs to be on, "gdb vmlinux" and then "disassemble
xnintr_edge_shirq_handler" would give you that context. Please post the
full disassembly of that function. That may help us by pointing at the
variable that is causing the oops here.
> eax: 00000000 ebx: 00000000 ecx: f2d58074 edx: c0529080
> esi: c05290c0 edi: 69bfb728 ebp: 000000c9 esp: c04b9f08
> ds: 007b es: 007b ss: 0068
> I-pipe domain Xenomai
> Process modprobe (pid: 1876, ti=f7a44000 task=f7d7d030 task.ti=f7a44000)
> Stack: c047d100 c0487400 00000001 00000001 00000001 f2d58050 c0527a10
> c05293f8
> 00000004 c04fbc38 c051d100 00000004 00000000 c0143fa8 00000000 c047d100
> c051d100 c04fbc38 00000000 00000004 c0527400 c0112de2 c03bc88a 00000000
> Call Trace:
> __ipipe_dispatch_wired+0xdB/0x120
> __ipipe_handle_irq+0x72/0x2b0
> schedule+0x41a/0x880
> common_interrupt+0x21/0x38
> mwait_idle_with_hints+0x3f/0x50
> mwait_idle+0x0/0x10
> cpu_idle+0x6f/0x90
> start_kernel+0x1d0/0x240
> unknown_bootoption+0x0/0x190
> =======================
> Code: 03 00 00 89 f0 89 96 b4 03 00 00 8b 15 80 87 52 c0 29 d0 83 e8 40 c1
> f8 04 69 c0 ab aa aa aa 8d 44 18 24 87 86 b8 03 00 00
> 89 d9 <ff> 53 08 09 44 24 10 0f b6 d0 83 fa 02 0f 84 04 01 00 00 4a 0f
> EIP: xnintr_edge_shirq_handler+0xda/0x2f0 SS:ESP 0068:c04b9f08
> Kernel panic - not syncing: Attempted to kill the idle task!
>
> hardware:
> Intel Core DUO Processor Single Board Computer
>
> here follows the test application:
>
> #include <sys/types.h>
> #include <sys/stat.h>
> #include <fcntl.h>
> #include <stdio.h>
> #include <string.h>
> #include <unistd.h>
> #include <stdlib.h>
>
> #include <signal.h>
> #include <sys/mman.h>
>
> #include <native/task.h>
> #include <native/timer.h>
> #include <rtdm/rtserial.h>
>
> #define FALSE 0
> #define TRUE 1
> #define BAUDRATE B115200
>
> #define WRITE_FILE "rtser0"
>
> RT_TASK rt_writer_tid;
> int fd;
>
> static const struct rtser_config write_config = {
> 0xFFDF, /* config_mask */
> 115200, /* baud_rate */
> RTSER_DEF_PARITY, /* parity */
> RTSER_DEF_BITS, /* data_bits */
> RTSER_DEF_STOPB, /* stop_bits */
> RTSER_DEF_HAND, /* handshake */
> RTSER_DEF_FIFO_DEPTH, /* fifo_depth*/
> RTSER_DEF_TIMEOUT, /* rx_timeout */
> RTSER_DEF_TIMEOUT, /* tx_timeout */
> RTSER_DEF_TIMEOUT, /* event_timeout */
> RTSER_DEF_TIMESTAMP_HISTORY /* timestamp_history */
> };
>
> void rt_writer (void *cookie)
> {
> int error;
> int res;
> char* msg = "abrac";
> error = rt_task_set_periodic(NULL,
> TM_NOW,
> rt_timer_ns2ticks(32000000));
>
> for (;;) {
> error = rt_task_wait_period(NULL);
> res = rt_dev_write(fd, msg, strlen(msg));
>
> }
> }
>
>
> void cleanup_upon_sig(int sig __attribute__((unused)))
> {
>
>
> rt_dev_close(fd);
>
> exit(0);
> }
>
> int main(int argc, char** argv)
> {
> int error;
>
>
> mlockall(MCL_CURRENT|MCL_FUTURE);
>
> signal(SIGINT, cleanup_upon_sig);
> signal(SIGTERM, cleanup_upon_sig);
> signal(SIGHUP, cleanup_upon_sig);
> signal(SIGALRM, cleanup_upon_sig);
>
> fd = rt_dev_open(WRITE_FILE, 0);
> if (fd < 0) {
> perror(WRITE_FILE);
> cleanup_upon_sig(0);
> }
> error = rt_dev_ioctl(fd, RTSER_RTIOC_SET_CONFIG, &write_config);
> if (error) {
> printf("error while RTSER_RTIOC_SET_CONFIG, code %d\n",error);
> cleanup_upon_sig(0);
> }
>
> error = rt_task_spawn(&rt_writer_tid,"rt_writer",0,99,T_FPU,
> rt_writer, NULL);
> if (error) {
> printf("rt_task_spawn: code %d\n",error);
> return 2;
> }
> pause();
> exit(0);
>
> }
>
>
> Alessandro Pittaluga
>
> Alenia Aeronautica
> Avionic System Qualification
> Test Systems
> Corso Marche, 41
> 10146 Torino (Italy)
> Phone +39-011-756.2915
> +39-011-996.0714
> Fax +39-011-756.2517
>
>
Jan
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Xenomai-help mailing list [email protected] https://mail.gna.org/listinfo/xenomai-help
