Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
agentlib.c causing Seg Fault when running nova-agent #44
On line 76, ifa_addr is dereferenced without checking the value first. If it is null, we see the joyous SIGSEGV.
76: if (ifa->ifa_addr->sa_family != PF_PACKET)
One instance where it is null is when the network interface is one installed by OpenVPN (i.e. tun0).
This is arguably two issues, but I suspect both can be addressed by checking to ensure ifa_addr is not null, and merely continuing to the next interface if it is.
I experienced this firsthand when trying to launch a new Rackspace public cloud server from an image of a Rackspace public cloud server that had openvpn installed. nova-agent segfaulted on boot when it received "resetnetwork", and the correct hostname and IP were never written to the new cloud server.
Steps to verify: on a machine with a tun0 interface.
Program received signal SIGSEGV, Segmentation fault.
// Of course I don't have the source at hand, but line 76 is:
(gdb) print ifa->ifa_addr->sa_family
(gdb) print ifa->ifa_addr
(gdb) print ifa->ifa_name
I was using Ubuntu 10.04.4 on a next-generation server on Rackspace at the time.