Spine - Deadlock in ping.c

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
peterostlin
Posts: 1
Joined: Mon Jun 02, 2008 8:51 am

Spine - Deadlock in ping.c

Post by peterostlin »

Hi all

I have found what I believe is a bug in ping.c (the spine source),
a potential deadlock when failing to resolve hostnames. The
affected spine process hang and fail to process the remaining
hosts when it encounters a bad hostname. Any unresolvable hostname
will trigger the problem.

In function 'init_sockaddr' (row 677) a mutex lock is taken and if
gethostbyname fail we try to take the lock again without releasing
it first.

Attached diff solves the issue for me. In it I also moved the
'Unknown host' logging to when we actually decide that the host is
unknown.


Cheers
Peter Östlin
Attachments
spine.patch
Patch for ping.c
(472 Bytes) Downloaded 89 times
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Please submit a bug to our bug tracker.

http://www.cacti.net/bugs.php

Also, please put in the bug what OS and compiler you are using.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests