All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] mlockall error after calling mlockall()
@ 2010-02-25 21:12 Charlton, John
  2010-02-25 21:25 ` Gilles Chanteperdrix
  2010-02-25 21:38 ` Jan Kiszka
  0 siblings, 2 replies; 31+ messages in thread
From: Charlton, John @ 2010-02-25 21:12 UTC (permalink / raw)
  To: xenomai

[-- Attachment #1: Type: text/plain, Size: 1876 bytes --]

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


--John



[-- Attachment #2: Type: text/html, Size: 3408 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2010-03-02 14:05 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-25 21:12 [Xenomai-help] mlockall error after calling mlockall() Charlton, John
2010-02-25 21:25 ` Gilles Chanteperdrix
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

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.