On a setup i made, when using record_route without topos, the dialogs are well followed
The same setup with topos activated leads to parse_rr() errors like this one:
ERROR: <core> [parser/parse_rr.c:119]: do_parse_rr_body(): parse_rr(): Text after comma missing
I made some SQL captures to see more about the issue, but nothing convincing except topos seems to be looking for a missing record in its database This record seems to have never been recorded
[log-topos.txt](https://github.com/kamailio/kamailio/files/370286/log-topos.txt)
Thank you for your help in diagnosing this issue
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/716
Can you run with debug=3 and attach all the logs printed by kamailio when the error is printed?
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/716#issuecomment-233640691
Thank you for your reply, please find the debug log attached to this message.
parse_rr error happens first at line 5287 note that the same configuration, without topos, works like a charm
[topos-debug.txt](https://github.com/kamailio/kamailio/files/371745/topos-debug.txt)
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/716#issuecomment-233660986
I made some more debug by adding some more loggin in topos_mod.c and parser modules, it seems that some empty lines are added to the Record-Route header, and so, parsing fails.
More precisely it seems that topos use internal headers and zeroes them instead of deleting the lines after usage.
That's whant i understand from my logs, and source code reading, but i have no idea on: - if that's the real reason - if so, how to solve this problem
My additional debugs contains:
ADDING for tps_msg details PARSING for parse_rr details
Please let me know if i can give more details
[topos-verbose-debug.txt](https://github.com/kamailio/kamailio/files/386429/topos-verbose-debug.txt)
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/716#issuecomment-235620776
After more debugging, it seems that the Route header is not well regenerated from topos stored values.
There is a wrong additional comma at the end of the `Route` header:
`sip:A.A.35.90;r2=on;lr;ftag=SD9pnva01-8c51e3a9-0001-0313-0000-0000,`
Instead of
`sip:A.A.35.90;r2=on;lr;ftag=SD9pnva01-8c51e3a9-0001-0313-0000-0000`
I tried to reduce sb size by replacing last character with \0, that makes it work
`*(sb.s-1)='\0';`
between these two lines ``` 638 sb.len++; 639 } ```
but leads, sometimes, to segmentation faults...
There is probably another way to achieve a correct header regeneration, but i don't know how.
Please let me know if i can give you more informations
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/716#issuecomment-236642671
Thanks for tracking this down -- I will see how can be fixed and push the commit for it.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/716#issuecomment-236972605
You're welcome.
After more tries, the segmentation faults don't seem to be related to my patch as : - the segmentation occurs between the database locks release and the "tps_reappend_route" function and simply adding a sleep between database locks releases and it solved (partially) my issue. - more children i use more often the segmentation occurs, and, on the contrary, less threads i use, less often the segmentation occurs - even with removing my patch if i start kamailio with, for example, more than 10 children, children dies and so kamailio exits.
So, it seems the problem is more database locking/releasing related, but that would mean very complicated debugging... i would be unable to do.
Maybe you have more ideas i have... let me know if you need more informations, you would probably be able to reproduce the issue has it only requires to add more children to kamailio process.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/716#issuecomment-237043962
I pushed a patch to master branch to avoid the comma at the end of header -- can you give it a try?
For the segmentation fault, can you get the backtrace with gdb from the coredump file?
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/716#issuecomment-237767261
Thank you, i'll try your patch.
For the coredump, i tried to use gdb but it didn't help as kamailio exists normally... The only informations i have at "crash" are the textual information about threads memory status at "crash" moment. I'll send you these informations, you'll see what i mean...
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/716#issuecomment-237773062
I just tried your patch, it seems to work. I'm trying to reproduce the segfault, for now, without success, i'll tell you.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/716#issuecomment-238541307
OK, thanks for testing and reporting back. Open a new item when you get the segfault.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/716#issuecomment-238555854
Closed #716.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/716#event-749851763