[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freediameter-help
Subject:    [Help] Problem with function fd_dict_getlistof
From:       sdecugis () freediameter ! net (Sebastien Decugis)
Date:       2015-08-10 22:52:49
Message-ID: 55C92B41.9000009 () freediameter ! net
[Download RAW message or body]

Hello Vincent,

Sorry for the delay. Your code looks correct; it seems the dictionary 
content is corrupted by some other factor and the error you see is just 
the result of corrupt dictionary.
- are you trying to modify the content of the dictionary in your code?
- otherwise, maybe try using valgrind or similar tool to find out if 
your are corrupting that memory randomly...

Sorry for not being more helpful here.

Kind regards,
Sebastien.

Le 04/08/2015 23:00, Vincent Broucke a écrit :
>
> Hello, I am emailing you again further to my mail of 10-06-2015 
> because I haven't got a response :
>
> Hello,
>
> We are encountering a problem with the following function : 
> *fd_dict_getlistof.*
>
> We are trying to log the avp name contained in a rule for a command code.
>
> The problem doesn't occurs every time : sometimes this function 
> produces an incorrect list.
>
> The problem occurs when we try to retrieve the avp data of an avp with 
> the following function :
>
> *fd_dict_getval(ruledata.rule_avp, &avpdata);*
>
> This function calls macro CHECK_PARAMS and doesn't success because 
> members of the structure ruledata.rule_avp are not correct.
>
> This error could occurs for many differents elements in the list :
>
> ERROR: Invalid parameter 'obj && (obj->objeyec == OBJECT_EYECATCHER) 
> && CHECK_TYPE(obj->type) && (obj->typeyec == 
> dict_obj_info[obj->type].eyecatcher)', 22
>
> ERROR: Invalid object: 0xf753b0, obj->objeyec: *0/b13c7*, obj->type: 
> 16181216, obj->objeyec: *0/b13c7*, obj->typeyec: *a779ced8/0*
>
> ERROR: Invalid parameter '(val && verify_object(object))', 22
>
> ERROR: Invalid parameter 'obj && (obj->objeyec == OBJECT_EYECATCHER) 
> && CHECK_TYPE(obj->type) && (obj->typeyec == 
> dict_obj_info[obj->type].eyecatcher)', 22
>
> ERROR: Invalid object: 0x163a440, obj->objeyec: *7f93/b13c7*, 
> obj->type: -292036904, obj->objeyec: *7f93/b13c7*, obj->typeyec: 163a890/0
>
> ERROR: Invalid parameter '(val && verify_object(object))', 22
>
> Have you an idea of what we are doing wrong ?
>
>
>
> Here is the code that produces this error :
>
> /* Browse rules of this avp/cmd */
>
>                         struct fd_list * li;
>
>                         struct fd_list * sentinel;
>
> *fd_dict_getlistof*(RULE_BY_AVP_AND_PARENT, parent, &sentinel);
>
>                         int currentElement = 0;
>
>                         //xlog("DICT OBJ Rules :");
>
>                         for (li = sentinel->next; li != sentinel; 
> li=li->next) {
>
>                                 struct dict_object * liobj = li->o;
>
>                                 struct dict_rule_data ruledata;;
>
> fd_dict_getval(liobj, &ruledata);
>
>                                 struct dict_avp_data avpdata;
>
> *fd_dict_getval(ruledata.rule_avp, &avpdata); // BUG HERE*
>
> xlog("[%d] %s == %s", currentElement, avpdata.avp_name, (char 
> *)r->avpname);
>
> //xlog("   Rule for\tavp=%s\t\tposition=%d\torder=%d\tmin=%d\tmax=%d", 
> avpdata.avp_name, ruledata.rule_position, ruledata.rule_order, 
> ruledata.rule_min, ruledata.rule_max);
>
>                                 /* rTr */
>
> if(strcmp(avpdata.avp_name, (char *)r->avpname)==0) {
>
> //xlog("\t\t\tTHIS ONE ^");
>
> struct fd_list * previous = li->prev;
>
>                            fd_list_unlink(li);
>
> li=previous;
>
>                                 }
>
> currentElement++;
>
> }
>
> Thank you for your help.
>
>
>
> _______________________________________________
> Help mailing list
> Help at freediameter.net
> http://lists.freediameter.net/cgi-bin/mailman/listinfo/help

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freediameter.net/pipermail/help/attachments/20150811/76908287/attachment.html>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic