Bug 31190

Summary: Program, like top, is used libkvm doesn't work
Product: Base System Reporter: Serg O. Malakhov <serg>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description Serg O. Malakhov 2001-10-10 09:40:01 UTC
After upgrade system to 4.4 and nothing else, program like top and systat
repot error "nlist failed"
In kdump we can see the messeges:
CALL  kldsym(0,0x1,0xbfbff834)
RET   kldsym -1 errno 2 No such file or directory

How-To-Repeat: make cvsup for src and build kernel and all sources, reboot, and just type after login top
Comment 1 Peter Pentchev 2001-10-10 09:44:00 UTC
On Wed, Oct 10, 2001 at 01:30:40AM -0700, Serg O. Malakhov wrote:
> 
> >Number:         31190
> >Category:       bin
> >Synopsis:       Program, like top,  is used libkvm doesn't work
> >Originator:     Serg O. Malakhov
> >Release:        4.4 Stable
> >Organization:
> Servocomp Inc.
> >Environment:
> FreeBSD camel.servocomp.ru 4.3-RELEASE FreeBSD 4.4-RELEASE #0: Wed Sep 26 15:34:56 MSD 2001
>   root@camel.servocomp.ru:/usr/src/sys/compile/SERG  i386
> >Description:
> After upgrade system to 4.4 and nothing else, program like top and systat
> repot error "nlist failed"
> In kdump we can see the messeges:
> CALL  kldsym(0,0x1,0xbfbff834)
> RET   kldsym -1 errno 2 No such file or directory
> 
> >How-To-Repeat:
> make cvsup for src and build kernel and all sources, reboot, and just type after login top

What were the exact commands you used to 'build kernel and all sources'?
Did you run 'make world', or did you use 'make buildworld buildkernel'?
If you did it the 'buildworld' way, did you run both 'make installkernel'
and 'make installworld' afterwards?

What is the output of 'ls -l /usr/bin/top'?

G'luck,
Peter

-- 
Thit sentence is not self-referential because "thit" is not a word.
Comment 2 Peter Pentchev 2001-10-10 10:02:47 UTC
On Wed, Oct 10, 2001 at 12:52:00PM +0400, Serg wrote:
> Peter Pentchev wrote:
> 
> >On Wed, Oct 10, 2001 at 01:30:40AM -0700, Serg O. Malakhov wrote:
> >>>Environment:
> >>>
> >>FreeBSD camel.servocomp.ru 4.3-RELEASE FreeBSD 4.4-RELEASE #0: Wed Sep 26 15:34:56 MSD 2001
[snip]
> >>make cvsup for src and build kernel and all sources, reboot, and just type after login top
> >>
> >
> >What were the exact commands you used to 'build kernel and all sources'?
> >Did you run 'make world', or did you use 'make buildworld buildkernel'?
> >If you did it the 'buildworld' way, did you run both 'make installkernel'
> >and 'make installworld' afterwards?
> >
> Sure
> 
> >
> >
> >What is the output of 'ls -l /usr/bin/top'?
> >
> -r-xr-sr-x  1 root  kmem  32456  9 okt 21:36 /usr/bin/top

OK, now for a really stupid question: are you sure you are running
your newly compiled kernel?  What does 'uname -a' say?  If it says
the same as in your PR (quoted above, saying 4.4-RELEASE #0 Sep 26),
you are *not* running your compiled kernel, but the default 4.4-RELEASE
kernel.

G'luck,
Peter

-- 
This sentence is false.
Comment 3 Peter Pentchev 2001-10-10 10:36:13 UTC
On Wed, Oct 10, 2001 at 01:14:55PM +0400, Serg wrote:
> Peter Pentchev wrote:
> 
> >On Wed, Oct 10, 2001 at 12:52:00PM +0400, Serg wrote:
> >
> >>Peter Pentchev wrote:
> >>
> >>>On Wed, Oct 10, 2001 at 01:30:40AM -0700, Serg O. Malakhov wrote:
> >>>
> >>>>>Environment:
> >>>>>
> >>>>FreeBSD camel.servocomp.ru 4.3-RELEASE FreeBSD 4.4-RELEASE #0: Wed Sep 26 15:34:56 MSD 2001
> >>>>
> >[snip]
> >
> >>>>make cvsup for src and build kernel and all sources, reboot, and just type after login top
> >>>>
> >>>What were the exact commands you used to 'build kernel and all sources'?
> >>>Did you run 'make world', or did you use 'make buildworld buildkernel'?
> >>>If you did it the 'buildworld' way, did you run both 'make installkernel'
> >>>and 'make installworld' afterwards?
> >>>
> >>Sure
> >>
> >>>
> >>>What is the output of 'ls -l /usr/bin/top'?
> >>>
> >>-r-xr-sr-x  1 root  kmem  32456  9 okt 21:36 /usr/bin/top
> >>
> >
> >OK, now for a really stupid question: are you sure you are running
> >your newly compiled kernel?  What does 'uname -a' say?  If it says
> >the same as in your PR (quoted above, saying 4.4-RELEASE #0 Sep 26),
> >you are *not* running your compiled kernel, but the default 4.4-RELEASE
> >kernel.
> >
> No. It's ok
> I loaded various kernel, with patch of des@freebsd.org for linuxprocfs 
> and without.
> 
> I've got mail from Alexey Neyman. He wrote:
> 
> I encountered this when I started the kernel directly, bypassing the loader.
> (I used /boot.config file to do this). Since I switched back to starting 
> /boot/loader instead of /kernel, top & family works fine.
> 
>
> I done all this and top works properly for now.
> I don't understend why and can I load without the loader.

Ahh... now I remember that I had this problem when booting a diskless
station using Etherboot, too.

Well, the loader's task is to load the kernel binary (the kernel is
almost a normal ELF executable file) into memory, then fix up some
symbols, load the necessary modules (just more ELF objects) and link
the whole together.  I had the nlist problem too, when I tried to bypass
the loader; first I worked around it by removing the 'static' keyword
before a couple of variable definitions in kern_{clock,fork,malloc,synch}.c,
vfs_bio.c and vm_zone.c - that made top(1) work.  Then, I just started
actually loading loader(8) before the kernel and letting it do its job :)

So.. now that you are not bypassing loader(8), things work for you, right?
Can this PR be closed?

G'luck,
Peter

-- 
This sentence was in the past tense.
Comment 4 Peter Pentchev freebsd_committer freebsd_triage 2001-10-10 11:40:16 UTC
State Changed
From-To: open->closed

The problem was due to booting the kernel directly, bypassing loader(8). 
This PR is thus a duplicate of kern/17422.