From: Wolfgang W. <wol...@di...> - 2013-10-09 07:13:45
|
Hello! We are using websockets on naviserver. After connections are established, we create a callback for the read event with ns_sockcallback and push them in the background with ns_chan. We hit a limit of exactly 100 connections, which went away, when we commented out the ns_sockcallback call. The problem is an invalid memory allocation. I've attached a patch, which allows us to open much more connections, although we still get a memory corruption at around 1000 connections, somtimes more, sometimes less. TCL is compiled with Gustaf Neumanns memory allocator path. This is the backtrace with the linux standard memory allocator *** glibc detected *** /usr/local/naviserver/bin/nsd: malloc(): memory corruption: 0x000000000b371b60 *** ======= Backtrace: ========= /lib/libc.so.6(+0x71e16)[0x7f9de5cf5e16] /lib/libc.so.6(+0x74ead)[0x7f9de5cf8ead] /lib/libc.so.6(__libc_malloc+0x70)[0x7f9de5cfac70] /usr/local/lib/libtcl8.5.so(Tcl_Alloc+0x15)[0x7f9de64b8475] /usr/local/lib/libtcl8.5.so(+0xafdf2)[0x7f9de652ddf2] /usr/local/lib/libtcl8.5.so(+0x330de)[0x7f9de64b10de] /usr/local/lib/libtcl8.5.so(Tcl_EvalEx+0x16)[0x7f9de64b1aa6] /usr/local/naviserver/lib/libnsd.so(Ns_TclEvalCallback+0x12b)[0x7f9de6e4682b] /usr/local/naviserver/lib/libnsd.so(NsTclTraceProc+0x1c)[0x7f9de6e4a60c] /usr/local/naviserver/lib/libnsd.so(+0x5984a)[0x7f9de6e4a84a] /usr/local/naviserver/lib/libnsd.so(+0x59c45)[0x7f9de6e4ac45] /usr/local/naviserver/lib/libnsd.so(Ns_TclAllocateInterp+0x15)[0x7f9de6e4aef5] /usr/local/naviserver/lib/libnsd.so(NsTclSockProc+0x42)[0x7f9de6e56eb2] /usr/local/naviserver/lib/libnsd.so(+0x5250f)[0x7f9de6e4350f] /usr/local/naviserver/lib/libnsthread.so(NsThreadMain+0x7e)[0x7f9de67a067e] /usr/local/naviserver/lib/libnsthread.so(+0x5029)[0x7f9de67a1029] /lib/libpthread.so.0(+0x68ca)[0x7f9de586a8ca] /lib/libc.so.6(clone+0x6d)[0x7f9de5d53b6d] We are running some test with the google allocator, but the results are similar. Wolfgang -- *Wolfgang Winkler* Geschäftsführung wol...@di... mobil +43.699.19971172 dc:*büro* digital concepts Novak Winkler OG Software & Design Landstraße 68, 5. Stock, 4020 Linz www.digital-concepts.com <http://www.digital-concepts.com> tel +43.732.997117.72 tel +43.699.1997117.72 Firmenbuchnummer: 192003h Firmenbuchgericht: Landesgericht Linz PS: BESUCHEN SIE UNSERE NEUE SHOP INFO SEITE: www.shop-info.at |