Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: y0000218@rzsrv2.rz.tu-bs.de
Subject: Threads problem: segfault in ntop1.1a9
Date: Mon, 4 Jan 1999 16:15:59 GMT	[thread overview]
Message-ID: <199901041615.QAA20239@ppp393.ts.rz.tu-bs.de> (raw)

I have a problem compiling ntop-1.1a9 (ftp://ftp.unipi.it/pub/ntop/snapshots/
ntop1.1a9.tar.gz) the uses threads. it works on x86.

Just compiled ntop on a alpha-redhat-5.2 system, 2.1.130
kernel.


Starting program: /home/olaf/bin/./ntop -w 3000 -n

Program received signal SIGUSR1, User defined signal 1.
__sigsuspend () at ../sysdeps/unix/sysv/linux/alpha/sigsuspend.S:42
../sysdeps/unix/sysv/linux/alpha/sigsuspend.S:42: No such file or directory.
Current language:  auto; currently asm
(gdb) bt
#0  __sigsuspend () at ../sysdeps/unix/sysv/linux/alpha/sigsuspend.S:42
#1  0x2000027d1d0 in pthread_create (thread=0x1201884a0, attr=0x0, 
    start_routine=0x120009450 <dequeuePacket>, arg=0x0) at restart.h:32
#2  0x12000a6a0 in createThread (threadId=0x0, __start_routine=0, __arg=0x0)
    at util.c:374
#3  0x120003008 in main (argc=4, argv=0x11ffff7f8) at ntop.c:279
(gdb) l util.c:374
369
370     int createThread(pthread_t *threadId,
371                       void *(*__start_routine) (void *),
372                       void *__arg) {
373
374       int rc = pthread_create(threadId, NULL, 
375                               __start_routine, __arg);
376
377       return(rc);
378     }

after loading the initial page in a web browser.


Starting program: /tmp/olaf/ntop-1.1a9/ntop -w 3000 -n

(global vars:)


#ifdef MULTITHREADED
ConditionalVariable packetQueueCondvar;
pthread_mutex_t     packetQueueMutex;  
pthread_t           dequeueThreadId, handleWebConnectionsThreadId, updateThptThreadId;
PacketInformation packetQueue[PACKET_QUEUE_LENGTH];
unsigned int maxPacketQueueLen, packetQueueLen, packetQueueHead, packetQueueTail, packetQueueDroppedPkts;
#endif



Breakpoint 1, main (argc=4, argv=0x11ffff7f8) at ntop.c:279
279       createThread(&dequeueThreadId, dequeuePacket, NULL);
Current language:  auto; currently c
(gdb) l
274     #ifdef MULTITHREADED
275       maxPacketQueueLen = packetQueueLen = packetQueueHead = 
276         packetQueueTail = packetQueueDroppedPkts = 0;
277       createCondvar(&packetQueueCondvar);
278       createMutex(&packetQueueMutex);
279       createThread(&dequeueThreadId, dequeuePacket, NULL);
280       createThread(&updateThptThreadId, updateThptLoop, NULL);
281     #endif
282
283       (void)fprintf(stderr, "ntop v.%s "
(gdb) p dequeueThreadId
$1 = 0
(gdb) p* dequeueThreadId
Cannot access memory at address 0x0.
(gdb) p &dequeueThreadId
$2 = (pthread_t *) 0x1201884a0
(gdb) p dequeuePacket
$3 = {void ()} 0x120009450 <dequeuePacket>
(gdb) s
createThread (threadId=0x1201884a0, 
    __start_routine=0x120009450 <dequeuePacket>, __arg=0x0) at util.c:374
374       int rc = pthread_create(threadId, NULL, 
(gdb) l
369
370     int createThread(pthread_t *threadId,
371                       void *(*__start_routine) (void *),
372                       void *__arg) {
373
374       int rc = pthread_create(threadId, NULL, 
375                               __start_routine, __arg);
376
377       return(rc);
378     }
(gdb) m threadId
Ambiguous command "m threadId": maintenance, make, mt.
(gdb) p threadId
$4 = (pthread_t *) 0x1201884a0
(gdb) p __start_routine
$5 = (void *(*)()) 0x120009450 <dequeuePacket>
(gdb) p __arg
$6 = (void *) 0x0
(gdb) s
pthread_create (thread=0xbb8, attr=0x12014839c, start_routine=0x3690e794, 
    arg=0x11ffff7f8) at pthread.c:233
pthread.c:233: No such file or directory.
(gdb)  b util.c:377
Breakpoint 2 at 0x12000a6a8: file util.c, line 377.
(gdb) c
Continuing.

Program received signal SIGUSR1, User defined signal 1.
__sigsuspend () at ../sysdeps/unix/sysv/linux/alpha/sigsuspend.S:42
../sysdeps/unix/sysv/linux/alpha/sigsuspend.S:42: No such file or directory.
Current language:  auto; currently asm
(gdb) bt
#0  __sigsuspend () at ../sysdeps/unix/sysv/linux/alpha/sigsuspend.S:42
#1  0x2000027d1d0 in pthread_create (thread=0x1201884a0, attr=0x0, 
    start_routine=0x120009450 <dequeuePacket>, arg=0x0) at restart.h:32
#2  0x12000a6a0 in createThread (threadId=0x0, __start_routine=0, __arg=0x0)
    at util.c:374
#3  0x120003008 in main (argc=4, argv=0x11ffff7f8) at ntop.c:279


glibc-2.0.7-29

/lib/libpthread-0.7.so
/lib/libpthread.so.0
/usr/lib/libpthread.a
/usr/lib/libpthread.so


x86 system, rh 5.2, same versions, kernel 2.0.36:

works. 
Starting program: /tmp/olaf/ntop-1.1a9/ntop -w 3000 -n

Breakpoint 1, main (argc=4, argv=0xbffffd1c) at ntop.c:279
279       createThread(&dequeueThreadId, dequeuePacket, NULL);
(gdb) p &dequeueThreadId
$1 = (long unsigned int *) 0x80c075c
(gdb) p dequeuePacket
$2 = {void ()} 0x804df40 <dequeuePacket>
(gdb) s
createThread (threadId=0x80c075c, __start_routine=0x804df40 <dequeuePacket>, 
    __arg=0x0) at util.c:374
374       int rc = pthread_create(threadId, NULL, 
(gdb) l
369
370     int createThread(pthread_t *threadId,
371                       void *(*__start_routine) (void *),
372                       void *__arg) {
373
374       int rc = pthread_create(threadId, NULL, 
375                               __start_routine, __arg);
376
377       return(rc);
378     }
(gdb) p threadId
$3 = (long unsigned int *) 0x80c075c
(gdb) p __start_routine
$4 = (void *(*)()) 0x804df40 <dequeuePacket>
(gdb) p __arg
$5 = (void *) 0x0
(gdb) s
strcmp (p1=0x8048e85 "_IO_stdin_", p2=0x8049096 "pthread_create")
    at ../sysdeps/generic/strcmp.c:30
../sysdeps/generic/strcmp.c:30: No such file or directory.
(gdb) 
(gdb) b util.c:377
Breakpoint 2 at 0x804eae7: file util.c, line 377.
(gdb) c
Continuing.
[New Thread 19982]
[New Thread 19968]
[New Thread 19983]

Breakpoint 2, createThread (threadId=0x80c075c, 
    __start_routine=0x804df40 <dequeuePacket>, __arg=0x0) at util.c:378
378     }
(gdb) 


Any hints? 

Olaf

-- 
"The number of Unix installations       Olaf Schnapauff,
has grown to 10, with more expected."   O.Schnapauff@tu-bs.de  
- The Unix Programmer's Manual,1972     http://www.tu-bs.de/~c0033014/
       See Web page and keyservers  for pgp public key


             reply	other threads:[~1999-01-04 16:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-01-04 16:15 y0000218 [this message]
1999-01-04 16:52 ` Sources for Multia SCSI hdd's Izaak Bozof
1999-01-04 17:51   ` Kevin.Brown
1999-01-08 16:58 ` Threads problem: segfault in ntop1.1a9 Stefan Schroepfer
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox