NetBSD Problem Report #26687
Received: (qmail 9204 invoked by uid 605); 16 Aug 2004 20:55:40 -0000
Message-Id: <20040816203153.EC52E54B23D@dogfish-head.cs.stevens-tech.edu>
Date: Mon, 16 Aug 2004 16:31:53 -0400 (EDT)
From: jschauma@netmeister.org
Sender: gnats-bugs-owner@NetBSD.org
Reply-To: jschauma@netmeister.org
To: gnats-bugs@gnats.NetBSD.org
Subject: linux emulation / matlab stopped working
X-Send-Pr-Version: 3.95
>Number: 26687
>Category: port-i386
>Synopsis: matlab stopped working - linux emulation?
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: jdolecek
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Aug 16 20:56:00 +0000 2004
>Closed-Date: Tue Sep 28 09:03:04 +0000 2004
>Last-Modified: Fri Oct 01 03:47:00 +0000 2004
>Originator: Jan Schaumann
>Release: NetBSD 2.0_BETA
>Organization:
>Environment:
System: NetBSD dogfish-head.cs.stevens-tech.edu 2.0_BETA NetBSD 2.0_BETA (BOCK) #17: Mon Aug 16 13:34:05 EDT 2004 jschauma@doppelbock.hpcf.cs.stevens-tech.edu:/share/src/sys/arch/i386/compile/obj/BOCK i386
Architecture: i386
Machine: i386
>Description:
matlab used to work under NetBSD 1.6U and newer, including the full
java desktop. Some time between 1.6U and 2.0_BETA, the linux emulation
seems to have changed in a way that now prevents matlab from
functioning in full desktop mode.
This is a serious regression and we should not ship NetBSD 2.0 unless
this has been fixed.
See threads on port-i386 and current-users:
http://mail-index.netbsd.org/port-i386/2004/05/14/0003.html
http://mail-index.netbsd.org/port-i386/2004/07/20/0014.html
http://mail-index.netbsd.org/current-users/2004/07/21/0002.html
...
>How-To-Repeat:
run matlab version 6.5 (R13) and notice that it either hangs the machine
or segfaults. R13 works if passed the '-nojvm' switch (ie in
console only mode).
run matlab version 7 (R14) and notice that it won't work at all.
Notice that Sun's JDK 1.4 *does* seem to work fine with other
applications, however. (For example, eclipse works fine.)
>Fix:
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: port-i386-maintainer->jdolecek
Responsible-Changed-By: jdolecek
Responsible-Changed-When: Sat Aug 21 01:08:12 UTC 2004
Responsible-Changed-Why:
I'm looking into this.
From: jdolecek@NetBSD.org (Jaromir Dolecek)
To: jschauma@netmeister.org
Cc: gnats-bugs@gnats.NetBSD.org
Subject: Re: port-i386/26687: linux emulation / matlab stopped working
Date: Sat, 21 Aug 2004 03:07:58 +0200 (CEST)
jschauma@netmeister.org wrote:
> System: NetBSD dogfish-head.cs.stevens-tech.edu 2.0_BETA NetBSD 2.0_BETA (BOCK) #17: Mon Aug 16 13:34:05 EDT 2004 jschauma@doppelbock.hpcf.cs.stevens-tech.edu:/share/src/sys/arch/i386/compile/obj/BOCK i386
>
> matlab used to work under NetBSD 1.6U and newer, including the full
> java desktop. Some time between 1.6U and 2.0_BETA, the linux emulation
> seems to have changed in a way that now prevents matlab from
> functioning in full desktop mode.
>
> This is a serious regression and we should not ship NetBSD 2.0 unless
> this has been fixed.
>
> See threads on port-i386 and current-users:
> http://mail-index.netbsd.org/port-i386/2004/05/14/0003.html
> http://mail-index.netbsd.org/port-i386/2004/07/20/0014.html
> http://mail-index.netbsd.org/current-users/2004/07/21/0002.html
> ...
Is this with the up-to-date 2.0_BETA kernel, including linux_misc.c
rev. 1.122.2.1?
Jaromir
> >How-To-Repeat:
> run matlab version 6.5 (R13) and notice that it either hangs the machine
> or segfaults. R13 works if passed the '-nojvm' switch (ie in
> console only mode).
>
> run matlab version 7 (R14) and notice that it won't work at all.
>
> Notice that Sun's JDK 1.4 *does* seem to work fine with other
> applications, however. (For example, eclipse works fine.)
--
Jaromir Dolecek <jdolecek@NetBSD.org> http://www.NetBSD.cz/
-=- We should be mindful of the potential goal, but as the Buddhist -=-
-=- masters say, ``You may notice during meditation that you -=-
-=- sometimes levitate or glow. Do not let this distract you.'' -=-
From: Jan Schaumann <jschauma@netmeister.org>
To: Jaromir Dolecek <jdolecek@NetBSD.org>
Cc: gnats-bugs@gnats.NetBSD.org
Subject: Re: port-i386/26687: linux emulation / matlab stopped working
Date: Fri, 20 Aug 2004 22:06:07 -0400
--tKW2IUtsqtDRztdT
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Jaromir Dolecek <jdolecek@NetBSD.org> wrote:
> jschauma@netmeister.org wrote:
> > System: NetBSD dogfish-head.cs.stevens-tech.edu 2.0_BETA NetBSD 2.0_BET=
A (BOCK) #17: Mon Aug 16 13:34:05 EDT 2004 jschauma@doppelbock.hpcf.cs.stev=
ens-tech.edu:/share/src/sys/arch/i386/compile/obj/BOCK i386
> >
> > matlab used to work under NetBSD 1.6U and newer, including the full
> > java desktop. Some time between 1.6U and 2.0_BETA, the linux emulation
> > seems to have changed in a way that now prevents matlab from
> > functioning in full desktop mode.
> >=20
> > This is a serious regression and we should not ship NetBSD 2.0 unless
> > this has been fixed.
> >=20
> > See threads on port-i386 and current-users:
> > http://mail-index.netbsd.org/port-i386/2004/05/14/0003.html
> > http://mail-index.netbsd.org/port-i386/2004/07/20/0014.html
> > http://mail-index.netbsd.org/current-users/2004/07/21/0002.html
> > ...
>=20
> Is this with the up-to-date 2.0_BETA kernel, including linux_misc.c
> rev. 1.122.2.1?
Yes. I have linux_misc.c,v 1.122.2.2.
-Jan
--=20
The Internet interprets censorship as damage and routes around it.
-- John Gilmore
--tKW2IUtsqtDRztdT
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (NetBSD)
iD8DBQFBJq4PfFtkr68iakwRAkK8AJ9JlL27qRsY/8e6CGA5OtXHS6cWbgCfTKqj
awwJ6JdzLPf/Deap+0FYM1s=
=HBkt
-----END PGP SIGNATURE-----
--tKW2IUtsqtDRztdT--
From: jdolecek@NetBSD.org (Jaromir Dolecek)
To: Jan Schaumann <jschauma@netmeister.org>
Cc: gnats-bugs@gnats.NetBSD.org
Subject: Re: port-i386/26687: linux emulation / matlab stopped working
Date: Sat, 21 Aug 2004 17:17:46 +0200 (CEST)
Jan Schaumann wrote:
> Yes. I have linux_misc.c,v 1.122.2.2.
Can you please do 'ktrace -i' of the (failing) matlab
and make the result kdump ('kdump -e linux' to ensure the
syscalls are mapped properly) available somewhere?
It might give some clue of what's happening.
Thanks.
Jaromir
--
Jaromir Dolecek <jdolecek@NetBSD.org> http://www.NetBSD.cz/
-=- We should be mindful of the potential goal, but as the Buddhist -=-
-=- masters say, ``You may notice during meditation that you -=-
-=- sometimes levitate or glow. Do not let this distract you.'' -=-
From: Jan Schaumann <jschauma@netmeister.org>
To: Jaromir Dolecek <jdolecek@NetBSD.org>
Cc: gnats-bugs@gnats.NetBSD.org
Subject: Re: port-i386/26687: linux emulation / matlab stopped working
Date: Tue, 24 Aug 2004 23:22:00 -0400
--yLVHuoLXiP9kZBkt
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Jaromir Dolecek <jdolecek@NetBSD.org> wrote:
> Jan Schaumann wrote:
> > Yes. I have linux_misc.c,v 1.122.2.2.
>=20
> Can you please do 'ktrace -i' of the (failing) matlab
> and make the result kdump ('kdump -e linux' to ensure the
> syscalls are mapped properly) available somewhere?
http://www.cs.stevens.edu/~jschauma/netbsd/matlab.kernel.ident
http://www.cs.stevens.edu/~jschauma/netbsd/ktrace.out.gz
http://www.cs.stevens.edu/~jschauma/netbsd/dump.gz
-Jan
--=20
I'm not even supposed to be here today!
--yLVHuoLXiP9kZBkt
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (NetBSD)
iD8DBQFBLAXYfFtkr68iakwRAnEKAJ9wCONEPH+NDDib9w+2MRamrMqu2gCggW6r
UJHjeNJ4k7FHyMvEb5Pn2ks=
=e+07
-----END PGP SIGNATURE-----
--yLVHuoLXiP9kZBkt--
From: jdolecek@NetBSD.org (Jaromir Dolecek)
To: Jan Schaumann <jschauma@netmeister.org>
Cc: gnats-bugs@gnats.NetBSD.org
Subject: Re: port-i386/26687: linux emulation / matlab stopped working
Date: Sat, 28 Aug 2004 00:34:46 +0200 (CEST)
--ELM1093646086-7461-0_
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII
Jan Schaumann wrote:
-- Start of PGP signed section.
> Jaromir Dolecek <jdolecek@NetBSD.org> wrote:
> > Jan Schaumann wrote:
> > > Yes. I have linux_misc.c,v 1.122.2.2.
> >
> > Can you please do 'ktrace -i' of the (failing) matlab
> > and make the result kdump ('kdump -e linux' to ensure the
> > syscalls are mapped properly) available somewhere?
>
> http://www.cs.stevens.edu/~jschauma/netbsd/matlab.kernel.ident
> http://www.cs.stevens.edu/~jschauma/netbsd/ktrace.out.gz
> http://www.cs.stevens.edu/~jschauma/netbsd/dump.gz
This might be same problem I debugged with Thomas Klausner. Can
you try the attached patch and let me know if it helped?
Jaromir
--
Jaromir Dolecek <jdolecek@NetBSD.org> http://www.NetBSD.cz/
-=- We should be mindful of the potential goal, but as the Buddhist -=-
-=- masters say, ``You may notice during meditation that you -=-
-=- sometimes levitate or glow. Do not let this distract you.'' -=-
--ELM1093646086-7461-0_
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=ISO-8859-2
Content-Disposition: attachment; filename=linux.diff
Content-Description:
Index: linux_misc.c
===================================================================
RCS file: /cvsroot/src/sys/compat/linux/common/linux_misc.c,v
retrieving revision 1.127
diff -u -p -r1.127 linux_misc.c
--- linux_misc.c 8 Aug 2004 09:40:50 -0000 1.127
+++ linux_misc.c 26 Aug 2004 22:18:45 -0000
@@ -454,14 +454,28 @@ linux_sys_mmap(l, v, retval)
syscallarg(linux_off_t) offset;
} */ *uap = v;
struct sys_mmap_args cma;
+ int error;
if (SCARG(uap, offset) & PAGE_MASK)
return EINVAL;
+ if (SCARG(uap, flags) & LINUX_MAP_GROWSDOWN && SCARG(uap, addr)) {
+ SCARG(uap, addr) -= SCARG(uap, len);
+ SCARG(uap, len) *= 2;
+ }
+
linux_to_bsd_mmap_args(&cma, uap);
SCARG(&cma, pos) = (off_t)SCARG(uap, offset);
- return sys_mmap(l, &cma, retval);
+ error = sys_mmap(l, &cma, retval);
+ if (error)
+ return (error);
+
+ if (SCARG(uap, flags) & LINUX_MAP_GROWSDOWN && SCARG(uap, addr)) {
+ retval[0] += SCARG(uap, len) / 2;
+ }
+
+ return (0);
}
/*
--ELM1093646086-7461-0_--
State-Changed-From-To: open->feedback
State-Changed-By: jdolecek
State-Changed-When: Sun Aug 29 09:21:49 UTC 2004
State-Changed-Why:
Offered patch, waiting for result.
From: Jaromir Dolecek <jdolecek@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: pr/26687 CVS commit: src/sys/compat/linux/common
Date: Sun, 29 Aug 2004 14:08:06 +0000 (UTC)
Module Name: src
Committed By: jdolecek
Date: Sun Aug 29 14:08:06 UTC 2004
Modified Files:
src/sys/compat/linux/common: linux_misc.c
Log Message:
handle mmap() request with MAP_GROWSDOWN flag (request for stack-like
grow-down auto extend segment) by allocating segment sized at
current stack size limit, and offsetting requested/returned address
as required
due to how normal virtual memory management work, allocating the
full sized stack memory segment up-front actually requires exactly same
amount of VA space and physical memory as the Linux 'grow' scheme and the
'grow' scheme is quite a lot more difficult to use in applications correctly,
so it's not very apparent why Linux introduced this feature at all
this fixes Thomas Klausner's Heroes3 crash, and might also
fix PR 26687 by Jan Schaumann
To generate a diff of this commit:
cvs rdiff -r1.127 -r1.128 src/sys/compat/linux/common/linux_misc.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: Jan Schaumann <jschauma@netmeister.org>
To: Jaromir Dolecek <jdolecek@NetBSD.org>
Cc: gnats-bugs@gnats.NetBSD.org
Subject: Re: port-i386/26687: linux emulation / matlab stopped working
Date: Mon, 30 Aug 2004 13:02:22 -0400
--xHFwDpU9dbj6ez1V
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Jaromir Dolecek <jdolecek@NetBSD.org> wrote:
> Jan Schaumann wrote:
=20
> > http://www.cs.stevens.edu/~jschauma/netbsd/matlab.kernel.ident
> > http://www.cs.stevens.edu/~jschauma/netbsd/ktrace.out.gz
> > http://www.cs.stevens.edu/~jschauma/netbsd/dump.gz
>=20
> This might be same problem I debugged with Thomas Klausner. Can
> you try the attached patch and let me know if it helped?
Sorry, no luck. Same behaviour. Do you want a new ktrace?
-Jan
--=20
'I have reached an age where my main purpose is not to receive
messages.' --- Umberto Eco, quoted in the New Yorker
--xHFwDpU9dbj6ez1V
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (NetBSD)
iD8DBQFBM12efFtkr68iakwRAr5ZAJ9kM7PVQsGmU+OqlAEfhZctjOgJyQCguQtk
TteWwvMurckMDrtT7HOqhR4=
=Gv+8
-----END PGP SIGNATURE-----
--xHFwDpU9dbj6ez1V--
From: Jan Schaumann <jschauma@netmeister.org>
To: Jaromir Dolecek <jdolecek@NetBSD.org>
Cc: gnats-bugs@NetBSD.org
Subject: Re: port-i386/26687: linux emulation / matlab stopped working
Date: Wed, 1 Sep 2004 09:41:42 -0400
--GpGaEY17fSl8rd50
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Jaromir Dolecek <jdolecek@NetBSD.org> wrote:
> Jan Schaumann wrote:
> > Well, that specific JVM _used_ to work just fine. As my PR states, I
> > was using matlab in that version with that JVM for several months.
> > Until I upgraded to 2.0_BETA, in fact, which would lead me to conclude
> > that there was indeed some regression in the Linux emulation.
>=20
> Hmm, true.
>=20
> Can you please make a ktrace -i & kdump -e linux with the old
> (working) kernel and the new (non-working) kernel. Can you also
> please check if the old (working) kernel had any option KERNBASE
> in it's kernel config?
Hmm, I'll see what I can do, but this may be difficult: All my machines
have been updated to 2.0_BETA a long time ago (I only noticed the matlab
regression a few weeks ago). I'll try to track down the last working
version.
-Jan
--=20
Time is an illusion, lunchtime doubly so.
--GpGaEY17fSl8rd50
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (NetBSD)
iD8DBQFBNdGWfFtkr68iakwRAjHlAJ9Vs3/TRdwP9a0bvHNkQjeEaVTTEQCfd1Wr
c28PUZCXKOBVi8g9tALugV4=
=J51y
-----END PGP SIGNATURE-----
--GpGaEY17fSl8rd50--
From: Matthias Scheler <tron@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: pr/26687 CVS commit: [netbsd-2-0] src/sys/compat/linux/common
Date: Sun, 5 Sep 2004 10:49:57 +0000 (UTC)
Module Name: src
Committed By: tron
Date: Sun Sep 5 10:49:57 UTC 2004
Modified Files:
src/sys/compat/linux/common [netbsd-2-0]: linux_misc.c
Log Message:
Pull up revision 1.128 (requested by jdolecek in ticket #810):
handle mmap() request with MAP_GROWSDOWN flag (request for stack-like
grow-down auto extend segment) by allocating segment sized at
current stack size limit, and offsetting requested/returned address
as required
due to how normal virtual memory management work, allocating the
full sized stack memory segment up-front actually requires exactly same
amount of VA space and physical memory as the Linux 'grow' scheme and the
'grow' scheme is quite a lot more difficult to use in applications correctly,
so it's not very apparent why Linux introduced this feature at all
this fixes Thomas Klausner's Heroes3 crash, and might also
fix PR 26687 by Jan Schaumann
To generate a diff of this commit:
cvs rdiff -r1.122.2.2 -r1.122.2.3 src/sys/compat/linux/common/linux_misc.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: jdolecek@NetBSD.org (Jaromir Dolecek)
To: Jan Schaumann <jschauma@netmeister.org>
Cc: gnats-bugs@netbsd.org
Subject: Re: port-i386/26687: linux emulation / matlab stopped working
Date: Wed, 15 Sep 2004 07:36:07 +0200 (CEST)
Hi,
The only difference I can spot is SIGSEGV handling. It causes java
crash with 2.0, but is handled normally with 1.6ZH. AFAIK such
mechanism is used for memory garbage collection.
Can you please find kernel version where it breaks? The window
between 1.6ZH and 2-0 branch is about two months, so shouldn't be
too hard.
Kernel version was bumped to 1.6ZH on '2004/01/10 14:46:24',
2.0_BETA was created '2004/03/29 05:21:33'.
First of all, I'd check whether kernel build from checkout with tag
netbsd-2-0-base works (to rule out any later pullup broke it),
then check time-based checkout at date just before each kernel
version bump between 1.6ZH and 1.6ZL.
I'd do this myself, but I don't have access to Matlab...
Thanks,
Jaromir
--
Jaromir Dolecek <jdolecek@NetBSD.org> http://www.NetBSD.cz/
-=- We should be mindful of the potential goal, but as the Buddhist -=-
-=- masters say, ``You may notice during meditation that you -=-
-=- sometimes levitate or glow. Do not let this distract you.'' -=-
From: Mark Davies <mark@mcs.vuw.ac.nz>
To: Jan Schaumann <jschauma@netmeister.org>
Cc: Jaromir Dolecek <jdolecek@netbsd.org>, gnats-bugs@netbsd.org
Subject: Re: port-i386/26687: linux emulation / matlab stopped working
Date: Thu, 16 Sep 2004 18:03:48 +1200
On Thursday 16 September 2004 06:00, you wrote:
> FYI. If you can help out trying to nail down the kernel versions that
> worked last, that would be reat.
OK this is what I've found out so far. In each of the following the userland
is 1.6ZH
Kernel from tag netbsd-2-0-base - Matlab works
Kernel from date 2004.04.20.12.00.00 (2.0C) - Matlab segfaults after splash
screen
Kernel from date 2004.04.05.12.00.00 (2.0C) - Matlab segfaults after splash
screen
I'm trying a 2004.03.31.12.00.00 (2.0B) at the moment but I need to go home
and I'm not sure how easily I'll be able to get at this test box from there.
cheers
mark
From: Mark Davies <mark@mcs.vuw.ac.nz>
To: Jan Schaumann <jschauma@netmeister.org>
Cc: Jaromir Dolecek <jdolecek@netbsd.org>, gnats-bugs@netbsd.org
Subject: Re: [jdolecek@NetBSD.org: Re: port-i386/26687: linux emulation / matlab stopped working]
Date: Thu, 16 Sep 2004 18:30:14 +1200
I wrote:
> Kernel from date 2004.04.05.12.00.00 (2.0C) - Matlab segfaults after splash
> screen
> I'm trying a 2004.03.31.12.00.00 (2.0B) at the moment but I need to go home
> and I'm not sure how easily I'll be able to get at this test box from there.
So I didn't quite get home yet. The 2004.03.31.12.00.00 kernel works so the
problem is somewhere in those 5 days.
cheers
mark
From: Mark Davies <mark@mcs.vuw.ac.nz>
To: Jan Schaumann <jschauma@netmeister.org>
Cc: Jaromir Dolecek <jdolecek@netbsd.org>, gnats-bugs@netbsd.org
Subject: Re: port-i386/26687: linux emulation / matlab stopped working
Date: Thu, 16 Sep 2004 22:35:24 +1200
On Thursday 16 September 2004 18:30, Mark Davies wrote:
> So I didn't quite get home yet. The 2004.03.31.12.00.00 kernel works so
> the problem is somewhere in those 5 days.
2004.04.02.12.00.00 - matlab segfaults, so its down to 2 days.
mark
From: Mark Davies <mark@mcs.vuw.ac.nz>
To: Jan Schaumann <jschauma@netmeister.org>
Cc: Jaromir Dolecek <jdolecek@netbsd.org>, gnats-bugs@netbsd.org
Subject: Re: port-i386/26687: linux emulation / matlab stopped working
Date: Thu, 16 Sep 2004 23:55:57 +1200
OK, I've tracked it down.
Prior to the below change matlab works, after it it Seg faults.
From: Matt Thomas <matt@netbsd.org>
List: source-changes
Date: 04/01/2004 16:56:45
Module Name: src
Committed By: matt
Date: Thu Apr 1 16:56:45 UTC 2004
Modified Files:
src/sys/kern: kern_sig.c
Log Message:
If a signal is the result of trap, only invoke a supplied handler if it's
not blocked. Otherwise (it if it blocked or the hanlder is set to SIG_IGN)
reset the signal back to its default settings so that a coredump can be
generated.
To generate a diff of this commit:
cvs rdiff -r1.189 -r1.190 src/sys/kern/kern_sig.c
Now how to fix?
cheers
mark
From: jdolecek@NetBSD.org (Jaromir Dolecek)
To: Mark Davies <mark@mcs.vuw.ac.nz>
Cc: Jan Schaumann <jschauma@netmeister.org>, gnats-bugs@netbsd.org
Subject: Re: port-i386/26687: linux emulation / matlab stopped working
Date: Thu, 16 Sep 2004 20:33:46 +0200 (CEST)
Mark Davies wrote:
> OK, I've tracked it down.
> Prior to the below change matlab works, after it it Seg faults.
Thanks a lot! I will start discussion on tech-kern@ to resolve this.
Jaromir
> From: Matt Thomas <matt@netbsd.org>
> List: source-changes
> Date: 04/01/2004 16:56:45
> Module Name: src
> Committed By: matt
> Date: Thu Apr 1 16:56:45 UTC 2004
>
> Modified Files:
> src/sys/kern: kern_sig.c
>
> Log Message:
> If a signal is the result of trap, only invoke a supplied handler if it's
> not blocked. Otherwise (it if it blocked or the hanlder is set to SIG_IGN)
> reset the signal back to its default settings so that a coredump can be
> generated.
>
> To generate a diff of this commit:
> cvs rdiff -r1.189 -r1.190 src/sys/kern/kern_sig.c
>
> Now how to fix?
>
> cheers
> mark
>
--
Jaromir Dolecek <jdolecek@NetBSD.org> http://www.NetBSD.cz/
-=- We should be mindful of the potential goal, but as the Buddhist -=-
-=- masters say, ``You may notice during meditation that you -=-
-=- sometimes levitate or glow. Do not let this distract you.'' -=-
From: jdolecek@NetBSD.org (Jaromir Dolecek)
To: mark@mcs.vuw.ac.nz
Cc: jschauma@netmeister.org, gnats-bugs@netbsd.org
Subject: Re: port-i386/26687: linux emulation / matlab stopped working
Date: Mon, 27 Sep 2004 21:12:48 +0200 (CEST)
Hi,
please try following patch if it makes any difference. It basically
keeps what current code does, but untangles the code and
fixes handling of the traps not hitting the reset condition.
Index: kern_sig.c
===================================================================
RCS file: /cvsroot/src/sys/kern/kern_sig.c,v
retrieving revision 1.197
diff -u -p -r1.197 kern_sig.c
--- kern_sig.c 8 Jun 2004 19:35:30 -0000 1.197
+++ kern_sig.c 27 Sep 2004 19:07:22 -0000
@@ -1035,44 +1035,51 @@ kpsignal2(struct proc *p, const ksiginfo
/*
* If proc is traced, always give parent a chance.
*/
- action = SIG_DFL;
- if ((p->p_flag & P_TRACED) == 0) {
- if (KSI_TRAP_P(ksi)) {
- /*
- * If the signal was the result of a trap, only catch
- * the signal if it isn't masked and there is a
- * non-default non-ignore handler installed for it.
- * Otherwise take the default action.
- */
- if (!sigismember(&p->p_sigctx.ps_sigmask, signum) &&
- sigismember(&p->p_sigctx.ps_sigcatch, signum))
- action = SIG_CATCH;
+ if (p->p_flag & P_TRACED) {
+ action = SIG_DFL;
+
+ /*
+ * If the process is being traced and the signal is being
+ * caught, make sure to save any ksiginfo.
+ */
+ if (sigismember(&p->p_sigctx.ps_sigcatch, signum))
+ ksiginfo_put(p, ksi);
+ } else {
+ /*
+ * If the signal was the result of a trap, only catch
+ * the signal if it isn't masked and there is a
+ * non-default non-ignore handler installed for it.
+ * Otherwise take the default action.
+ */
+ if (KSI_TRAP_P(ksi)
+ && sigismember(&p->p_sigctx.ps_sigmask, signum)
+ && !sigismember(&p->p_sigctx.ps_sigcatch, signum)) {
/*
* If we are to take the default action, reset the
* signal back to its defaults.
*/
- if (action == SIG_DFL) {
- sigdelset(&p->p_sigctx.ps_sigignore, signum);
- sigdelset(&p->p_sigctx.ps_sigcatch, signum);
- sigdelset(&p->p_sigctx.ps_sigmask, signum);
- SIGACTION(p, signum).sa_handler = SIG_DFL;
- }
- } else {
- /*
- * If the signal is being ignored,
- * then we forget about it immediately.
- * (Note: we don't set SIGCONT in p_sigctx.ps_sigignore,
- * and if it is set to SIG_IGN,
- * action will be SIG_DFL here.)
- */
- if (sigismember(&p->p_sigctx.ps_sigignore, signum))
- return;
- if (sigismember(&p->p_sigctx.ps_sigmask, signum))
- action = SIG_HOLD;
- else if (sigismember(&p->p_sigctx.ps_sigcatch, signum))
- action = SIG_CATCH;
+ sigdelset(&p->p_sigctx.ps_sigignore, signum);
+ sigdelset(&p->p_sigctx.ps_sigcatch, signum);
+ sigdelset(&p->p_sigctx.ps_sigmask, signum);
+ SIGACTION(p, signum).sa_handler = SIG_DFL;
}
- if (action == SIG_DFL) {
+
+ /*
+ * If the signal is being ignored,
+ * then we forget about it immediately.
+ * (Note: we don't set SIGCONT in p_sigctx.ps_sigignore,
+ * and if it is set to SIG_IGN,
+ * action will be SIG_DFL here.)
+ */
+ if (sigismember(&p->p_sigctx.ps_sigignore, signum))
+ return;
+ if (sigismember(&p->p_sigctx.ps_sigmask, signum))
+ action = SIG_HOLD;
+ else if (sigismember(&p->p_sigctx.ps_sigcatch, signum))
+ action = SIG_CATCH;
+ else {
+ action = SIG_DFL;
+
if (prop & SA_KILL && p->p_nice > NZERO)
p->p_nice = NZERO;
@@ -1085,13 +1092,6 @@ kpsignal2(struct proc *p, const ksiginfo
if (prop & SA_TTYSTOP && p->p_pgrp->pg_jobc == 0)
return;
}
- } else {
- /*
- * If the process is being traced and the signal is being
- * caught, make sure to save any ksiginfo.
- */
- if (sigismember(&p->p_sigctx.ps_sigcatch, signum))
- ksiginfo_put(p, ksi);
}
if (prop & SA_CONT)
--
Jaromir Dolecek <jdolecek@NetBSD.org> http://www.NetBSD.cz/
-=- We should be mindful of the potential goal, but as the Buddhist -=-
-=- masters say, ``You may notice during meditation that you -=-
-=- sometimes levitate or glow. Do not let this distract you.'' -=-
From: Mark Davies <mark@mcs.vuw.ac.nz>
To: Jaromir Dolecek <jdolecek@netbsd.org>
Cc: jschauma@netmeister.org, gnats-bugs@netbsd.org
Subject: Re: port-i386/26687: linux emulation / matlab stopped working
Date: Tue, 28 Sep 2004 11:31:24 +1200
On Tuesday 28 September 2004 07:12, Jaromir Dolecek wrote:
> please try following patch if it makes any difference. It basically
> keeps what current code does, but untangles the code and
> fixes handling of the traps not hitting the reset condition.
That does appear to fix it. No more seg fault after the splash screen and the
gui comes up.
cheers
mark
From: Mark Davies <mark@mcs.vuw.ac.nz>
To: Jaromir Dolecek <jdolecek@netbsd.org>
Cc: jschauma@netmeister.org, gnats-bugs@netbsd.org
Subject: Re: port-i386/26687: linux emulation / matlab stopped working
Date: Tue, 28 Sep 2004 13:29:07 +1200
And with the patch plus the SUSE9.1 libs MatLab 7 works.
cheers
mark
From: Jaromir Dolecek <jdolecek@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: pr/26687 CVS commit: src/sys/kern
Date: Tue, 28 Sep 2004 08:59:20 +0000 (UTC)
Module Name: src
Committed By: jdolecek
Date: Tue Sep 28 08:59:20 UTC 2004
Modified Files:
src/sys/kern: kern_sig.c
Log Message:
adjust the change of rev. 1.190 so that trap signals not matching
the reset condition are processed properly; this fixes PR#26687 by
Jan Schaumann
many thanks to Mark Davies, who tracked the offending change down
and helped test patches
while here, g/c unused sigtrapmask and rearrange some code to pre-r1.190 form
for better readability
To generate a diff of this commit:
cvs rdiff -r1.197 -r1.198 src/sys/kern/kern_sig.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: feedback->closed
State-Changed-By: jdolecek
State-Changed-When: Tue Sep 28 09:02:42 UTC 2004
State-Changed-Why:
Change committed. Thanks a lot to all involved!
From: James Chacon <jmc@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: pr/26687 CVS commit: [netbsd-2-0] src/sys/kern
Date: Fri, 1 Oct 2004 03:46:37 +0000 (UTC)
Module Name: src
Committed By: jmc
Date: Fri Oct 1 03:46:37 UTC 2004
Modified Files:
src/sys/kern [netbsd-2-0]: kern_sig.c
Log Message:
Pullup rev 1.198 (requested by jdolecek in ticket #881)
Adjust the change of rev. 1.190 so that trap signals not matching
the reset condition are processed properly. PR#26687
To generate a diff of this commit:
cvs rdiff -r1.189.2.5 -r1.189.2.6 src/sys/kern/kern_sig.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.