All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: "Charlton, John" <john.charlton@domain.hid>
Cc: "xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: Re: [Xenomai-help] mlockall error after calling mlockall()
Date: Thu, 25 Feb 2010 22:25:46 +0100	[thread overview]
Message-ID: <4B86EADA.6080001@domain.hid> (raw)
In-Reply-To: <CF7FB0793253794F9F45991443E5FE2006483DE98C@us194mx002.tycoelectronics.net>

Charlton, John wrote:
> I have a xenomai application that runs without problems with
> xenomai-2.4.6.1/linux-2.6.27.7. When run under
> xenomai-2.5.1/linux-2.6.32.7 it fails with the warning: Xenomai:
> process memory not locked (missing mlockall?).  I verified that
> mlockall() is being called before any xenomai calls are made as
> follows with out error:
> 
> // lock process in memory for xenomai int err = mlockall(MCL_CURRENT
> | MCL_FUTURE); if (err) { fprintf(stderr, "TimerInit: mlockall failed
> to lock process into memory: %d\n", err); exit(1); } fprintf(stdout,
> "TimerInit: Locked process memory\n");
> 
> The relevant message in dmesg output is: Xenomai: watchdog triggered
> -- signaling runaway thread 'timerloop-2166'
> 
> This occurs when creating a native xenomai task (created by
> CanFestival library) with the following code with no errors:
> 
> void StartTimerLoop(TimerCallback_t _init_callback) { int ret = 0; 
> stop_timer = 0; init_callback = _init_callback;
> 
> char taskname[32]; snprintf(taskname, sizeof(taskname),
> "timerloop-%d", getpid());
> 
> printf("Starting timerloop task %s\n", taskname); /* create
> timerloop_task */ ret = rt_task_create(&timerloop_task, taskname, 0,
> 50, T_JOINABLE); if (ret) { printf("Failed to create timerloop_task,
> code %d\n",errno); return; }
> 
> /* start timerloop_task */ ret =
> rt_task_start(&timerloop_task,&timerloop_task_proc,NULL); if (ret) { 
> printf("Failed to start timerloop_task, code %u\n",errno); goto
> error; }
> 
> return;
> 
> error: cleanup_all(); }
> 
> Debug output is displayed from the timerloop_task indicating that the
> task starts, but the mlockall warning is displayed before those
> outputs and the application already begins to shut down.
> 
> xeno-test runs without errors.  The trivial_periodic application also
> compiles and runs without error

Please post a preferably simple, self-contained, compiling test case
which we can compile and run to reproduce the issue you are meeting.

The flags you pass to xenomai configure script and the command lines you
use when compiling the program also matter.

At first sight, your real problem is that your program has an infinite
loop in primary mode which causes the watchdog to trigger. Then, the
message printed gets it wrong. You can try and revert the commit
803ff2e093a4260054e1e9e59114bc4e656c84bd
to see if you get a more meaningful message.

-- 
					    Gilles.


  reply	other threads:[~2010-02-25 21:25 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-25 21:12 [Xenomai-help] mlockall error after calling mlockall() Charlton, John
2010-02-25 21:25 ` Gilles Chanteperdrix [this message]
2010-02-25 21:38 ` Jan Kiszka
2010-02-25 22:42   ` Jan Kiszka
2010-02-25 22:54     ` Gilles Chanteperdrix
2010-02-25 23:01       ` Jan Kiszka
2010-02-26 16:47         ` Charlton, John
2010-02-26 16:53           ` Gilles Chanteperdrix
2010-02-26 17:15             ` Charlton, John
2010-03-01 15:52             ` Charlton, John
2010-03-01 20:30               ` Charlton, John
2010-03-01 20:33                 ` Jan Kiszka
2010-03-01 20:38                   ` Gilles Chanteperdrix
2010-03-01 20:43                     ` Jan Kiszka
2010-03-01 20:46                       ` Jan Kiszka
2010-03-01 20:56                         ` Gilles Chanteperdrix
2010-03-01 21:00                           ` Gilles Chanteperdrix
2010-03-01 21:02                             ` Jan Kiszka
2010-03-01 21:06                               ` Jan Kiszka
2010-03-01 21:01                           ` Jan Kiszka
2010-03-01 21:05                             ` Gilles Chanteperdrix
2010-03-01 21:21                               ` Jan Kiszka
2010-03-01 21:25                                 ` Jan Kiszka
2010-03-01 21:39                                   ` Jan Kiszka
2010-03-01 21:45                                     ` Gilles Chanteperdrix
2010-03-02  8:29                                       ` Jan Kiszka
2010-03-02  8:36                                         ` Jan Kiszka
2010-03-01 21:53                                   ` Charlton, John
2010-03-02 13:26                                     ` Charlton, John
2010-03-02 14:05                                       ` Jan Kiszka
2010-03-01 20:30               ` Jan Kiszka

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=4B86EADA.6080001@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=john.charlton@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.