large memleak 2.1.78 with pthreads

Elmer Joandi (elmer_j@ut.ee)
Tue, 13 Jan 1998 01:53:49 +0200 (EET)


Got egcs 1.0.1 , got g++ libraries, RH50, SSLeay 0.8.1, pthreads
kernel 2.1.78 gcc 2.7.3 compiled

made a simple testapp spawning a SSLeay connection thread on each
connect, works

stresstest:
telnet localhost 5432 </dev/zero >/dev/null &

and so several times.
about 30 at least, less than 60

memory was quite low then (64MB ram, 20MB swap). extensive swap started.

killed server. killed telnets ( linux was at its knees allready)
telnet screamed buffer overflows (me wasnt sending much data )

not much processes were left, usually I have 40 MB free+buff+swap with
that much of processes. None of them consumed much memory.

about 30MB was gone. No sign in /proc/* files or kernel status dumps

I did not allocate any significant amount of memory in threads, so , most
of it should have been gone to where ?

Free pages: 3760kB
( 14*4kB 141*8kB 83*16kB 25*32kB 7*64kB 0*128kB = 3760kB)
Swap cache: add 2696/2696, delete 13917067/1845, find 13920/767
Free swap: 17600kB
16384 pages of RAM
7309 free pages
538 reserved pages
839 pages shared
Buffer memory: 2068kB
Buffer heads: 2096
Buffer blocks: 2068
CLEAN: 1299 buffers, 9 used (last=9), 0 locked, 0 protected, 0 dirty
LOCKED: 758 buffers, 44 used (last=731), 0 locked, 0 protected, 0 dirty

/root]# ps axl
FLAGS UID PID PPID PRI NI SIZE RSS WCHAN STA TTY TIME COMMAND
100 0 1 0 0 0 748 60 S ? 0:02 init [3]
40 0 2 1 0 0 0 0 end SW ? 0:00 (kflushd)
40 0 3 1 -12 -12 0 0 SW< ? 0:00 (kswapd)
140 0 24 1 0 0 724 44 end S ? 0:00 /sbin/ker
140 0 177 1 0 0 788 200 end S ? 0:00 syslogd
40 2 197 1 0 0 768 100 end S ? 0:00 /usr/sbin
40 0 208 1 0 0 836 116 end S ? 0:00 crond
140 1 219 1 0 0 740 0 end SW ? 0:00 (portmap)
140 0 231 1 0 0 756 0 end SW ? 0:00 (inetd)
40 0 242 1 0 0 1212 416 S ? 0:00 named
140 0 256 1 0 0 1392 220 end S ? 0:00 (sendmail
100 0 298 1 0 0 712 0 end SW 5 0:00 (mingetty
100 0 299 1 0 0 712 0 end SW 6 0:00 (mingetty
140 0 301 1 0 0 708 24 end S ? 0:04 update
100 500 851 1 0 0 1444 0 end SW 3 0:00 (login)
100 0 852 1 0 0 1444 928 end S 4 0:00 /bin/logi
100 500 981 1 0 0 1444 0 end SW 1 0:00 (login)
100 500 1252 1 0 0 1444 0 end SW 2 0:00 (login)
140 0 27073 1 0 0 732 376 end S ? 0:00 gpm -R
0 500 1226 851 0 0 1204 0 SW 3 0:00 (bash)
100 0 27029 852 9 0 1208 828 S 4 0:00 -bash
0 500 1277 981 0 0 1236 488 S 1 0:00 -bash
0 500 1253 1252 0 0 1204 436 S 2 0:00 -bash
0 500 27086 1253 4 0 1096 624 S 2 0:00 ssh madli
100000 0 27107 27029 10 0 920 496 R 4 0:00 ps axl

Elmer
http://www.ut.ee/~elmer_j/