l i n u x - u s e r s - g r o u p - o f - d a v i s
Next Meeting:
July 7: Social gathering
Next Installfest:
Latest News:
Jun. 14: June LUGOD meeting cancelled
Page last updated:
2003 Feb 11 16:09

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] glibc and socket()
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] glibc and socket()

On Mon, 10 Feb 2003, Nicole the Wonder Nerd wrote:

> Hi guys
> I'm trying to track down a kernel bug.  I've compiled my programs and the kernel 
> with -g, and I'm stepping through the executable with gdb.

I haven't tried to debug the kernel, but some ideas percolate up...

a) make sure your glibc and userspace applications are compiled against
the same kernel headers, and that those kernel headers are of equal or
older vintage as the kernel you are using.  See Linus' rant [1] on kernel
headers if you haven't already...

> A call to sockaddr_check() goes through OK, but a subsequent call to socket() 
> triggers a kernel panic.  Control never even gets to the first line of socket().

You know this without recompiling glibc for debugging?  Or are you saying
it doesn't get to sys_socket()?  The latter sounds an awful lot like
header problems.

I am pretty sure it is possible to debug with gdb into glibc without
recompiling glibc if you are willing to single step in machine code.  If
you have the glibc source to look at and have a vague understanding of how
C code looks in assembly, this shouldn't be too challenging.  You will
want to look for the software interrupt that invokes the user-to-kernel
context switch... if you make it to that instruction, and the headers are
compatible (big question mark), then the problem is in the kernel.

[1] http://uwsg.iu.edu/hypermail/linux/kernel/0007.3/0587.html

Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil@dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...2k

vox-tech mailing list

LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
EDGE Tech Corp.
For donating some give-aways for our meetings.