Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dev.icinga.com #11646] Wrong log severity causes segfault #4145

Closed
icinga-migration opened this issue Apr 21, 2016 · 4 comments

Comments

Projects
None yet
1 participant
@icinga-migration
Copy link
Member

commented Apr 21, 2016

This issue has been migrated from Redmine: https://dev.icinga.com/issues/11646

Created by DG3AZ on 2016-04-21 11:30:33 +00:00

Assignee: gbeutner
Status: Resolved (closed on 2016-04-21 11:51:43 +00:00)
Target Version: 2.4.8
Last Update: 2016-04-21 11:56:02 +00:00 (in Redmine)

Icinga Version: 2.4.4-1
Backport?: Not yet backported
Include in Changelog: 1

Hi,

I'm using icinga2 on Debian Jessie, installed from http://packages.icinga.org/debian.

I've changed the log severity in /etc/icinga2/features-enabled/mainlog.conf wrongly to "info" and not to "information". The daemon crashes now with a segfault:

root@icinga-hh-a:/etc/icinga2/features-enabled# icinga2 daemon -x information
[2016-04-21 13:27:21 +0200] information/cli: Icinga application loader (version: r2.4.4-1)
[2016-04-21 13:27:21 +0200] information/ConfigCompiler: Compiling config file: /etc/icinga2/icinga2.conf
[2016-04-21 13:27:21 +0200] information/ConfigCompiler: Compiling config file: /etc/icinga2/constants.conf
[2016-04-21 13:27:21 +0200] information/ConfigCompiler: Compiling config file: /etc/icinga2/zones.conf
[2016-04-21 13:27:21 +0200] information/ConfigCompiler: Compiling config file: /usr/share/icinga2/include/itl
[2016-04-21 13:27:21 +0200] information/ConfigCompiler: Compiling config file: /usr/share/icinga2/include/command.conf
[2016-04-21 13:27:21 +0200] information/Utility: Loading library 'libmethods.so'
[2016-04-21 13:27:21 +0200] information/ConfigCompiler: Compiling config file: /usr/share/icinga2/include/command-icinga.conf
[2016-04-21 13:27:21 +0200] information/ConfigCompiler: Compiling config file: /usr/share/icinga2/include/timeperiod.conf
[2016-04-21 13:27:21 +0200] information/ConfigCompiler: Compiling config file: /usr/share/icinga2/include/plugins
[2016-04-21 13:27:21 +0200] information/ConfigCompiler: Compiling config file: /usr/share/icinga2/include/command-plugins.conf
[2016-04-21 13:27:21 +0200] information/ConfigCompiler: Compiling config file: /usr/share/icinga2/include/plugins-contrib
[2016-04-21 13:27:21 +0200] information/ConfigCompiler: Compiling config file: /usr/share/icinga2/include/plugins-contrib.d/databases.conf
[2016-04-21 13:27:21 +0200] information/ConfigCompiler: Compiling config file: /usr/share/icinga2/include/plugins-contrib.d/hardware.conf
[2016-04-21 13:27:21 +0200] information/ConfigCompiler: Compiling config file: /usr/share/icinga2/include/plugins-contrib.d/ipmi.conf
[2016-04-21 13:27:21 +0200] information/ConfigCompiler: Compiling config file: /usr/share/icinga2/include/plugins-contrib.d/network-components.conf
[2016-04-21 13:27:21 +0200] information/ConfigCompiler: Compiling config file: /usr/share/icinga2/include/plugins-contrib.d/operating-system.conf
[2016-04-21 13:27:21 +0200] information/ConfigCompiler: Compiling config file: /usr/share/icinga2/include/plugins-contrib.d/virtualization.conf
[2016-04-21 13:27:21 +0200] information/ConfigCompiler: Compiling config file: /usr/share/icinga2/include/plugins-contrib.d/vmware.conf
[2016-04-21 13:27:21 +0200] information/ConfigCompiler: Compiling config file: /usr/share/icinga2/include/plugins-contrib.d/web.conf
[2016-04-21 13:27:21 +0200] information/ConfigCompiler: Compiling config file: /etc/icinga2/features-enabled/api.conf
[2016-04-21 13:27:21 +0200] information/ConfigCompiler: Compiling config file: /etc/icinga2/features-enabled/checker.conf
[2016-04-21 13:27:21 +0200] information/ConfigCompiler: Compiling config file: /etc/icinga2/features-enabled/ido-mysql.conf
[2016-04-21 13:27:21 +0200] information/ConfigCompiler: Compiling config file: /etc/icinga2/features-enabled/livestatus.conf
[2016-04-21 13:27:21 +0200] information/ConfigCompiler: Compiling config file: /etc/icinga2/features-enabled/mainlog.conf
[2016-04-21 13:27:21 +0200] information/ConfigCompiler: Compiling config file: /etc/icinga2/features-enabled/notification.conf
[2016-04-21 13:27:21 +0200] information/ConfigCompiler: Compiling config file: /etc/icinga2/features-enabled/perfdata.conf
[2016-04-21 13:27:21 +0200] information/Utility: Loading library 'libchecker.so'
[2016-04-21 13:27:21 +0200] information/Utility: Loading library 'libdb_ido_mysql.so'
[2016-04-21 13:27:21 +0200] information/Utility: Loading library 'liblivestatus.so'
[2016-04-21 13:27:21 +0200] information/Utility: Loading library 'libnotification.so'
[2016-04-21 13:27:21 +0200] information/Utility: Loading library 'libperfdata.so'
[2016-04-21 13:27:21 +0200] information/ConfigCompiler: Compiling config file: /etc/icinga2/conf.d/api-users.conf
[2016-04-21 13:27:21 +0200] information/ConfigCompiler: Compiling config file: /etc/icinga2/conf.d/app.conf
[2016-04-21 13:27:21 +0200] information/ConfigCompiler: Compiling config file: /etc/icinga2/conf.d/commands.conf
[2016-04-21 13:27:21 +0200] information/ConfigCompiler: Compiling config file: /etc/icinga2/conf.d/downtimes.conf
[2016-04-21 13:27:21 +0200] information/ConfigCompiler: Compiling config file: /etc/icinga2/conf.d/groups.conf
[2016-04-21 13:27:21 +0200] information/ConfigCompiler: Compiling config file: /etc/icinga2/conf.d/notifications.conf
[2016-04-21 13:27:21 +0200] information/ConfigCompiler: Compiling config file: /etc/icinga2/conf.d/satellite.conf
[2016-04-21 13:27:21 +0200] information/ConfigCompiler: Compiling config file: /etc/icinga2/conf.d/services.conf
[2016-04-21 13:27:21 +0200] information/ConfigCompiler: Compiling config file: /etc/icinga2/conf.d/templates.conf
[2016-04-21 13:27:21 +0200] information/ConfigCompiler: Compiling config file: /etc/icinga2/conf.d/timeperiods.conf
[2016-04-21 13:27:21 +0200] information/ConfigCompiler: Compiling config file: /etc/icinga2/conf.d/users.conf
[2016-04-21 13:27:21 +0200] information/ConfigItem: Committing config items
[2016-04-21 13:27:21 +0200] information/ApiListener: My API identity: icinga-hh-a
[2016-04-21 13:27:21 +0200] warning/ApplyRule: Apply rule 'satellite-host' (in /etc/icinga2/conf.d/satellite.conf: 29:1-29:41) for type 'Dependency' does not match anywhere!
[2016-04-21 13:27:21 +0200] warning/ApplyRule: Apply rule 'mail-icingaadmin' (in /etc/icinga2/conf.d/notifications.conf: 11:1-11:45) for type 'Notification' does not match anywhere!
[2016-04-21 13:27:21 +0200] warning/ApplyRule: Apply rule 'mail-icingaadmin' (in /etc/icinga2/conf.d/notifications.conf: 20:1-20:48) for type 'Notification' does not match anywhere!
[2016-04-21 13:27:21 +0200] warning/ApplyRule: Apply rule 'backup-downtime' (in /etc/icinga2/conf.d/downtimes.conf: 5:1-5:52) for type 'ScheduledDowntime' does not match anywhere!
[2016-04-21 13:27:21 +0200] warning/ApplyRule: Apply rule 'ssh' (in /etc/icinga2/conf.d/services.conf: 47:1-47:19) for type 'Service' does not match anywhere!
[2016-04-21 13:27:21 +0200] warning/ApplyRule: Apply rule '' (in /etc/icinga2/conf.d/services.conf: 57:1-57:65) for type 'Service' does not match anywhere!
[2016-04-21 13:27:21 +0200] warning/ApplyRule: Apply rule '' (in /etc/icinga2/conf.d/services.conf: 65:1-65:53) for type 'Service' does not match anywhere!
[2016-04-21 13:27:21 +0200] information/ConfigItem: Instantiated 1 FileLogger.
[2016-04-21 13:27:21 +0200] information/ConfigItem: Instantiated 1 ApiUser.
[2016-04-21 13:27:21 +0200] information/ConfigItem: Instantiated 1 ApiListener.
[2016-04-21 13:27:21 +0200] information/ConfigItem: Instantiated 3 Zones.
[2016-04-21 13:27:21 +0200] information/ConfigItem: Instantiated 3 Endpoints.
[2016-04-21 13:27:21 +0200] information/ConfigItem: Instantiated 1 NotificationComponent.
[2016-04-21 13:27:21 +0200] information/ConfigItem: Instantiated 154 CheckCommands.
[2016-04-21 13:27:21 +0200] information/ConfigItem: Instantiated 2 NotificationCommands.
[2016-04-21 13:27:21 +0200] information/ConfigItem: Instantiated 1 IcingaApplication.
[2016-04-21 13:27:21 +0200] information/ConfigItem: Instantiated 2 HostGroups.
[2016-04-21 13:27:21 +0200] information/ConfigItem: Instantiated 1 User.
[2016-04-21 13:27:21 +0200] information/ConfigItem: Instantiated 1 UserGroup.
[2016-04-21 13:27:21 +0200] information/ConfigItem: Instantiated 3 TimePeriods.
[2016-04-21 13:27:21 +0200] information/ConfigItem: Instantiated 3 ServiceGroups.
[2016-04-21 13:27:21 +0200] information/ConfigItem: Instantiated 1 CheckerComponent.
[2016-04-21 13:27:21 +0200] information/ConfigItem: Instantiated 1 IdoMysqlConnection.
[2016-04-21 13:27:21 +0200] information/ConfigItem: Instantiated 1 LivestatusListener.
[2016-04-21 13:27:21 +0200] information/ConfigItem: Instantiated 1 PerfdataWriter.
[2016-04-21 13:27:21 +0200] information/ScriptGlobal: Dumping variables to file '/var/cache/icinga2/icinga2.vars'
[2016-04-21 13:27:21 +0200] information/ConfigObject: Restoring program state from file '/var/lib/icinga2/icinga2.state'
[2016-04-21 13:27:21 +0200] information/ConfigObject: Restored 181 objects. Loaded 0 new objects without state.
[2016-04-21 13:27:21 +0200] information/ConfigItem: Triggering Start signal for config items
[2016-04-21 13:27:21 +0200] information/ApiListener: Adding new listener on port '5665'
[2016-04-21 13:27:21 +0200] information/JsonRpcConnection: Reconnecting to API endpoint 'icinga-ams5-a' via host 'icinga-ams5-a' and port '5665'
Segmentation fault

dmesg:

[ 8995.344666] icinga2[3540]: segfault at 7f1b610feff8 ip 00007f1b669290d9 sp 00007f1b610ff000 error 6 in libstdc**.so.6.0.20[7f1b668c9000+ec000]

I think there should be a clearly error message for unknown severity. I've searched a while for the problem. ;-)

Regards,
André

Changesets

2016-04-21 11:50:47 +00:00 by gbeutner 2d55cf1

Implement validation for the Logger#severity attribute

fixes #11646

2016-05-12 09:08:19 +00:00 by gbeutner 597d300

Implement validation for the Logger#severity attribute

fixes #11646
@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Apr 21, 2016

Updated by gbeutner on 2016-04-21 11:37:32 +00:00

  • Status changed from New to Assigned
  • Assigned to set to gbeutner
  • Target Version set to 2.4.8

Well, uh, this is somewhat embarassing... Apparently the logger class tries to log a message about the invalid severity:

[lots of frames omitted]
    frame #1565: 0x000000010086a2ab libbase.dylib`icinga::Logger::StringToSeverity(icinga::String const&) + 731
    frame #1566: 0x0000000100869f62 libbase.dylib`icinga::Logger::GetMinSeverity() const + 66
    frame #1567: 0x0000000100869c10 libbase.dylib`icinga::IcingaLog(icinga::LogSeverity, icinga::String const&, icinga::String const&) + 1312
    frame #1568: 0x00000001007ea04b libbase.dylib`icinga::Log::~Log() + 75
    frame #1569: 0x000000010086a2ab libbase.dylib`icinga::Logger::StringToSeverity(icinga::String const&) + 731
    frame #1570: 0x0000000100869f62 libbase.dylib`icinga::Logger::GetMinSeverity() const + 66
    frame #1571: 0x0000000100869c10 libbase.dylib`icinga::IcingaLog(icinga::LogSeverity, icinga::String const&, icinga::String const&) + 1312
    frame #1572: 0x0000000105bce8bb libdb_ido.dylib`icinga::Log::~Log() + 75
    frame #1573: 0x0000000105bbd8c7 libdb_ido.dylib`icinga::DbConnection::Resume() + 455
    frame #1574: 0x000000010577b848 libdb_ido_mysql.dylib`icinga::IdoMysqlConnection::Resume() + 24
    frame #1575: 0x0000000100821b1c libbase.dylib`icinga::ConfigObject::Activate(bool) + 988
    frame #1576: 0x00000001008dff76 libbase.dylib`icinga::WorkQueue::WorkerThreadProc() + 1542
    frame #1577: 0x000000010003c715 libboost_thread-mt.dylib`boost::(anonymous namespace)::thread_proxy(void*) + 53
    frame #1578: 0x00007fff96b1e99d libsystem_pthread.dylib`_pthread_body + 131
    frame #1579: 0x00007fff96b1e91a libsystem_pthread.dylib`_pthread_start + 168
    frame #1580: 0x00007fff96b1c351 libsystem_pthread.dylib`thread_start + 13
@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Apr 21, 2016

Updated by gbeutner on 2016-04-21 11:51:26 +00:00

Here's the new error message:

[2016-04-21 13:50:27 +0200] critical/config: Error: Validation failed for object 'main-log' of type 'FileLogger'; Attribute 'severity': Invalid severity specified: info
Location: in /Users/gunnar/i2/etc/icinga2/features-enabled/mainlog.conf: 6:3-6:19
/Users/gunnar/i2/etc/icinga2/features-enabled/mainlog.conf(4):
/Users/gunnar/i2/etc/icinga2/features-enabled/mainlog.conf(5): object FileLogger "main-log" {
/Users/gunnar/i2/etc/icinga2/features-enabled/mainlog.conf(6):   severity = "info"
                                                                 ^^^^^^^^^^^^^^^^^
/Users/gunnar/i2/etc/icinga2/features-enabled/mainlog.conf(7):   path = LocalStateDir + "/log/icinga2/icinga2.log"
/Users/gunnar/i2/etc/icinga2/features-enabled/mainlog.conf(8): }

[2016-04-21 13:50:27 +0200] critical/config: 1 error
@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Apr 21, 2016

Updated by gbeutner on 2016-04-21 11:51:43 +00:00

  • Status changed from Assigned to Resolved
  • Done % changed from 0 to 100

Applied in changeset 2d55cf1.

@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Apr 21, 2016

Updated by DG3AZ on 2016-04-21 11:56:02 +00:00

Great!

I will try this in 2.4.8. ;-)

Thanks for the quick solution.

Regards,
André

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.