#1092 tcpserver crashes with more than 32 connexion

v0.44
closed-fixed
5
2015-10-08
2013-07-03
No

tcpserver crashes when there is already 32 connexion and new client tries to connect

here is a gdb output :

antoine@Dell-XPS-15Z:~/Bureau/crash$ gdb pd
GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>...
Reading symbols from /usr/local/bin/pd...(no debugging symbols found)...done.
(gdb) run -noaudio -nrt -noprefs raw_server_2.pd 
Starting program: /usr/local/bin/pd -noaudio -nrt -noprefs raw_server_2.pd
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff3e9d700 (LWP 13862)]
[New Thread 0x7ffff369c700 (LWP 13867)]
[New Thread 0x7ffff2e9b700 (LWP 13871)]
[New Thread 0x7ffff269a700 (LWP 13873)]
[New Thread 0x7ffff1e99700 (LWP 13880)]
[New Thread 0x7ffff1698700 (LWP 13882)]
[New Thread 0x7ffff0e97700 (LWP 13889)]
[New Thread 0x7fffe3fff700 (LWP 13891)]
[New Thread 0x7fffe37fe700 (LWP 13896)]
[New Thread 0x7fffe2ffd700 (LWP 13900)]
[New Thread 0x7fffe27fc700 (LWP 13907)]
[New Thread 0x7fffe1ffb700 (LWP 13909)]
[New Thread 0x7fffe17fa700 (LWP 13916)]
[New Thread 0x7fffe0ff9700 (LWP 13918)]
[New Thread 0x7fffd3fff700 (LWP 13934)]
[New Thread 0x7fffd37fe700 (LWP 13936)]
[New Thread 0x7fffd2ffd700 (LWP 13947)]
[New Thread 0x7fffd27fc700 (LWP 13951)]
[New Thread 0x7fffd1ffb700 (LWP 13956)]
[New Thread 0x7fffd17fa700 (LWP 13958)]
[New Thread 0x7fffd0ff9700 (LWP 13965)]
[New Thread 0x7fffbffff700 (LWP 13966)]
[New Thread 0x7fffbf7fe700 (LWP 13974)]
[New Thread 0x7fffbeffd700 (LWP 13976)]
[New Thread 0x7fffbe7fc700 (LWP 13983)]
[New Thread 0x7fffbdffb700 (LWP 13985)]
[New Thread 0x7fffbd7fa700 (LWP 13990)]
[New Thread 0x7fffbcff9700 (LWP 13992)]
[New Thread 0x7fffaffff700 (LWP 14001)]
[New Thread 0x7fffaf7fe700 (LWP 14003)]
[New Thread 0x7fffaeffd700 (LWP 14010)]
[New Thread 0x7fffae7fc700 (LWP 14012)]
[New Thread 0x7fffadffb700 (LWP 14018)]
[New Thread 0x7fffad7fa700 (LWP 14021)]
[New Thread 0x7fffacff9700 (LWP 14028)]
[New Thread 0x7fff9bfff700 (LWP 14030)]
[New Thread 0x7fff9b7fe700 (LWP 14037)]
[New Thread 0x7fff9affd700 (LWP 14039)]
[New Thread 0x7fff9a7fc700 (LWP 14045)]
[New Thread 0x7fff99ffb700 (LWP 14048)]
[New Thread 0x7fff997fa700 (LWP 14055)]
[New Thread 0x7fff98ff9700 (LWP 14057)]
[New Thread 0x7fff8bfff700 (LWP 14064)]
[New Thread 0x7fff8b7fe700 (LWP 14066)]
[New Thread 0x7fff8affd700 (LWP 14072)]
[New Thread 0x7fff8a7fc700 (LWP 14075)]
[New Thread 0x7fff89ffb700 (LWP 14082)]
[New Thread 0x7fff897fa700 (LWP 14084)]
[New Thread 0x7fff88ff9700 (LWP 14090)]
[New Thread 0x7fff77fff700 (LWP 14093)]
[New Thread 0x7fff777fe700 (LWP 14099)]
[New Thread 0x7fff76ffd700 (LWP 14102)]
[New Thread 0x7fff767fc700 (LWP 14109)]
[New Thread 0x7fff75ffb700 (LWP 14111)]
[New Thread 0x7fff757fa700 (LWP 14115)]
[New Thread 0x7fff74ff9700 (LWP 14119)]
[New Thread 0x7fff67fff700 (LWP 14126)]
[New Thread 0x7fff677fe700 (LWP 14128)]
[New Thread 0x7fff66ffd700 (LWP 14135)]
[New Thread 0x7fff667fc700 (LWP 14137)]
[New Thread 0x7fff65ffb700 (LWP 14144)]
[New Thread 0x7fff657fa700 (LWP 14145)]
[New Thread 0x7fff64ff9700 (LWP 14153)]
[New Thread 0x7fff53fff700 (LWP 14155)]
[New Thread 0x7fff537fe700 (LWP 14162)]
[New Thread 0x7fff52ffd700 (LWP 14164)]
[Thread 0x7fff52ffd700 (LWP 14164) exited]

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff40a6dde in tcpserver_socket2index (sockfd=<optimized out>, 
    x=0x72dc60) at tcpserver.c:127
127       if(x->x_sr[i]->sr_fd == sockfd)
(gdb) bt
#0  0x00007ffff40a6dde in tcpserver_socket2index (sockfd=<optimized out>, 
    x=0x72dc60) at tcpserver.c:127
#1  tcpserver_disconnect_socket (x=0x72dc60, fsocket=45) at tcpserver.c:474
#2  0x00007ffff3ea1c7d in pollfun (z=<optimized out>, fd=<optimized out>)
    at iemnet_notify.c:126
#3  0x00000000004792ea in sys_domicrosleep.constprop.3 ()
#4  0x000000000047b0ea in sys_pollgui ()
#5  0x000000000047477a in m_mainloop ()
#6  0x00007ffff6e0476d in __libc_start_main (main=0x4114a0 <main>, argc=5, 
    ubp_av=0x7fffffffe248, init=<optimized out>, fini=<optimized out>, 
    rtld_fini=<optimized out>, stack_end=0x7fffffffe238) at libc-start.c:226
#7  0x00000000004114d1 in _start ()
(gdb) 

Discussion

  • Antoine Villeret

    on the top of tcpserver.c changing

    #define MAX_CONNECT 32
    

    to

    #define MAX_CONNECT 1000
    

    puts this crash far away but doesn't solve the problem...

     
  • IOhannes m zmölnig

    • labels: --> iemnet, tcpserver, crash
    • status: open --> closed-fixed
    • assigned_to: IOhannes m zmölnig
     
  • IOhannes m zmölnig

    [tcpserver] refuses to accept connections once the maximum number is reached (rather than crashing) since iemnet-0.2

     

Anonymous
Anonymous

Cancel  Add attachments