From: Steve K. <st...@st...> - 2003-07-28 13:33:00
|
On Sun, 2003-07-27 at 22:17, Scott Lambert wrote: > I finally got some time to play with this some more. I think I'm > running into a problem that only shows up in GCC 3.x. I think > I remember seeing something about this type of problem on the > FreeBSD-current list lately. Unfortunately, I wasn't paying close > enough attention. I've been trawling the archives for a while now but > still haven't found the answer. Well, that's a pretty strange one. I don't know how that line could possibly cause a segfault! That should probably just be a constant assignment! However, that line doesn't show up the same for me in my sources; 2255 static struct iax_event *iax_net_read(void) 2256 { 2257 char buf[65536]; 2258 int res; 2259 struct sockaddr_in sin; 2260 int sinlen; 2261 sinlen = sizeof(sin); 2262 res = recvfrom(netfd, buf, sizeof(buf), 0, (struct sockaddr *) &sin, &sinlen); 2263 if (res < 0) { 2264 #ifdef WIN32 2265 if (WSAGetLastError() != WSAEWOULDBLOCK) { 2266 DEBU(G "Error on read: %d\n", WSAGetLastError()); 2267 IAXERROR "Read error on network socket: %s", strerror(errno)); 2268 } 2269 #else 2270 if (errno != EAGAIN) { 2271 DEBU(G "Error on read: %s\n", strerror(errno)); 2272 IAXERROR "Read error on network socket: %s", strerror(errno)); 2273 } 2274 #endif 2275 return NULL; 2276 } 2277 return iax_net_process(buf, res, &sin); 2278 } And the next line, calling recvfrom, probably shouldn't cause a segfault either, because buf is on the stack, and we seem to be calling it correctly. -SteveK > > Starting program: /home/lambert/src/vendor/iaxclient/simpleclient/wx/wx > libiax2/src/iax.c line 584 in iax_init: Started on port 4569 > > Program received signal SIGSEGV, Segmentation fault. > iax_net_read () at libiax2/src/iax.c:2269 > 2269 sinlen = sizeof(sin); > Current language: auto; currently c > (gdb) bt > #0 iax_net_read () at libiax2/src/iax.c:2269 > #1 0x0805f6e0 in iax_get_event (blocking=0) at libiax2/src/iax.c:2418 > #2 0x0805b6ff in do_iax_event () at iaxclient_lib.c:682 > #3 0x0805b63f in iaxc_service_network (netfd=8) at iaxclient_lib.c:632 > #4 0x0805ab7c in iaxc_process_calls () at iaxclient_lib.c:297 > #5 0x0805abae in iaxc_processor (args=0x0) at iaxclient_lib.c:308 > #6 0x280a351e in _thread_start () from /usr/lib/libc_r.so.5 -- Steve Kann - Chief Engineer - 520 8th Ave #2300 NY 10018 - (212) 533-1775 HorizonLive.com - collaborate . interact . learn "The box said 'Requires Windows 95, NT, or better,' so I installed Linux." |