Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yangcli segfaults when using large configs (> 8 MB) in "edit-config" command #137

Open
AndreasHuebner-ae opened this issue Jul 25, 2023 · 1 comment

Comments

@AndreasHuebner-ae
Copy link

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.

@vlvassilev
Copy link
Owner

Good catch. I have it on my list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants