All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephan Zimmermann <s.zimmermann@domain.hid>
To: xenomai@xenomai.org
Subject: [Xenomai-help] system freeze with 2.3.x latest svn
Date: Wed, 07 Feb 2007 15:58:21 +0100	[thread overview]
Message-ID: <45C9E90D.2050307@domain.hid> (raw)

Hello,
I get the following message and a completely frozen system when I run my
applications after upgrading to branches/v2.3.x  rev. 2137. (Everything 
worked fine on revision 2077)

'Xenomai: fatal: re-enqueuing a relaxed thread in the RPI queue'

Maybe I did s.th. stupid again?

I did 'svn -r 2137 up' in the source directory and recompiled 
everything (kernel, xenomai, my application). It's a AMD-X2 with Kernel 
2.6.17.14, running Debian Sarge. My colleague tells me he saw the same 
when experimenting with trunk.

some additional infos:

'svn info' gives me:
------------------------------------------------------------------
linux1:~/xenomai_svn_test/xenomai$ svn info
Pfad: .
URL: http://svn.gna.org/svn/xenomai/branches/v2.3.x
UUID des Projektarchivs: c6d672ea-8702-0410-b560-f74c916a59fe
Revision: 2137
Knotentyp: Verzeichnis
Plan: normal
Letzter Autor: rpm
Letzte geänderte Rev: 2137
Letztes Änderungsdatum: 2007-02-07 12:13:48 +0100 (Mi, 07 Feb 2007)
Eigenschaften zuletzt geändert: 2007-01-22 13:20:30 +0100 (Mo, 22 Jan 2007)


the following code leads to the crash, shortly after entering main():
--------------------------------------------------------------------
#include <iostream>
#include <sys/mman.h>
#include <assert.h>
#include "native/task.h"
#include "native/timer.h"
#include "native/queue.h"
#include "native/intr.h"

#include <sys/io.h>

RT_TASK maintask;
RT_TASK inttask;
RT_TASK intcreatortask;

#define LPT_BASE	0x378
#define LPT_INT		7

bool finish = false;

void int_task(void* cookie){
	int err = 0;
	int counter = 0;
	RT_INTR lptint;
	
	err = rt_intr_create(&lptint,"parp_int",7,0);
	std::cout << "interrupt create:" << err << std::endl;
	
	err = rt_intr_enable(&lptint);
	std::cout << "interrupt enable:" << err << std::endl;
	
	// switch int mode on
	outb_p(0x10, LPT_BASE + 2);
	
	// all pins = 0
	outb_p(0x00, LPT_BASE );
	
	while(!finish){
		err = rt_intr_wait(&lptint, 100);
		if(err >= 0 ){
			counter++;
			std::cout << "got " << err << " loop: " << counter << std::endl;
		}
	}
	
	err = rt_intr_disable(&lptint);
	std::cout << "interrupt disable:" << err << std::endl;
	
	err = rt_intr_delete(&lptint);
	std::cout << "interrupt delete:" << err << std::endl;
}

void int_creator_task(void* cookie){
	char ob = 0x00;
	for(int i = 0; i < 1000; i++){	
		rt_task_sleep(100);
		outb_p(ob,LPT_BASE);
		if(ob){
			ob = 0x00;
		}else{
			ob = 0xFF;
		}
	}
	finish = true;
}

int main(void){
	int err;
	
	std::cout << "xenomai interrupt test" << std::endl;
	mlockall(MCL_CURRENT | MCL_FUTURE);
	
	if (iopl(3)) {
		printf("iopl err\n");
		exit(1);
	}
	
	err = rt_task_shadow (&maintask,"maintask",10,0);
	std::cout << "task shadow:" << err << std::endl;
	
	err = rt_timer_set_mode(1000000);
	std::cout << "timer set mode:" << err << std::endl;
	
	rt_task_spawn(&inttask,"interrupt-task",1024,50,T_JOINABLE,int_task,NULL);
	
	rt_task_spawn(&intcreatortask,"interrupt-creator-task",1024,50,T_JOINABLE,int_creator_task,NULL);
	
	rt_task_join(&intcreatortask);
	rt_task_join(&inttask);
	
	std::cout << "task's finished, exiting" << std::endl;
	
	return 0;
}



             reply	other threads:[~2007-02-07 14:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-07 14:58 Stephan Zimmermann [this message]
2007-02-07 15:12 ` [Xenomai-help] system freeze with 2.3.x latest svn Philippe Gerum
2007-02-07 15:46   ` Stephan Zimmermann

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=45C9E90D.2050307@domain.hid \
    --to=s.zimmermann@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.