Valgrind fixes

This commit is contained in:
Olof hagsand 2023-09-28 17:31:14 +02:00
parent 520f20def5
commit 794a17c2bb
5 changed files with 32 additions and 17 deletions

View file

@ -44,12 +44,29 @@
## 6.4.0
Expected: October 2023
Clixon 6.4.0 features mainly bugfixes and improvements of existing functionality, such as CLI output pipes.
### API changes on existing protocol/config features
Users may have to change how they access the system
* New `clixon-autocli@2023-09-01.yang` revision
* Added argument to alias extension
### Minor features
* CLI show compare example function:
* Improved diff algorithm for XML and TEXT/curly, replaced UNIX diff with structural in-mem algorithm
* JSON: Added unicode BMP support for unicode strings as part of fixing (https://github.com/clicon/clixon/issues/453)
* Example cli pipe grep command quotes vertical bar for OR function
* Added: [Feature request: node's alias for CLI](https://github.com/clicon/clixon/issues/434)
* Note: "Skip" is for all nodes, but "Alias" is only for leafs
* New command-line option for dumping configuration options for all clixon applications after load
* Syntax is `-C <format>`
* Example: `clixon_backend -1C json`
* Removed sending restconf config inline using -R when CLICON_BACKEND_RESTCONF_PROCESS=true
* Define RESTCONF_INLINE to revert
* Clarified clixon_cli command-line: `clixon_cli [options] [commands] [-- extra-options]`
### C/CLI-API changes on existing features
Developers may need to change their code
@ -74,21 +91,6 @@ Developers may need to change their code
* CLI pipe function: added arg to `pipe_tail_fn()`
### Minor features
* CLI show compare example function:
* Improved diff algorithm for XML and TEXT/curly, replaced UNIX diff with structural in-mem algorithm
* JSON: Added unicode BMP support for unicode strings as part of fixing (https://github.com/clicon/clixon/issues/453)
* Example cli pipe grep command quotes vertical bar for OR function
* Added: [Feature request: node's alias for CLI](https://github.com/clicon/clixon/issues/434)
* Note: "Skip" is for all nodes, but "Alias" is only for leafs
* New command-line option for dumping configuration options for all clixon applications after load
* Syntax is `-C <format>`
* Example: `clixon_backend -1C json`
* Removed sending restconf config inline using -R when CLICON_BACKEND_RESTCONF_PROCESS=true
* Define RESTCONF_INLINE to revert
* Clarified clixon_cli command-line: `clixon_cli [options] [commands] [-- extra-options]`
### Corrected Bugs
* Fixed: ["show compare" and "show compare | display cli" differs #23](https://github.com/clicon/clixon-controller/issues/23)

View file

@ -48,6 +48,7 @@ struct clixon_json_yacc {
cxobj *jy_current; /* cxobj active element (changes with parse context) */
cxobj **jy_xvec; /* Vector of created top-level nodes (to know which are created) */
int jy_xlen; /* Length of jy_xvec */
cbuf *jy_cbuf_str; /* cbuf used for strings, if error needs to be deallocated */
};
typedef struct clixon_json_yacc clixon_json_yacc;

View file

@ -156,6 +156,8 @@ clixon_json_parseerror(void *_jy,
_JY->jy_linenum ,
s,
clixon_json_parsetext);
if (_JY->jy_cbuf_str)
cbuf_free(_JY->jy_cbuf_str);
return;
}
@ -282,7 +284,7 @@ value : J_TRUE { json_current_body(_JY, "true"); _PARSE_DEBUG("va
| object { _PARSE_DEBUG("value->object"); }
| array { _PARSE_DEBUG("value->array"); }
| number { json_current_body(_JY, $1); free($1); _PARSE_DEBUG("value->number");}
| string { json_current_body(_JY, cbuf_get($1)); cbuf_free($1); _PARSE_DEBUG("value->string");}
| string { json_current_body(_JY, cbuf_get($1)); cbuf_free($1); _JY->jy_cbuf_str = NULL; _PARSE_DEBUG("value->string");}
;
@ -294,7 +296,7 @@ objlist : pair { _PARSE_DEBUG("objlist->pair");}
| objlist ',' pair { _PARSE_DEBUG("objlist->objlist , pair");}
;
pair : string { json_current_new(_JY, cbuf_get($1));cbuf_free($1);} ':'
pair : string { json_current_new(_JY, cbuf_get($1));cbuf_free($1); _JY->jy_cbuf_str = NULL;} ':'
value { json_current_pop(_JY);}{ _PARSE_DEBUG("pair->string : value");}
;
@ -320,6 +322,7 @@ ustring : ustring J_STRING
| J_STRING
{
cbuf *cb = cbuf_new();
_JY->jy_cbuf_str = cb;
cbuf_append_str(cb,$1);
$$=cb;
}

View file

@ -98,6 +98,8 @@ The `mem.sh` runs memory checks using valgrind. Start it with no arguments to te
mem.sh restconf backend # Only backend and cli
```
Valgrind uses a suppression file `valgrind-clixon.supp` to filter dlopen functions
## Run pattern of tests
The above scripts work with the `pattern` variable to limit the scope of which tests run, eg:

View file

@ -29,6 +29,13 @@
fun:*
fun:_dl_check_map_versions
}
{
supp4.1
Memcheck:Leak
match-leak-kinds: reachable
fun:*
fun:_dl_check_map_versions
}
{
supp5
Memcheck:Leak