Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 May 2003 17:42:25 +0200
From:      Creep <creep2217@wp.pl>
To:        freebsd-current@freebsd.org
Subject:   5.0-RELEASE-p7 boot's while debugging asm (!?!?)
Message-ID:  <20030513154225.GA684@mistress.home.astercity.net>

next in thread | raw e-mail | index | archive | help

Hello.

I came upon a weird reboot in 
FreeBSD 5.0-RELEASE-p7 #0: Sun Apr 27 12:00:07 CEST 2003 i386

i have a small program:

.text
.global main
main:
	movb $2, %al
	int $0x80

i do a
gcc -o prog prog.S

gcc (GCC) 3.2.1 [FreeBSD] 20021119 (release)
GNU assembler 2.13.2 [FreeBSD] 2002-11-27
[both from FreeBSD]

when i debug it with ald [ /usr/ports/devel/ald ] ...

creep[/usr/ports/devel/ald]$ cat pkg-descr 
This is a port of ALD - the Assembly Language Debugger. It provides
breakpoint debugging capabilities to those wishing to debug their
assembly language programs. Currently, x86 platforms are supported.

It was compiled on this release.

.. as a normal user, I do

ald ./prog
break main
run
step
step [here is the int $0x80 for a syscall]

and poof. A reboot.

when i compiled an almost GENERIC kernel ...
creep[/sys/i386/conf]$ diff GENERIC OHBUGGER 
25c25
< ident         GENERIC
---
> ident         OHBUGGER
62,63c62,63
< #options      DDB                     #Enable the kernel debugger
< #options      INVARIANTS              #Enable calls of extra sanity checking
---
> options       DDB                     #Enable the kernel debugger
> options       INVARIANTS              #Enable calls of extra sanity checking
65c65
< #options      WITNESS                 #Enable checks to detect deadlocks and c                ycles
---
> options       WITNESS                 #Enable checks to detect deadlocks and c                ycles
142a143,146
> options SC_NORM_ATTR=(FG_WHITE|BG_BLACK)
> options SC_NORM_REV_ATTR=(FG_BLACK|BG_LIGHTGREY)
> options SC_KERNEL_CONS_ATTR=(FG_LIGHTRED|BG_BLACK)
> options SC_HISTORY_SIZE=800
235a240,241
> device                pcm

...and reproduce the event, it drops me to the DDB with this message:

Stopped at      sw1b+0xa9:      movl    %ecx,%fs:0
db> trace
sw1b(2f,2f,2f,bfbffa54,bfbffa5c) at sw1b+0xa9
fork_trampoline() at fork_trampoline
--- trap 0xa, eip = 0x80484a0, esp = 0xbfbffa2c, ebp = 0xbfbffa2c ---

when i issue a 'cont' i the debugger continues and everything seems 
going normal, but on a system with debugging turned off

This is my custom kernel:

----------------------------------------
machine		i386
cpu		I686_CPU
ident		NIGDY
maxusers	0

options 	INET			#InterNETworking
options 	INET6			#IPv6 communications protocols
options 	FFS			#Berkeley Fast Filesystem
options 	SOFTUPDATES		#Enable FFS soft updates support
options 	UFS_ACL			#Support for access control lists
options 	UFS_DIRHASH		#Improve performance on big directories
options 	MD_ROOT			#MD is a potential root device
options 	NFSCLIENT		#Network Filesystem Client
options 	NFSSERVER		#Network Filesystem Server
options         EXT2FS
options 	MSDOSFS			#MSDOS Filesystem
options 	CD9660			#ISO 9660 Filesystem
options 	PROCFS			#Process filesystem (requires PSEUDOFS)
options 	PSEUDOFS		#Pseudo-filesystem framework
options		NULLFS
options 	COMPAT_43		#Compatible with BSD 4.3 [KEEP THIS!]
options 	COMPAT_FREEBSD4		#Compatible with FreeBSD4
options 	SCSI_DELAY=0	#Delay (in ms) before probing SCSI
options 	KTRACE			#ktrace(1) support
options 	SYSVSHM			#SYSV-style shared memory
options 	SYSVMSG			#SYSV-style message queues
options 	SYSVSEM			#SYSV-style semaphores
options 	_KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions
options 	KBD_INSTALL_CDEV	# install a CDEV entry in /dev
options         IPFIREWALL
options         IPFIREWALL_DEFAULT_TO_ACCEPT
options         IPV6FIREWALL            #firewall for IPv6
options         IPV6FIREWALL_DEFAULT_TO_ACCEPT


device		isa
device		pci

device		smbus		# Bus support, required for smb below.
device		intpm		# power menage
device     	iicbus
device		iicbb
device		smb


device		fdc
device		ata
device		atadisk			# ATA disk drives
device		atapicd			# ATAPI CDROM drives
device		atapifd			# ATAPI floppy drives
device		atapist			# ATAPI tape drives
options 	ATA_STATIC_ID		#Static device numbering

device		atkbdc		# AT keyboard controller
device		atkbd		# AT keyboard
device		psm		# PS/2 mouse

device		vga		# VGA video card driver
device		splash		# Splash screen and screen saver support

device		sc

options SC_NORM_ATTR=(FG_WHITE|BG_BLACK)
options SC_NORM_REV_ATTR=(FG_BLACK|BG_LIGHTGREY)
options SC_KERNEL_CONS_ATTR=(FG_LIGHTRED|BG_BLACK)
options SC_HISTORY_SIZE=800

device		agp		# support several AGP chipsets
device		npx
device		apm
hint.apm.0.flags="0x20"

device		pmtimer
device		sio		# 8250, 16[45]50 based serial ports

device		ppc
device		ppbus		# Parallel port bus (required)
device		lpt		# Printer
device		plip		# TCP/IP over parallel
device		ppi		# Parallel port interface device

device		miibus		# MII bus support
device		rl		# RealTek 8129/8139


device		random		# Entropy device
device		loop		# Network loopback
device		ether		# Ethernet support
device		sl		# Kernel SLIP
device		ppp		# Kernel PPP
device		tun		# Packet tunnel.
device		pty		# Pseudo-ttys (telnet etc)
device		md		# Memory "disks"
device		gif		# IPv6 and IPv4 tunneling
device		faith		# IPv6-to-IPv4 relaying (translation)
device		snp
device		bpf		# Berkeley packet filter

device		pcm

device		uhci		# UHCI PCI->USB interface
device		ohci		# OHCI PCI->USB interface
device		usb		# USB Bus (required)

device		ugen		# Generic
device		uhid		# "Human Interface Devices"
device		ukbd		# Keyboard
device		ulpt		# Printer
-------------------------------------

The dmesg output is as follows:
Copyright (c) 1992-2003 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
	The Regents of the University of California. All rights reserved.
FreeBSD 5.0-RELEASE-p7 #0: Sun Apr 27 12:00:07 CEST 2003
    root@mistress:/usr/src/sys/i386/compile/NIGDY
Preloaded elf kernel "/boot/kernel/kernel" at 0xc0611000.
Preloaded elf module "/boot/kernel/linux.ko" at 0xc06110a8.
Preloaded elf module "/boot/kernel/nvidia.ko" at 0xc0611154.
Timecounter "i8254"  frequency 1193182 Hz
CPU: Pentium III/Pentium III Xeon/Celeron (601.37-MHz 686-class CPU)
  Origin = "GenuineIntel"  Id = 0x683  Stepping = 3
  Features=0x383f9ff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,FXSR,SSE>
real memory  = 134217728 (128 MB)
avail memory = 123813888 (118 MB)
Initializing GEOMetry subsystem
Pentium Pro MTRR support enabled
npx0: <math processor> on motherboard
npx0: INT 16 interface
Using $PIR table, 9 entries at 0xc00fde70
apm0: <APM BIOS> on motherboard
apm0: found APM BIOS v1.2, connected at v1.2
pcib0: <Intel 82443BX (440 BX) host to PCI bridge> at pcibus 0 on motherboard
pci0: <PCI bus> on pcib0
agp0: <Intel 82443BX (440 BX) host to PCI bridge> mem 0xd8000000-0xdbffffff at device 0.0 on pci0
pcib1: <PCIBIOS PCI-PCI bridge> at device 1.0 on pci0
pci1: <PCI bus> on pcib1
nvidia0: <GeForce2 MX/MX 400> mem 0xd0000000-0xd7ffffff,0xdc000000-0xdcffffff irq 10 at device 0.0 on pci1
isab0: <PCI-ISA bridge> at device 7.0 on pci0
isa0: <ISA bus> on isab0
atapci0: <Intel PIIX4 ATA33 controller> port 0xf000-0xf00f at device 7.1 on pci0
ata0: at 0x1f0 irq 14 on atapci0
ata1: at 0x170 irq 15 on atapci0
uhci0: <Intel 82371AB/EB (PIIX4) USB controller> port 0xc000-0xc01f irq 9 at device 7.2 on pci0
usb0: <Intel 82371AB/EB (PIIX4) USB controller> on uhci0
usb0: USB revision 1.0
uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
ugen0: OmniVision OV511+ Camera, rev 1.00/1.00, addr 2
ulpt0: Hewlett-Packard DeskJet 840C, rev 1.00/1.00, addr 3, iclass 7/1
ulpt0: using bi-directional mode
intpm0: <Intel 82371AB Power management controller> port 0x5000-0x500f irq 9 at device 7.3 on pci0
intpm0: I/O mapped 5000
intpm0: intr IRQ 9 enabled revision 0
smbus0: <System Management Bus> on intsmb0
smb0: <SMBus generic I/O> on smbus0
intpm0: PM I/O mapped 4000 
pci0: <simple comms, UART> at device 11.0 (no driver attached)
rl0: <RealTek 8139 10/100BaseTX> port 0xc400-0xc4ff mem 0xdf010000-0xdf0100ff irq 11 at device 13.0 on pci0
rl0: Realtek 8139B detected. Warning, this may be unstable in autoselect mode
rl0: Ethernet address: 00:02:44:29:5e:d3
miibus0: <MII bus> on rl0
rlphy0: <RealTek internal media interface> on miibus0
rlphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
pcm0: <Creative EMU10K1> port 0xc800-0xc81f irq 5 at device 15.0 on pci0
atapci1: <HighPoint HPT370 ATA100 controller> port 0xe000-0xe0ff,0xdc00-0xdc03,0xd800-0xd807,0xd400-0xd403,0xd000-0xd007 irq 11 at device 19.0 on pci0
ata2: at 0xd000 on atapci1
ata3: at 0xd800 on atapci1
orm0: <Option ROM> at iomem 0xc0000-0xcb7ff on isa0
pmtimer0 on isa0
atkbdc0: <Keyboard controller (i8042)> at port 0x64,0x60 on isa0
atkbd0: <AT Keyboard> flags 0x1 irq 1 on atkbdc0
kbd0 at atkbd0
psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: model MouseMan+, device ID 0
fdc0: <Enhanced floppy controller (i82077, NE72065 or clone)> at port 0x3f7,0x3f0-0x3f5 irq 6 drq 2 on isa0
fdc0: FIFO enabled, 8 bytes threshold
fd0: <1440-KB 3.5" drive> on fdc0 drive 0
ppc0: <Parallel port> at port 0x378-0x37f irq 7 on isa0
ppc0: Generic chipset (EPP/NIBBLE) in COMPATIBLE mode
plip0: <PLIP network interface> on ppbus0
lpt0: <Printer> on ppbus0
lpt0: Interrupt-driven port
ppi0: <Parallel I/O> on ppbus0
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
sio0 at port 0x3f8-0x3ff irq 4 flags 0x10 on isa0
sio0: type 16550A
sio1 at port 0x2f8-0x2ff irq 3 on isa0
sio1: type 16550A
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
unknown: <PNP0303> can't assign resources (port)
unknown: <PNP0a03> can't assign resources (port)
unknown: <PNP0f13> can't assign resources (irq)
unknown: <PNP0501> can't assign resources (port)
unknown: <PNP0700> can't assign resources (port)
unknown: <PNP0400> can't assign resources (port)
unknown: <PNP0501> can't assign resources (port)
Timecounters tick every 10.000 msec
ipfw2 initialized, divert disabled, rule-based forwarding enabled, default to accept, logging disabled
IPv6 packet filtering initialized, default to accept, logging disabled
ad4: 38166MB <WDC WD400BB-00DEA0> [77545/16/63] at ata2-master UDMA100
ad5: 12949MB <IBM-DJNA-371350> [26310/16/63] at ata2-slave UDMA66
acd0: CD-RW <CR-4802TE> at ata0-master PIO3
acd1: CDROM <TOSHIBA CD-ROM XM-6702B> at ata0-slave PIO4
MBREXT Slice 5 on ad4s4:
0000   00 0f ff ff 83 0f ff ff 3f 00 00 00 91 01 a0 00  |........?.......|
[0] f:00 typ:131 s(CHS):255/15/255 e(CHS):255/15/255 s:63 l:10486161
0000   00 0f ff ff 05 0f ff ff d0 01 a0 00 a0 03 40 01  |..............@.|
[1] f:00 typ:5 s(CHS):255/15/255 e(CHS):255/15/255 s:10486224 l:20972448
MBREXT Slice 6 on ad4s4:
0000   00 0f ff ff a5 0f ff ff 3f 00 00 00 61 03 40 01  |........?...a.@.|
[0] f:00 typ:165 s(CHS):255/15/255 e(CHS):255/15/255 s:63 l:20972385
0000   00 0f ff ff 05 0f ff ff 70 05 e0 01 90 dd 26 02  |........p.....&.|
[1] f:00 typ:5 s(CHS):255/15/255 e(CHS):255/15/255 s:31458672 l:36101520
MBREXT Slice 7 on ad4s4:
0000   00 0f ff ff 0b 0f ff ff 3f 00 00 00 51 dd 26 02  |........?...Q.&.|
[0] f:00 typ:11 s(CHS):255/15/255 e(CHS):255/15/255 s:63 l:36101457
0000   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  |................|
[1] f:00 typ:0 s(CHS):0/0/0 e(CHS):0/0/0 s:0 l:0
Mounting root from ufs:/dev/ad4s3c
-----------------------------------------

Note: when testing with 'almost GENERIC' kernel, i checked without
nvidia.ko module.

I know i have ugly MBREXT warnings but it's propably not their fault
and i'm still not sure how to get rid of them ;(

best regards to almighty freebsd hackers,

-- 
... creep .........
yes LoL | tr -u '\n' ' '



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030513154225.GA684>