Skip to contentSkip to conversation

unable to load nucleus module: unknown symbol

Xenomai-help Jeff Weber 2 participants 2 messages Oct 30, 2009 – Nov 5, 2009 Generic include/asm header files

lore
Share & tools
lore

Jeff Weber

author
#0 lore raw

I've built the xeno_nucleus as a module. Neither depmod, nor modprobe can resolve the symbol "find_task_by_pid_ns":

depmod:
WARNING:
/lib/modules/2.6.31.5-xenomai-2.4.10/kernel/kernel/xenomai/nucleus/xeno_nucleus.ko needs unknown symbol find_task_by_pid_ns

modprobe [dmesg]:

[  426.728630] xeno_nucleus: Unknown symbol find_task_by_pid_ns

Curiously, this symbol is in both my build System.map, and the kernel

bash # grep find_task_by_pid_ns System.map
c102ecf6 T find_task_by_pid_ns

bash # cat /proc/kallsyms | grep find_task_by_pid_ns c102ecf6 T find_task_by_pid_ns

so this symbol should be publicly available. I also noticed there is no EXPORT_SYMBOL() for find_task_by_pid_ns in the kernel code.

Any ideas what's keeping my xeno_nucleus.ko module from loading?

My config:
linux-2.6.31.5 (current stable)
xenomai-2.4.10
adeos-ipipe-2.6.31.1-x86-2.4-06.patch

thanks,
Jeff
“This e-mail message and any attachments are confidential and may be privileged. If you are not the intended recipient please notify American Superconductor Corporation immediately by replying to this message or by sending a message to [email protected] and destroy all copies of this message and any attachments.
Thank you.”

#1 lore raw
Quoted 22 lines · Jeff Weber

I've built the xeno_nucleus as a module. Neither depmod, nor modprobe can resolve the symbol "find_task_by_pid_ns":

depmod:
WARNING:
/lib/modules/2.6.31.5-xenomai-2.4.10/kernel/kernel/xenomai/nucleus/xeno_nucleus.ko needs unknown symbol find_task_by_pid_ns

modprobe [dmesg]:

[  426.728630] xeno_nucleus: Unknown symbol find_task_by_pid_ns

Curiously, this symbol is in both my build System.map, and the kernel

bash # grep find_task_by_pid_ns System.map
c102ecf6 T find_task_by_pid_ns

bash # cat /proc/kallsyms | grep find_task_by_pid_ns c102ecf6 T find_task_by_pid_ns

so this symbol should be publicly available. I also noticed there is no EXPORT_SYMBOL() for find_task_by_pid_ns in the kernel code.

Quoted 6 lines

Any ideas what's keeping my xeno_nucleus.ko module from loading?

My config:
linux-2.6.31.5 (current stable)
xenomai-2.4.10
adeos-ipipe-2.6.31.1-x86-2.4-06.patch

Please note that 2.6.31 is not officially supported by 2.4.x; at least, not for all architectures. 2.5.x supports 2.6.31 and beyond.

Aside of this, the missing symbol is no more exported by 2.6.31 albeit it used to be in 2.6.30. I guess that most people compile the nucleus statically inside the kernel, so this has not been noticed before.

include/asm-generic/wrappers.h +10 -2
index 18af70b..62f1d6e 100644
@@ -480,8 +480,16 @@ unsigned long find_next_bit(const unsigned long *addr,
 #include <linux/semaphore.h>
 #include <linux/pid.h>
 
-#define find_task_by_pid(nr)		\
-  find_task_by_pid_ns(nr, &init_pid_ns)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31)
+static inline struct task_struct *wrap_find_task_by_pid(pid_t nr)
+{
+	return pid_task(find_pid_ns(nr, &init_pid_ns), PIDTYPE_PID);
+}
+#else /* LINUX_VERSION_CODE < 2.6.31 */
+#define wrap_find_task_by_pid(nr)	\
+	find_task_by_pid_ns(nr, &init_pid_ns)
+#endif /* LINUX_VERSION_CODE < 2.6.31 */
+
 #define kill_proc(pid, sig, priv)	\
   kill_proc_info(sig, (priv) ? SEND_SIG_PRIV : SEND_SIG_NOINFO, pid)
 
ksrc/nucleus/shadow.c +1 -1
index d6d1203..1eae0a1 100644
@@ -1687,7 +1687,7 @@ void xnshadow_signal_completion(xncompletion_t __user *u_completion, int err)
 
 	read_lock(&tasklist_lock);
 
-	p = find_task_by_pid(completion.pid);
+	p = wrap_find_task_by_pid(completion.pid);
 
 	if (p)
 		wake_up_process(p);
Quoted 14 lines

thanks,
Jeff
“This e-mail message and any attachments are confidential and may be privileged. If you are not the intended recipient please notify American Superconductor Corporation immediately by replying to this message or by sending a message to [email protected] and destroy all copies of this message and any attachments.
Thank you.”

_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

Signature · 1 line
Philippe.