NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

port-amd64/40091: compat_linux32 module loading = panic due to missing syms



>Number:         40091
>Category:       port-amd64
>Synopsis:       compat_linux32 module loading = panic due to missing syms
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    port-amd64-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 03 04:15:00 +0000 2008
>Originator:     Juan RP
>Release:        Latest
>Organization:
>Environment:
Linux sasha 2.6.27-10-generic #1 SMP Fri Nov 21 19:19:18 UTC 2008 x86_64 
GNU/Linux
>Description:
So I wanted to build perl-5.10.0 from pkgsrc and I've been surprised
because the machine paniced. it was autoloading some compat
modules due to some test in the configure script.

The list of missing symbols was something like:

* a bunch of netbsd32_* syscalls
* linux_sys_old_mmap
* linux_elf32_debuglink_signature
* linux_elf32_signature

Obviously compat_linux32 needs to depend on compat_netbsd32 module,
don't you think?

The patch sorts the amd64 MD files into its correct block, adds
missing files required to resolve missing symbols and adds the missing
compat_netbsd32 module dependency; even more interesting is that HFIW. 
>How-To-Repeat:
modload compat_linux32 -> panic
>Fix:
Index: modules/compat_linux32/Makefile
===================================================================
RCS file: /cvsroot/src/sys/modules/compat_linux32/Makefile,v
retrieving revision 1.2
diff -b -u -p -r1.2 Makefile
--- modules/compat_linux32/Makefile     21 Nov 2008 10:04:58 -0000 1.2
+++ modules/compat_linux32/Makefile     3 Dec 2008 03:45:14 -0000
@@ -10,19 +10,22 @@ CPPFLAGS+=  -DCOMPAT_LINUX32 -DCOMPAT_NET
 
 .PATH: ${S}/compat/linux32/common
 SRCS+= linux32_dirent.c linux32_exec.c linux32_exec_elf32.c linux32_fcntl.c
-SRCS+= linux32_ioctl.c linux32_ipccall.c linux32_misc.c linux32_mman.c
+SRCS+= linux32_ioctl.c linux32_misc.c linux32_mman.c
 SRCS+= linux32_mod.c linux32_resource.c linux32_sched.c linux32_signal.c
 SRCS+= linux32_socket.c linux32_socketcall.c linux32_stat.c linux32_sysctl.c
-SRCS+= linux32_sysinfo.c linux32_termios.c linux32_time.c linux32_uid16.c
+SRCS+= linux32_sysinfo.c linux32_termios.c linux32_time.c
 SRCS+= linux32_unistd.c linux32_utsname.c linux32_wait.c
 
 .if ${MACHINE} == "amd64"
-CPPFLAGS+=     -DEXEC_ELF32
+CPPFLAGS+=     -DEXEC_ELF32 -DLINUX32_DEBUGLINK_SIGNATURE
 .PATH: ${S}/compat/linux32/arch/amd64
 .PATH: ${S}/arch/amd64/amd64
 .PATH: ${S}/arch/x86/x86
-SRCS+= linux32_machdep.c linux32_syscalls.c linux32_sysent.c
-SRCS+= linux32_missing.c linux32_sigcode.S linux32_syscall.c
+SRCS+= linux32_ipccall.c linux32_machdep.c linux32_missing.c
+SRCS+= linux32_syscalls.c linux32_sysent.c linux32_sigcode.S
+SRCS+= linux32_syscall.c linux32_uid16.c
+.PATH: ${S}/compat/linux/common
+SRCS+= linux_oldmmap.c linux_exec_elf32.c
 .endif
 
 .include <bsd.kmodule.mk>
Index: compat/linux/common/linux_oldmmap.c
===================================================================
RCS file: /cvsroot/src/sys/compat/linux/common/linux_oldmmap.c,v
retrieving revision 1.70
diff -b -u -p -r1.70 linux_oldmmap.c
--- compat/linux/common/linux_oldmmap.c 18 Jun 2008 12:24:17 -0000 1.70
+++ compat/linux/common/linux_oldmmap.c 3 Dec 2008 03:45:15 -0000
@@ -52,6 +52,8 @@ __KERNEL_RCSID(0, "$NetBSD: linux_oldmma
 #include <compat/linux/common/linux_mmap.h>
 #include <compat/linux/common/linux_oldmmap.h>
 #include <compat/linux/common/linux_signal.h>
+#include <compat/linux/common/linux_ipc.h>
+#include <compat/linux/common/linux_sem.h>
 
 #include <compat/linux/linux_syscallargs.h>
 
Index: compat/linux32/common/linux32_mod.c
===================================================================
RCS file: /cvsroot/src/sys/compat/linux32/common/linux32_mod.c,v
retrieving revision 1.1
diff -b -u -p -r1.1 linux32_mod.c
--- compat/linux32/common/linux32_mod.c 19 Nov 2008 18:36:04 -0000 1.1
+++ compat/linux32/common/linux32_mod.c 3 Dec 2008 03:45:15 -0000
@@ -49,7 +49,7 @@ __KERNEL_RCSID(0, "$NetBSD: linux32_mod.
 #include <compat/linux32/common/linux32_exec.h>
 
 #if defined(EXEC_ELF32)
-# define       MD1     ",exec_elf32"
+# define       MD1     ",exec_elf32,compat_netbsd32"
 #else
 # define       MD1     ""
 #endif



Home | Main Index | Thread Index | Old Index