[SRU] sngrep in Jammy segfaults in del_panel (fixed upstream)

Bug #1974446 reported by Walter
38
This bug affects 6 people
Affects Status Importance Assigned to Milestone
sngrep (Ubuntu)
Fix Released
Undecided
Unassigned
Jammy
Fix Released
Medium
Unassigned

Bug Description

[ Impact ]

sngrep results in a segfault when the user tries to exit the display screen.
It is not unusable for this issue but the user will not expect an error message about a segmentation fault with a coredump while trying to exit the display.

[ Test Plan ]

* Create an offline pcap file with the command:
printf '\xd4\xc3\xb2\xa1\x02\0\x04\0\0\0\0\0\0\0\0\0\0\0\x04\0\x01\0\0\0' > tmp.pcap

* Use the pcap file with sngrep with the command:
sngrep -I tmp.pcap

* The sngrep panel will be displayed.

* Press Esc key to exit, and then Enter to confirm.

* It will segfault if its not fixed.

* With the fixed package, the sngrep panel will exit without segfault.

[ Where problems could occur ]

This is an upstream fix which reorders the deallocation of the panel window and panel pointer. It does not touch any other part of the code and only fixes the code on the panel destroy path. imho, there is very little chance of regression due to this change.

[ Other Info ]

* The problem has been fixed by upstream on v1.5.0 so only Jammy is affected. Lunar, Mantic and Noble are not affected.

[ Original Bug Description ]

When pressing ESC after going into a trace, I got this:

```
(gdb) bt
#0 0x00007ffff7bf470b in del_panel () from /lib/x86_64-linux-gnu/libpanelw.so.6
#1 0x000055555556ab18 in ui_destroy (ui=0x5555555856a0 <ui_call_flow>) at curses/ui_panel.c:64
#2 ui_default_handle_key (ui=ui@entry=0x5555555856a0 <ui_call_flow>, key=key@entry=27) at curses/ui_manager.c:292
#3 0x000055555555fdd6 in ui_wait_for_input () at curses/ui_manager.c:248
#4 main (argc=<optimized out>, argv=0x7fffffffe5c8) at ./src/main.c:435
```

Looks very much like this bug:

https://github.com/irontec/sngrep/issues/389
https://github.com/irontec/sngrep/commit/7ed9942c859bab13222d86b4d0fdd370c94664a3

# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04 LTS
Release: 22.04
Codename: jammy

# dpkg -l sngrep | grep ^ii
ii sngrep 1.4.10-1 amd64 Ncurses SIP Messages flow viewer

sngrep 1.5.0 has been released a month ago. I think it would be nice if the Ubuntu version got bumped:

https://github.com/irontec/sngrep/releases/tag/v1.5.0

Cheers,
Walter Doekes
OSSO B.V.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in sngrep (Ubuntu):
status: New → Confirmed
Revision history for this message
Sudip Mukherjee (sudipmuk) wrote :

I can reproduce this bug on Jammy. Also tested and confirmed that Lunar, Mantic and Noble are not affected.

tags: added: jammy
Changed in sngrep (Ubuntu):
status: Confirmed → Fix Released
Changed in sngrep (Ubuntu Jammy):
status: New → In Progress
assignee: nobody → Sudip Mukherjee (sudipmuk)
Revision history for this message
Sudip Mukherjee (sudipmuk) wrote :

debdiff for Jammy attached.

summary: - sngrep in Jammy segfaults in del_panel (fixed upstream)
+ [SRU] sngrep in Jammy segfaults in del_panel (fixed upstream)
description: updated
Changed in sngrep (Ubuntu Jammy):
status: In Progress → Confirmed
assignee: Sudip Mukherjee (sudipmuk) → nobody
Revision history for this message
Simon Quigley (tsimonq2) wrote :

s/reoder/reorder/g

update-maintainer

SRU version

Not blocking, just fixed :)

Changed in sngrep (Ubuntu Jammy):
status: Confirmed → In Progress
Revision history for this message
Steve Langasek (vorlon) wrote :

$ sngrep
Couldn't activate capture: socket: Operation not permitted
$

Please provide a more complete test case. (Preferably one that doesn't require me running this program as root on a network that doesn't have any SIP traffic anyway)

Changed in sngrep (Ubuntu Jammy):
importance: Undecided → Medium
status: In Progress → Incomplete
Revision history for this message
Simon Quigley (tsimonq2) wrote :

Would it make any difference if I had a network with a bunch of SIP clients on it to test?

Revision history for this message
Walter (wdoekes) wrote :

Steve:

printf '\xd4\xc3\xb2\xa1\x02\0\x04\0\0\0\0\0\0\0\0\0\0\0\x04\0\x01\0\0\0' > tmp.pcap

sngrep -I tmp.pcap

With the broken version, you can press Esc and Enter (Yes) and get a segfault:

[ Yes ] [ No ]Segmentation fault

Revision history for this message
Sudip Mukherjee (sudipmuk) wrote :

Test plan updated in SRU description.

description: updated
Changed in sngrep (Ubuntu Jammy):
status: Incomplete → Fix Committed
status: Fix Committed → In Progress
Revision history for this message
Robie Basak (racb) wrote :

> Apply upstream patch to fix segfault.

It's not worth changing now, but for future reference, as Steve said in a different issue, I'd prefer this to be more user-relevant. So something like " * Fix crash when the user tries to exit the display screen (LP: #...)". Other developers have other preferences so I just leave this as a note so that you can form your own opinion based on what you find that everyone else thinks, too :-)

Changed in sngrep (Ubuntu Jammy):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-jammy
Revision history for this message
Robie Basak (racb) wrote : Please test proposed package

Hello Walter, or anyone else affected,

Accepted sngrep into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/sngrep/1.4.10-1ubuntu0.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Revision history for this message
Sudip Mukherjee (sudipmuk) wrote :

I can confirm sngrep now exits properly with the package from jammy-proposed.

Test done:
1. Installed sngrep from Jammy.
2. Created the tmp.pcap file as given in the test plan.
3. Executed "sngrep -I tmp.pcap" which displayed the window.
4. Exited and resulted in segfault.

5. Add jammy-proposed to apt sources.
6. Update sngrep from jammy-proposed.
7. Executed same steps and exited. There was no segfault.

Test Result: sngrep exited as expected without any segfault.

Package tested:

$ dpkg -l | grep sngrep
ii sngrep 1.4.10-1ubuntu0.1 amd64 Ncurses SIP Messages flow viewer

tags: added: verification-done verification-done-jammy
removed: verification-needed verification-needed-jammy
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package sngrep - 1.4.10-1ubuntu0.1

---------------
sngrep (1.4.10-1ubuntu0.1) jammy; urgency=medium

  * Apply upstream patch to fix segfault. (LP: #1974446)

 -- Sudip Mukherjee <email address hidden> Sun, 24 Dec 2023 23:28:36 +0000

Changed in sngrep (Ubuntu Jammy):
status: Fix Committed → Fix Released
Revision history for this message
Chris Halse Rogers (raof) wrote : Update Released

The verification of the Stable Release Update for sngrep has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.