Libgtop and FreeBSD




Sorry for the lack of word/progress on the FreeBSD port of Libgtop... 
I still have intentions to finish what I've started, unfortunately,
my computer seems to be conspiring against me.

Every time I try to run test programs [to make sure I'm getting the
data, and getting the correct data], something goes wrong.  Linking
with the KVM library [used for getting access to the kvm_* functions
which report on Kernel Virtual Memory] causes the program to do mysterious,
bad things... sometimes the output code is screwed up and doesn't see the
correct main function...  Last time I tried, the program had a bus error
on the first kvm_ call [kvm_getprocs(...)], which strangely [and
frustratingly] enough had worked before...  [this is still the case...
see below]

Either I'm doing something wrong [doubtful because of the lack of complexity
of my test programs], or FreeBSD is screwed... I can't determine which.
I've been trying to upgrade FreeBSD, but I think I'm going to have to get
more disk space before I can do that... and I don't even think that will solve
the problem, since the test program didn't seem to work on a recent-release
of FreeBSD [2.2.6 ... the current release version].

Oy vey...

More as it develops...

If anyone else expresses interest in working on the port, I do have
[somewhat] functional code... maybe they'll have more luck compiling
than I...

...jsled

PS. If anyone's interested or has played with libkvm in FreeBSD,
this is what happens with the program...  it's a long shot, but maybe
someone can help me... I'd really like to use gtop, someday...

root@ip-206-79-223-152$ [~] gcc -ggdb -lkvm -L/usr/lib -o foo foo.c
root@ip-206-79-223-152$ [~] gdb ./foo
GDB is free software and you are welcome to distribute copies of it
 under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.16 (i386-unknown-freebsd), 
Copyright 1996 Free Software Foundation, Inc...
(gdb) b main
Breakpoint 1 at 0x1638: file foo.c, line 24.
(gdb) run
Starting program: /root/./foo 

Breakpoint 1, main () at foo.c:24
24        printf("begin\n");
(gdb) n
begin
28        kd = kvm_open(NULL, NULL, NULL, O_RDONLY, "kvm_open");
(gdb) 
30        if (kd == NULL) {
(gdb) 
35        pinfo = kvm_getprocs(kd, KERN_PROC_PID, 6626, count);
(gdb) 

Program received signal SIGBUS, Bus error.
0x8019d1b in ?? () from /usr/lib/libkvm.so.2.0
(gdb) bt
#0  0x8019d1b in ?? () from /usr/lib/libkvm.so.2.0
#1  0x1693 in main () at foo.c:35



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]