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 #11106] Too many assign where filters cause stack overflow #3907

Closed
icinga-migration opened this issue Feb 7, 2016 · 15 comments

Comments

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

commented Feb 7, 2016

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

Created by PowellEB on 2016-02-07 14:59:41 +00:00

Assignee: gbeutner
Status: Resolved (closed on 2016-03-23 07:44:37 +00:00)
Target Version: 2.4.5
Last Update: 2016-04-20 08:15:52 +00:00 (in Redmine)

Icinga Version: 2.4.1
Backport?: Already backported

I have a custom variable created from ansible that defines values for checks to be used against the server.

example:

vars_app["AOT"] = { server_type="DB", sid="AOT", sysno="00", type="ABAP", product="ERP", database="MSSQL"}

applying a service using the custom var is no problem.

apply Service "sapcheck_ABAP_" for (app_id => config in host.vars_app) {
    import "sap-service"
    vars += config 
    ....
    assign where config.type=="ABAP"

The problem is I need to also assign a HostGroup based upon the custom var and internal value.
the identifier could be anything "AOT" in this example

This works -

object HostGroup "sap-servers-abap" {
 display_name = "APP: SAP ABAP"
 assign where host.vars_app["AOT"].type=="ABAP"
}

However, I need something like this that has a wildcard for the identifier......

object HostGroup "sap-servers-abap" {
 display_name = "APP: SAP ABAP"
 assign where host.vars_app["*"].type=="ABAP"
}

This returns no assignments, how do i put a wildcard for the identifier?

**
Fyi, since ansible knows all the identifiers, option two was to have it create
The object HostGroup with each possible identifier, but this caused
a segmentation fault, and would not complete a config check.

it created 1364 entries

object HostGroup "type-abap" {
    display_name = "TYPE: ABAP"
    assign where host.vars.vars_app["AAD"].type=="ABAP"
    ......(1364 assign lines)...........
    assign where host.vars.vars_app["ZES"].type=="ABAP"
}

information/ConfigItem: Committing config items
Segmentation fault

Attachments

Changesets

2016-03-23 07:42:26 +00:00 by (unknown) b9c2fc9

Implement recursion limit for AST expressions which don't use a separate stack frame

fixes #11106

2016-03-23 08:03:49 +00:00 by (unknown) 6ba0c5f

Implement recursion limit for AST expressions which don't use a separate stack frame

fixes #11106

2016-04-20 08:07:22 +00:00 by (unknown) ba3eeaf

Implement recursion limit for AST expressions which don't use a separate stack frame

fixes #11106

Relations:

@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Feb 8, 2016

Updated by gbeutner on 2016-02-08 07:31:26 +00:00

  • Tracker changed from Support to Bug
  • Project changed from Icinga Web 2 to Icinga 2
  • Icinga Version set to 2
@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Feb 8, 2016

Updated by gbeutner on 2016-02-08 07:31:42 +00:00

Which version are you using?

@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Feb 8, 2016

Updated by gbeutner on 2016-02-08 07:32:27 +00:00

  • Description updated
@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Feb 8, 2016

Updated by gbeutner on 2016-02-08 07:33:39 +00:00

  • Category set to Configuration
  • Status changed from New to Feedback
  • Assigned to set to PowellEB

Also, can you provide a minimal example config that demonstrates the crash?

@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Feb 8, 2016

Updated by PowellEB on 2016-02-08 11:52:56 +00:00

  • File added example_type.conf

v.2.4.1 (snapshot 2016 02 06).
used the attached conf, and kept removing assigns until check config passed.
Segmentation fault stopped when I had < 600 assigns for the HostGroup object.

@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Feb 8, 2016

Updated by PowellEB on 2016-02-08 11:54:48 +00:00

hosts: 3200
services: 71220

@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Mar 4, 2016

Updated by mfriedrich on 2016-03-04 13:33:58 +00:00

  • Status changed from Feedback to New
  • Assigned to deleted PowellEB
@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Mar 17, 2016

Updated by mfriedrich on 2016-03-17 14:57:53 +00:00

  • Relates set to 11402
@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Mar 17, 2016

Updated by mfriedrich on 2016-03-17 14:59:01 +00:00

We should probably limit the number of assign where expressions.

I'm not sure who asked if better approaches are documented, but I've added such bits when resolving #11402.

@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Mar 18, 2016

Updated by mfriedrich on 2016-03-18 13:55:01 +00:00

  • Status changed from New to Assigned
  • Assigned to set to gbeutner

Hi Gunnar,

we've already discussed limiting the assign where expressions this week. Can you please look into a patch?

Thanks,
Michael

@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Mar 23, 2016

Updated by gbeutner on 2016-03-23 07:43:06 +00:00

  • Target Version set to 2.4.5
@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Mar 23, 2016

Updated by Anonymous on 2016-03-23 07:44:37 +00:00

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

Applied in changeset b9c2fc9.

@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Mar 23, 2016

Updated by gbeutner on 2016-03-23 08:05:00 +00:00

  • Duplicated set to 7155
@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Apr 7, 2016

Updated by mfriedrich on 2016-04-07 08:14:45 +00:00

  • Subject changed from assigning hostgroup based upon custom value in array, option#2 causes segmentation fault to Too many assign where filters cause stack overflow
@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Apr 20, 2016

Updated by gbeutner on 2016-04-20 08:15:52 +00:00

  • Backport? changed from __ to Already backported
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.