irontec / sngrep

Ncurses SIP Messages flow viewer
GNU General Public License v3.0
1.02k stars 187 forks source link

Segment fault on Ubuntu #389

Closed gbernaldo82 closed 2 years ago

gbernaldo82 commented 2 years ago

Hi, good monring!

I've install sngrep in Ubuntu using the official repositories and when I run the sngrep I can inspect the content of the SIP messages but, when I press the ESC key I allways get a Segment fault. I don't know why I have this problem. I tried to build and install the github version and I have the same problem.

Next I show you a screenshot with the backtrace from GDB: sngrep_segment_fault

If you need more info, please, let me know about it.

My system is an Ubuntu: Distributor ID: Ubuntu Description: Ubuntu 21.10 Release: 21.10 Codename: impish

Thanks in advance!

Kaian commented 2 years ago

Hi!

I was able to reproduce this in a ubuntu docker container. Looks like the offending code is:

https://github.com/irontec/sngrep/blob/5673f9ef0e973a421fd7a039d4dbc65596614da1/src/curses/ui_panel.c#L172-L179

According to documentation del_panel does not remove the window it contains, so we add delwin before deleting the panel. Looks like the funcion has change in recent versions and it segfaults when the window it contains has already been removed, so I decided to reorder those lines and the segfault disappeared.

Please, try to build the above commit and check if the problem persists.

Thanks for reporting!!

gbernaldo82 commented 2 years ago

Yes, that solved my problem!

Thank you so much!

Have a nice day!

Kaian commented 2 years ago

Good to know! This will be available in 1.5.0

Thanks!

wdoekes commented 2 years ago

Backreference from Ubuntu bugs: https://bugs.launchpad.net/ubuntu/+source/sngrep/+bug/1974446