Package: cfengine3 Version: 3.0.5+dfsg-1 Severity: normal The variables policy[1] does not work with list but works with string.
I attach the promise.cf and a gdb trace[2], removing the policy on "list" variable make it works: --8<---------------cut here---------------start------------->8--- /usr/sbin/cf-agent -K -DClass1 R: Redefined in Class1 context R: 0 R: 1 R: 2 R: @(l2) --8<---------------cut here---------------end--------------->8--- Regards. -- System Information: Debian Release: squeeze/sid APT prefers unstable APT policy: (500, 'unstable'), (90, 'experimental') Architecture: amd64 (x86_64) Kernel: Linux 2.6.33.2+hati.1 (SMP w/2 CPU cores; PREEMPT) Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash Versions of packages cfengine3 depends on: ii libc6 2.11.1-3 Embedded GNU C Library: Shared lib ii libdb4.8 4.8.30-1 Berkeley v4.8 Database Libraries [ ii libpcre3 8.02-1 Perl 5 Compatible Regular Expressi ii libssl0.9.8 0.9.8o-1 SSL shared libraries cfengine3 recommends no packages. cfengine3 suggests no packages. -- no debconf information Footnotes: [1] http://www.cfengine.org/manuals/cf3-reference.html#policy-in-vars [2] like described at http://www.cfengine.org/pages/troubleshoot -- Daniel Dehennin Récupérer ma clef GPG: gpg --keyserver pgp.mit.edu --recv-keys 0x6A2540D1
body common control { bundlesequence => { "test" }; version => "0.0.1"; } bundle agent test { vars: any:: "changing" string => "Value in any context", policy => "overridable"; "list" slist => {"0", "@(l1)", "@(l2)"}; Class1:: "l1" slist => {"1", "2"}; "changing" string => "Redefined in Class1 context"; Class2:: "l2" slist => {"3", "4"}; reports: Yr2010:: "$(changing)"; "$(list)"; }
gdb /usr/sbin/cf-agent GNU gdb (GDB) 7.1-debian Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from /usr/sbin/cf-agent...Reading symbols from /usr/lib/debug/usr/sbin/cf-agent...done. done. (gdb) run -v -K -DClass1 Starting program: /usr/sbin/cf-agent -v -K -DClass1 [Thread debugging using libthread_db enabled] cf3 Cfengine - autonomous configuration engine - commence self-diagnostic prelude cf3 ------------------------------------------------------------------------ cf3 Work directory is /home/dad/.cfagent cf3 cf3: INFO: /home/dad/.cfagent/bin is a symbolic link, not a true directory! cf3 Making sure that locks are private... cf3 Checking integrity of the state database cf3 Checking integrity of the module directory cf3 Checking integrity of the PKI directory cf3 Looking for a source of entropy in /home/dad/.cfagent/randseed cf3 Loaded /home/dad/.cfagent/ppkeys/localhost.priv cf3 Loaded /home/dad/.cfagent/ppkeys/localhost.pub cf3 Setting cfengine default port to 5308 = 5308 cf3 Reference time set to Sat Jun 12 14:01:10 2010 cf3 Cfengine - 3.0.5 (C) Cfengine AS 2008- cf3 ------------------------------------------------------------------------ cf3 Host name is: hati cf3 Operating System Type is linux cf3 Operating System Release is 2.6.33.2+hati.1 cf3 Architecture = x86_64 cf3 Using internal soft-class linux for host hati cf3 The time is now Sat Jun 12 14:01:10 2010 cf3 ------------------------------------------------------------------------ cf3 # Extended system discovery is only available in version Nova and above cf3 Additional hard class defined as: 64_bit cf3 Additional hard class defined as: linux_2_6_33_2_hati_1 cf3 Additional hard class defined as: linux_x86_64 cf3 Additional hard class defined as: linux_x86_64_2_6_33_2_hati_1 cf3 GNU autoconf class from compile time: compiled_on_linux_gnu cf3 Address given by nameserver: 192.168.1.2 cf3 Interface 1: lo cf3 Interface 2: eth0 cf3 Adding alias hati.. cf3 Trying to locate my IPv6 address cf3 Found IPv6 address inet6: cf3 Found IPv6 address fe80::21b:fcff:fed8:2c02 cf3 Found IPv6 address inet6: cf3 Looking for environment from cf-monitor... cf3 Unable to detect environment from cfMonitord cf3 This appears to be a debian system. cf3 Looking for Debian version... cf3 No Debian version number found. cf3 *********************************************************** cf3 Loading persistent classes cf3 *********************************************************** cf3 *********************************************************** cf3 Loaded persistent memory cf3 *********************************************************** cf3 > Verifying the syntax of the inputs... cf3 > Parsing file /home/dad/.cfagent/inputs/promises.cf cf3 Initiate variable convergence... cf3 !! Duplicate selection of value for variable "changing" in scope test cf3 Rule from /home/dad/.cfagent/inputs/promises.cf at/before line 20 cf3 Initiate variable convergence... Program received signal SIGSEGV, Segmentation fault. 0x00007ffff698f336 in ?? () from /lib/libc.so.6 (gdb) back #0 0x00007ffff698f336 in ?? () from /lib/libc.so.6 #1 0x0000000000443a97 in GetVariable (scope=0x787740 "test", lval=0x787b30 "list", returnv=0x7fffffffc490, rtype=0x7fffffffc49f "s\005") at vars.c:220 #2 0x000000000044779e in ConvergeVarHashPromise (scope=<value optimized out>, pp=0x787b70, allow_redefine=<value optimized out>) at expand.c:1022 #3 0x000000000041364d in CheckVariablePromises (scope=0x787740 "test", varlist=0x787b70) at generic_agent.c:1377 #4 0x0000000000413722 in HashVariables () at generic_agent.c:1652 #5 0x000000000041507d in Cf3ParseFiles () at generic_agent.c:564 #6 0x00000000004158e3 in ReadPromises (ag=cf_agent, agents=0x466ac1 "agent") at generic_agent.c:197 #7 0x0000000000415d75 in GenericInitialize (argc=4, argv=<value optimized out>, agents=0x466ac1 "agent") at generic_agent.c:100 #8 0x00000000004065e7 in main (argc=4, argv=0x7fffffffe6d8) at agent.c:146
pgpNYdE59Dgxf.pgp
Description: PGP signature