I'm was playing around with yangcli 2.14.0 (master build from a month ago) and found it really useful as netconf cli frontend.
While doing some performance tests with huge configurations, yangcli segfaulted when executing the "edit-config" command.
(The size of the config xml file is around 30 MiB, so it is definitely not a common use case.)
Some debug info:
The segfault happens when building the rpc in mgr_rpc_send_request().
scb->outbuff becomes invalid (NULL) in xml_wr_full_val() and ses_finish_msg() tries to deref it. (scb->outbuff->islast = TRUE;)
scb->outbuff is set to NULL because there are no more buffers available. (see ses_msg_new_buff() + ses_msg_new_output_buff())
The return value ERR_NCX_RESOURCE_DENIED is not properly evaluated in the calling functions.
Default buffer size is 2000 and SES_MAX_BUFFERS is 4096, so I assume it will start segfaulting at around 8 MB.
I can of course just patch the code to allow more or larger buffers.
But maybe someone wants to do a proper fix for this.
I'm was playing around with yangcli 2.14.0 (master build from a month ago) and found it really useful as netconf cli frontend. While doing some performance tests with huge configurations, yangcli segfaulted when executing the "edit-config" command. (The size of the config xml file is around 30 MiB, so it is definitely not a common use case.)
Some debug info: The segfault happens when building the rpc in
mgr_rpc_send_request()
.scb->outbuff
becomes invalid (NULL) inxml_wr_full_val()
andses_finish_msg()
tries to deref it. (scb->outbuff->islast = TRUE;
)scb->outbuff
is set toNULL
because there are no more buffers available. (seeses_msg_new_buff()
+ses_msg_new_output_buff()
) The return valueERR_NCX_RESOURCE_DENIED
is not properly evaluated in the calling functions.Default buffer size is 2000 and
SES_MAX_BUFFERS
is 4096, so I assume it will start segfaulting at around 8 MB.I can of course just patch the code to allow more or larger buffers. But maybe someone wants to do a proper fix for this.