Bug 94830 - [nfs] [patch] mount_nfs causes a fatal trap 18 if the value of desiredvnodes is below 1000
Summary: [nfs] [patch] mount_nfs causes a fatal trap 18 if the value of desiredvnodes ...
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs mailing list
Depends on:
Reported: 2006-03-22 14:10 UTC by Fabian Keil
Modified: 2018-05-20 23:52 UTC (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Fabian Keil 2006-03-22 14:10:18 UTC
On a Pentium 90 with 16 MB RAM FreeBSD sets desiredvnodes to 926,
this leads to a panic (Fatal trap 18: integer divide fault while in
kernel mode) if mount_nfs is used.

The panic is caused by line 826 in /usr/src/sys/nfsclient/nfs_vfsops.c:
nmp->nm_wcommitsize = hibufspace / (desiredvnodes / 1000);

desiredvnodes is an integer value, if it is divided by a value
bigger than itself the result is zero.

Kernel configuration:


kgdb backtrace:


Increase kern.maxvnodes by hand or let
do the job.

I'm not sure if ignoring the kernel's calculations is the right
thing to do, but so far I didn't experience any ill side effects.
How-To-Repeat: Use mount_nfs on a machine with a desiredvnodes value below 1000
(or set sysctl kern.maxvnodes to a value below 1000 yourself).
Comment 1 cel freebsd_committer 2006-05-24 20:43:31 UTC
Responsible Changed
From-To: freebsd-bugs->cel

Will review how nm_wcommitsize is calculated.
Comment 2 cel freebsd_committer 2007-03-12 15:25:32 UTC
Responsible Changed
From-To: cel->freebsd-bugs

Back to the public pool.
Comment 3 Fabian Keil 2014-12-28 15:41:44 UTC
The offending code got removed in r276096.
Comment 4 Eitan Adler freebsd_committer freebsd_triage 2018-05-20 23:52:30 UTC
For bugs matching the following conditions:
- Status == In Progress
- Assignee == "bugs@FreeBSD.org"
- Last Modified Year <= 2017

- Set Status to "Open"