Xymon Mailing List Archive search

Segmentation Fault (core dumped) with xymond_alert

4 messages in this thread

list John Thurston · Thu, 07 May 2015 08:56:09 -0800 ·
I bumped into this again today. I was working up some new alert 
conditions and tested them with:
xymondmd xymond_alert --config=foo.cfg --test foo.bar.com msgs --color=red
It works as expected if foo.bar.com is defined, but if that host _isn't_ 
defined in the hosts.cfg, xymond_alert core dumps.

For 4/3/17 on Solaris, the stack of the dump looks like:
 fee12d10 strlen   (37c93, ffbf50b4, 96164, 0, 0, 0) + 50
 fee81924 vfprintf (50190, 37c68, ffbf50a8, 0, a0ba4, fee81424) + ec
 0001a554 traceprintf (37c68, af7e8, 96160, 0, 50190, 4b800) + 84
 0001c2fc criteriamatch (7, 55030, 0, 0, 0, 4bc00) + e4
 0001e8b4 next_recipient (aff30, ffbf51a8, 0, 0, 4bc24, 4bc28) + 90
 00017054 send_alert (aff30, 501b0, 0, ffbf51a8, 4bc00, ffff7fe4) + 17c
 00034550 main     (0, 0, 0, 0, 501b0, aff30) + 1368
 00014940 _start   (0, 0, 0, 0, 0, 0) + 5c
Granted that in production xymond_alert will probably not be fed an 
undefined host, but it would be nicer if it handled the condition a 
little more elegantly.

-- 
    Do things because you should, not just because you can.

John Thurston    XXX-XXX-XXXX
user-ce4d79d99bab@xymon.invalid
Enterprise Technology Services
Department of Administration
State of Alaska
list Japheth Cleaver · Thu, 7 May 2015 11:10:21 -0700 ·
quoted from John Thurston
On Thu, May 7, 2015 9:56 am, John Thurston wrote:
I bumped into this again today. I was working up some new alert
conditions and tested them with:
xymondmd xymond_alert --config=foo.cfg --test foo.bar.com msgs
--color=red
It works as expected if foo.bar.com is defined, but if that host _isn't_
defined in the hosts.cfg, xymond_alert core dumps.

For 4/3/17 on Solaris, the stack of the dump looks like:
 fee12d10 strlen   (37c93, ffbf50b4, 96164, 0, 0, 0) + 50
 fee81924 vfprintf (50190, 37c68, ffbf50a8, 0, a0ba4, fee81424) + ec
 0001a554 traceprintf (37c68, af7e8, 96160, 0, 50190, 4b800) + 84
 0001c2fc criteriamatch (7, 55030, 0, 0, 0, 4bc00) + e4
 0001e8b4 next_recipient (aff30, ffbf51a8, 0, 0, 4bc24, 4bc28) + 90
 00017054 send_alert (aff30, 501b0, 0, ffbf51a8, 4bc00, ffff7fe4) + 17c
 00034550 main     (0, 0, 0, 0, 501b0, aff30) + 1368
 00014940 _start   (0, 0, 0, 0, 0, 0) + 5c
Granted that in production xymond_alert will probably not be fed an
undefined host, but it would be nicer if it handled the condition a
little more elegantly.
This looks like another saved-by-glibc-NULL handling thing, unfortunately,
which is why it doesn't show up on the Linux side.

Can you try the attached patch?


-jc
Attachments (1)
list John Thurston · Thu, 07 May 2015 10:45:31 -0800 ·
On 5/7/2015 10:10 AM, J.C. Cleaver wrote:
On Thu, May 7, 2015 9:56 am, John Thurston wrote:
- snip -
xymoncmd xymond_alert --config=foo.cfg --test foo.bar.com msgs
quoted from Japheth Cleaver
--color=red
It works as expected if foo.bar.com is defined, but if that host _isn't_
defined in the hosts.cfg, xymond_alert core dumps.
- snip -
quoted from Japheth Cleaver
This looks like another saved-by-glibc-NULL handling thing, unfortunately,
which is why it doesn't show up on the Linux side.

Can you try the attached patch?
It behaves much better now. Thank you!
Can I assume this will make it into the next release?
quoted from John Thurston

-- 
    Do things because you should, not just because you can.

John Thurston    XXX-XXX-XXXX
user-ce4d79d99bab@xymon.invalid
Enterprise Technology Services
Department of Administration
State of Alaska
list Japheth Cleaver · Thu, 7 May 2015 12:13:58 -0700 ·
quoted from John Thurston
On Thu, May 7, 2015 11:45 am, John Thurston wrote:
On 5/7/2015 10:10 AM, J.C. Cleaver wrote:
On Thu, May 7, 2015 9:56 am, John Thurston wrote:
- snip -
xymoncmd xymond_alert --config=foo.cfg --test foo.bar.com msgs
--color=red
It works as expected if foo.bar.com is defined, but if that host
_isn't_
defined in the hosts.cfg, xymond_alert core dumps.
- snip -
This looks like another saved-by-glibc-NULL handling thing,
unfortunately,
which is why it doesn't show up on the Linux side.

Can you try the attached patch?
It behaves much better now. Thank you!
Can I assume this will make it into the next release?
Yes, just committed.


Regards,

-jc