From: Richard Weinberger Subject: [RFC PATCH] cobalt: Allow tasks with non-locked memory Date: Wed, 29 May 2019 23:05:59 +0200 Message-Id: <20190529210559.20860-1-richard@nod.at> List-Id: Discussions about the Xenomai project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: xenomai@xenomai.org Cc: Richard Weinberger libsanitizer intercepts mlockall() and makes it a nop. Handle this case here to allow debugging Xenomai applications with ASAN and friends. While fixing Linux or libsanitizer would be the prettiest approach, making cobalt less strict regarding VM_LOCKED is the most practical way to get libsanitizer work with Xenomai. Signed-off-by: Richard Weinberger --- Hi! I'm using a variant of this patch to utilize ASAN/UBSAN to test in-house Xenomai applications. libsanitizer seems do disable mlockall() due to a Linux bug: https://github.com/gcc-mirror/gcc/blob/master/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc#L5982 Thanks, //richard --- kernel/cobalt/posix/process.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/kernel/cobalt/posix/process.c b/kernel/cobalt/posix/process.c index 6b10abb699d5..86ceac826ae0 100644 --- a/kernel/cobalt/posix/process.c +++ b/kernel/cobalt/posix/process.c @@ -579,11 +579,9 @@ static inline int disable_ondemand_memory(void) siginfo_t si; if ((p->mm->def_flags & VM_LOCKED) == 0) { - memset(&si, 0, sizeof(si)); - si.si_signo = SIGDEBUG; - si.si_code = SI_QUEUE; - si.si_int = SIGDEBUG_NOMLOCK | sigdebug_marker; - send_sig_info(SIGDEBUG, &si, p); + printk(XENO_WARNING + "%s[%d] Task without VM_LOCKED, latencies expected!\n", + current->comm, task_pid_nr(current)); return 0; } -- 2.16.4