NetBSD Problem Report #40091

From www@NetBSD.org  Wed Dec  3 04:10:02 2008
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id ABA2563BD2D
	for <gnats-bugs@gnats.netbsd.org>; Wed,  3 Dec 2008 04:10:02 +0000 (UTC)
Message-Id: <20081203041002.50F9E63B8BD@narn.NetBSD.org>
Date: Wed,  3 Dec 2008 04:10:02 +0000 (UTC)
From: xtraeme@gmail.com
Reply-To: xtraeme@gmail.com
To: gnats-bugs@NetBSD.org
Subject: compat_linux32 module loading = panic due to missing syms
X-Send-Pr-Version: www-1.0

>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:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 03 04:15:00 +0000 2008
>Closed-Date:    Wed Dec 03 12:51:52 +0000 2008
>Last-Modified:  Wed Dec 03 12:55: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

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->closed
State-Changed-By: ad@NetBSD.org
State-Changed-When: Wed, 03 Dec 2008 12:51:52 +0000
State-Changed-Why:
Applied, thanks.
I guess the panic is because you can unload a required module that is actually in use.


From: Andrew Doran <ad@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/40091 CVS commit: src/sys
Date: Wed,  3 Dec 2008 12:51:11 +0000 (UTC)

 Module Name:	src
 Committed By:	ad
 Date:		Wed Dec  3 12:51:11 UTC 2008

 Modified Files:
 	src/sys/compat/linux/common: linux_oldmmap.c
 	src/sys/compat/linux32/common: linux32_mod.c
 	src/sys/modules/compat_linux32: Makefile

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


 To generate a diff of this commit:
 cvs rdiff -r1.70 -r1.71 src/sys/compat/linux/common/linux_oldmmap.c
 cvs rdiff -r1.1 -r1.2 src/sys/compat/linux32/common/linux32_mod.c
 cvs rdiff -r1.2 -r1.3 src/sys/modules/compat_linux32/Makefile

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.