[vox-tech] glibc and socket()
Peter Jay Salzman
vox-tech@lists.lugod.org
Mon, 10 Feb 2003 19:10:43 -0800
begin Nicole the Wonder Nerd <ana.ng@tmbg.org>
> 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.
> 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().
> Breakpoint 1, initialize_listen_socket (saP=0xbfffea78) at libhttpd.c:384
> 384 if ( ! sockaddr_check( saP ) )
> (gdb) n
> 390 listen_fd = socket( saP->sa.sa_family, SOCK_STREAM, 0 );
> (gdb) s
> At this point, the system goes supine.
> According to http://www.skyfree.org/linux/kernel_network/socket.html ,
> socket() is actually a glibc function; it sets things [1] up and then
> calls the system call sys_socketcall(). But I don't know where the
> kernel panic is triggered, and I also don't know how to recompile
> glibc or even if that would be a useful course of action.
>
> Anyone have any ideas? I've even tried compiling the target binary
> with -static; still no information on time/place of death.
hate to talk about poor coding practises, but i've never used anything
like kgdb, so i can't really suggest them.
if you get really desperate, you can trace execution using printk().
just don't forget to set the loglevel to <1>, ie
printk("<1>foo!\n");
to make sure you see it. also, make sure you're working on a console.
also, you might want to post to kernelnewbies.org or even
linux-kernel@vger.kernel.org. you have to subscribe to kernelnewbies to
post to it (you don't have to subscribe to linux-kernel to post to it,
brave souls).
just out of curiosity, is your kernel oopsing? are you getting the
"aieee" interrupt handler killed message? or is the kernel just
locking hard? you may not see these messages if you're working in an X
environment.
pete