-
Notifications
You must be signed in to change notification settings - Fork 83
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
crash when deleting session #205
Comments
Are you on current master (59f5ba5)? The mentioned lines do not match what you describe (e.g. 1418 is comment). Ideally, try to test it with The |
yes I'm in the master branch, sorry I've added some debug logs and forgot about them when writting the issue. valgrind is not possible right now because I'm only able to reproduce this in target (ppc) until now I was not able to reproduce it in x86. regarding setting the variable to NULL sure, I'm doing it. |
Actually you can call I have one idea about the issue, just please answer me the following questions:
|
1- I call nc_init with (NC_INIT_ALL & ~NC_INIT_NACM) | NC_INIT_MULTILAYER |
hmm, then it is weird that the session is not found in the
Calling |
or could it be that during the delete/create of other sessions the prev and next offset are not correctly linked so the session that I'm trying to delete is not found while iterating in the list but in fact its there (just not linked to the others)? |
yes, bug in |
after adding some logs I found something strange. |
Do you know which part of the |
unfortunately not, I add prints in nc_session_monitor_remove and in nc_session_free only. I notice that nc_session_monitor_remove is called not from the nc_session_free and when session free is being called (afterwards) I get negative session_list->count also this is only happening in ppc. |
its the last one (pfd == NULL) this happens everytime I do a get all on target (ppc) |
can you provide the output of the following command on the target system? The
There should be a symlink to |
If not, then, during the libnetconf init, there should be some error message from libnetconf about "sessions monitoring file" or the "session list". |
I think I got the problem: lrwx------ 1 root root 64 May 3 00:41 20 -> /var/volatile/tmp/netconf/libnetconf_sessions.bin but the files aux is /tmp/netconf/libnetconf_sessions.bin if I do a "readlink -f /tmp/mf_communication_log.log" /tmp in my system is a link to volatile/tmp I think in the lib code you should have a readlink of the aux to get the canonical file name |
or I can change it to /var/volatile/tmp/netconf/libnetconf_sessions.bin |
I'm going to fix it |
thanks a lot :) |
Hi,
I have sometimes a crash, when some network problems occur and I have several sessions connected and monitored at the same time.
this is not so easy to reproduce, so also not easy to analyse. Here is what I already found until now and my suspicions:
with this evidences it seems that the lib detects the failure before my server and deletes the session.
then I try to delete the same session and I get this crash (at least this is my theory for now).
In the beginning of nc_session_free we can see the check if (session == NULL) but session is never set to NULL inside the lib (or at least I didn't find where).
The struct nc_session* that I give to the nc_session_free is obtained when the session is establish with the method nc_session_accept_inout
Since the session is never set to NULL inside the lib, should I check some flag inside nc_session struct before I call the nc_session_free?
thanks
Best Regards
The text was updated successfully, but these errors were encountered: