Bug 2537 - Fsck dies with floatingpoint exception
Summary: Fsck dies with floatingpoint exception
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 2.2-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 1997-01-20 17:20 UTC by fj
Modified: 1998-01-19 16:33 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description fj 1997-01-20 17:20:01 UTC
	At reboot automatic fsck failed with the message:
	  VALUES IN SUPER BLOCK DISAGREE WITH THOSE IN FIRST ALTERNATE
	(setup.c line 384)

	Running fsck by hand (on the primary superblock) resulted in a 
	floatingpoint exception (probably caused by the printf in main.c
	with [(float)(sblock.fs_cstotal.cs_nffree * 100) / sblock.fs_dsize)]).
	I did retry after setting the npx0 flags to 0x7 - same result.

	fsck -b 32  avoided the problem.

Fix: 

fsck -b {better superblock copy}

	Fix fsck to check for divide by zero before trying.
How-To-Repeat: 
	Good question ;-)
Comment 1 Bruce Evans freebsd_committer freebsd_triage 1998-01-19 16:28:39 UTC
State Changed
From-To: open->closed

fsck problem fixed in rev.1.8 of fsck/setup.c (fsck trusted newfs). 
newfs problem created in rev.1.9 of newfs/newfs.c not yet fixed 
(newfs neglects to write label info used by fsck when the first 
superblock is bad).