ericmckean / libjingle

Automatically exported from code.google.com/p/libjingle
0 stars 0 forks source link

Segmentation Fault in network.cc #333

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Run the base_unittest 

What is the expected output? What do you see instead?

Expect the test case run to finish.  Instead I'm getting a segfault.

What version of the product are you using? On what operating system?

libjingle 0.6.17
$ uname -a
Linux li131-49 2.6.32.16-linode28 #1 SMP Sun Jul 25 21:32:42 UTC 2010 i686 
GNU/Linux
(yes, my clock is wrong, i know)

Please provide any additional information below.

After upgrading from 0.6.10 to 0.6.17, I was getting a segfault on my linux 
i386 box.  It is working fine on iOS and OS X however.  I was able to reproduce 
it easily by running base_unittest.

network.cc seems to have been updated in 0.6.15 which is causing the problem.   
Attached is a patch to skip interfaces that do not have an address associated 
with them.  From the gdb output of the segfault:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb6d1cb70 (LWP 20882)]
0x08059e8b in talk_base::BasicNetworkManager::CreateNetworks (this=0x80fe178, 
include_ignored=false, networks=0xb6d1c290) at base/network.cc:203
203     switch (cursor->ifa_addr->sa_family) {
(gdb) p cursor
$1 = (ifaddrs *) 0x80fff04
(gdb) p cursor->ifa_addr
$2 = (sockaddr *) 0x0
(gdb) exit

The ifconfig -a output on the machine it was failing on:
dummy0    Link encap:Ethernet  HWaddr 2e:e1:a7:ce:60:bb  
          BROADCAST NOARP  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

eth0      Link encap:Ethernet  HWaddr fe:fd:45:a4:d8:31  
          inet addr:X.X.X.X  Bcast:X.X.X.X  Mask:255.255.255.0
          inet6 addr: X::X:X:X:X/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:28563974 errors:0 dropped:0 overruns:0 frame:0
          TX packets:24044093 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:3945965247 (3.9 GB)  TX bytes:3353566354 (3.3 GB)
          Interrupt:29 

gre0      Link encap:UNSPEC  HWaddr 
00-00-00-00-66-65-61-34-00-00-00-00-00-00-00-00  
          NOARP  MTU:1476  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

ip6tnl0   Link encap:UNSPEC  HWaddr 
00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          NOARP  MTU:1460  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:1387273 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1387273 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:18320486 (18.3 MB)  TX bytes:18320486 (18.3 MB)

sit0      Link encap:IPv6-in-IPv4  
          NOARP  MTU:1480  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

teql0     Link encap:UNSPEC  HWaddr 
00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          NOARP  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

tun0      Link encap:UNSPEC  HWaddr 
00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          inet addr:10.8.0.1  P-t-P:10.8.0.2  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:2898082 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3460860 errors:0 dropped:2217 overruns:0 carrier:0
          collisions:0 txqueuelen:100 
          RX bytes:787916521 (787.9 MB)  TX bytes:4118139422 (4.1 GB)

tunl0     Link encap:IPIP Tunnel  HWaddr   
          NOARP  MTU:1480  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

Original issue reported on code.google.com by jdeyo...@gmail.com on 31 Mar 2012 at 1:01

Attachments:

GoogleCodeExporter commented 9 years ago
Sergey, is this issue resolved now?

Original comment by juberti@google.com on 24 Apr 2012 at 3:28

GoogleCodeExporter commented 9 years ago
It looks like this has already been fixed in the latest version, you can close 
this one.

Original comment by jdeyo...@gmail.com on 1 May 2012 at 2:01

GoogleCodeExporter commented 9 years ago

Original comment by sergeyu@google.com on 1 May 2012 at 6:04