confuse-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Confuse-devel] core dump on config parse


From: Vineeth N
Subject: Re: [Confuse-devel] core dump on config parse
Date: Wed, 7 May 2008 09:35:27 +0530

Dear Ben,
 Why don't you compile the program with debug symbols ( -ggdb flag )
and check it with valgrind ( use memcheck ), it will give the exact
reason why the program is crashing.

On Wed, May 7, 2008 at 1:37 AM, Ben <address@hidden> wrote:
> Hello,
>
>  It seems as though I've either run into a bug in Confuse or I'm doing 
> something completely wrong.  My application is segfaulting when parsing the 
> following config (segfaulting on a cfg_getstr() call):
>
>  attack example {
>         application     = "Example Application"
>         version         = "1.0"
>         description     = "This is an example application entry."
>         order           = {"identifier", "foobar"}
>         stage identifier {
>                 target          = "index.php"
>                 method          = "post"
>                 modules             = {"query", "parse", "output"}
>                 query {
>                         request         = "foo=!c&topicid=!t&blah=1"
>                         options         = {"c", "t"}
>                         descriptions    = {"Command", "Topic ID"}
>                         cookies         = {"foobar", "user"}
>                         data                    = {"some cookie data", "!c"}
>                 }
>                 parse {
>                         regex   = {"^<FOOBAR>.*</FOOBAR>$", 
> "([a-zA-Z0-9]){32,32}"}
>                 }
>                 output {
>                         stdout  = "null"
>                         stderr  = "debug"
>                 }
>         }
>         stage foobar {
>                 target  = "postback.php"
>                 method  = "post"
>                 modules = {"sql", "output"}
>                 sql {
>                         # segfaults on action
>                         action = "enumerate"
>                         request = "topicid=!t&blah=1"
>                         enumerate       = "foo"
>                         options         = {"t"}
>                         descriptions    = {"Topic ID"}
>                 }
>                 output {
>                         stdout  = "console"
>                         stdout  = "debug"
>                 }
>         }
>  }
>
>  It dies on action = "enumerate" inside the sql{} section.
>
>  Here is my config definition:
>
>  cfg_opt_t opts_query[] = {
>         CFG_STR("request", NULL, CFGF_NONE),
>         CFG_STR_LIST("options", NULL, CFGF_NONE),
>         CFG_STR_LIST("descriptions", NULL, CFGF_NONE),
>         CFG_STR_LIST("cookies", NULL, CFGF_NONE),
>         CFG_STR_LIST("data", NULL, CFGF_NONE),
>         CFG_END()
>  };
>
>  cfg_opt_t opts_parse[] = {
>         CFG_STR_LIST("regex", NULL, CFGF_NONE),
>         CFG_END()
>  };
>
>  cfg_opt_t opts_output[] = {
>         CFG_STR("stdout", NULL, CFGF_NONE),
>         CFG_STR("stderr", NULL, CFGF_NONE),
>         CFG_END()
>  };
>
>  cfg_opt_t opts_sql[] = {
>                 CFG_STR("action", NULL, CFGF_NONE),
>                 CFG_STR("request", NULL, CFGF_NONE),
>                 CFG_STR("enumerate", NULL, CFGF_NONE),
>                 CFG_STR_LIST("options", NULL, CFGF_NONE),
>                 CFG_STR_LIST("descriptions", NULL, CFGF_NONE),
>                 CFG_END()
>  };
>
>  cfg_opt_t opts_stage[] = {
>                 CFG_STR("target", NULL, CFGF_NONE),
>                 CFG_STR("method", NULL, CFGF_NONE),
>                 CFG_STR_LIST("modules", NULL, CFGF_NONE),
>                 CFG_SEC("query", opts_query, CFGF_NONE),
>                 CFG_SEC("parse", opts_parse, CFGF_NONE),
>                 CFG_SEC("output", opts_output, CFGF_NONE),
>                 CFG_SEC("sql", opts_sql, CFGF_NONE),
>                 CFG_END()
>  };
>
>  cfg_opt_t opts_attack[] = {
>                 CFG_STR("application", NULL, CFGF_NONE),
>                 CFG_STR("version", NULL, CFGF_NONE),
>                 CFG_STR("description", NULL, CFGF_NONE),
>                 CFG_STR_LIST("order", NULL, CFGF_NONE),
>                 CFG_SEC("stage", opts_stage, CFGF_MULTI | CFGF_TITLE),
>                 CFG_END()
>  };
>
>  cfg_opt_t opts[] = {
>                 CFG_SEC("attack", opts_attack, CFGF_MULTI | CFGF_TITLE),
>                 CFG_END()
>  };
>
>
>  And here is the psuedo-code of how I'm attempting to parse this config:
>
>  foreach(module) {
>     store some values
>     foreach(stage) {
>         sql = cfg_getsec(stage, "sql");
>         var = cfg_getstr(sql, "action");  <-- crashes here
>     }
>  }
>
>
>
>  Any help would be greatly appreciated.  Let me know if any additional 
> information is needed.  The dev system
>
>  Thanks in advance,
>  Ben
>
>
>  _______________________________________________
>  Confuse-devel mailing list
>  address@hidden
>  http://lists.nongnu.org/mailman/listinfo/confuse-devel
>



-- 
Regards,
Vineeth Neelakant




reply via email to

[Prev in Thread] Current Thread [Next in Thread]