iptstate assert failure: *** Error in `iptstate': munmap_chunk(): invalid pointer: 0x000000000193c990 ***

Bug #1562333 reported by Karma Dorje
38
This bug affects 6 people
Affects Status Importance Assigned to Milestone
iptstate (Ubuntu)
Fix Released
Medium
Unassigned
Xenial
Fix Released
Undecided
Unassigned

Bug Description

[Impact]

 * Crash due to newer compiler exposing issues in old code

 * Fix by backporting upstream fix

[Test Case]

 * run the tool
   $ iptstate

   while there are cases this works (accidentially) in most of the cases
   I tried it crashes with a segfault as reported. If you happen to be
   "lucky" and have it working - I realized (for whatever reason) that if
   it works once it continues to work. In that case just take a new xenial
   container or VM and it will very likely fail there

 * Installing the upgrade fixes the issue

[Regression Potential]

 * It is a (minor) rework of some sorts which normally would make one
   suspicious, but since without it the package is 0% usable it can't be
   much of a regression - sorry for this trivialization, but I think this
   is what applies to this case.

 * OTOH while it failed for me at the first try I realized that you can
   get (?somehow?) into a mode where it seems to work for a while.
   If now statistically my systems are odd (4/6 I tried failed) and "in
   the wild" most users would be unaffected, then this could be an issue
   for them if the rework causes other issues we don't know about.

[Other Info]

 * n/a

---

This is an automatic bug report.

Steps to reproduce:

just install and run.

ProblemType: Crash
DistroRelease: Ubuntu 16.04
Package: iptstate 2.2.5-1build1
ProcVersionSignature: Ubuntu 4.4.0-16.32-generic 4.4.6
Uname: Linux 4.4.0-16-generic x86_64
ApportVersion: 2.20-0ubuntu3
Architecture: amd64
AssertionMessage: *** Error in `iptstate': munmap_chunk(): invalid pointer: 0x000000000193c990 ***
Date: Sat Mar 26 22:30:25 2016
ExecutablePath: /usr/sbin/iptstate
InstallationDate: Installed on 2015-08-05 (233 days ago)
InstallationMedia: Ubuntu 15.04 "Vivid Vervet" - Release amd64 (20150422)
ProcCmdline: iptstate
ProcEnviron:
 TERM=screen
 SHELL=/bin/bash
 PATH=(custom, no user)
 LANG=ru_RU.UTF-8
 LANGUAGE=ru
Signal: 6
SourcePackage: iptstate
StacktraceTop:
 __libc_message (do_abort=do_abort@entry=2, fmt=fmt@entry=0x7f479d8c2fb8 "*** Error in `%s': %s: 0x%s ***\n") at ../sysdeps/posix/libc_fatal.c:175
 malloc_printerr (ar_ptr=0x0, ptr=<optimized out>, str=0x7f479d8c2fe0 "munmap_chunk(): invalid pointer", action=<optimized out>) at malloc.c:5007
 munmap_chunk (p=<optimized out>) at malloc.c:2843
 __GI___libc_free (mem=<optimized out>) at malloc.c:2964
 ?? ()
Title: iptstate assert failure: *** Error in `iptstate': munmap_chunk(): invalid pointer: 0x000000000193c990 ***
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups:

Revision history for this message
Karma Dorje (taaroa) wrote :
Revision history for this message
Apport retracing service (apport) wrote :

StacktraceTop:
 __libc_message (do_abort=do_abort@entry=2, fmt=fmt@entry=0x7f479d8c2fb8 "*** Error in `%s': %s: 0x%s ***\n") at ../sysdeps/posix/libc_fatal.c:175
 malloc_printerr (ar_ptr=0x0, ptr=<optimized out>, str=0x7f479d8c2fe0 "munmap_chunk(): invalid pointer", action=<optimized out>) at malloc.c:5007
 munmap_chunk (p=<optimized out>) at malloc.c:2843
 __GI___libc_free (mem=<optimized out>) at malloc.c:2964
 operator delete (ptr=<optimized out>) at ../../../../src/libstdc++-v3/libsupc++/del_op.cc:46

Revision history for this message
Apport retracing service (apport) wrote : Stacktrace.txt
Revision history for this message
Apport retracing service (apport) wrote : StacktraceSource.txt
Revision history for this message
Apport retracing service (apport) wrote : ThreadStacktrace.txt
Changed in iptstate (Ubuntu):
importance: Undecided → Medium
tags: removed: need-amd64-retrace
Revision history for this message
Karma Dorje (taaroa) wrote :

Program received signal SIGSEGV, Segmentation fault.
                                                    0x00007ffff6b88c52 in __GI___libc_free (mem=0x13fd440) at malloc.c:2968
2968 malloc.c: No such file or directory.
(gdb) bt
#0 0x00007ffff6b88c52 in __GI___libc_free (mem=0x13fd440) at malloc.c:2968
#1 0x00000000004063c0 in ?? ()
#2 0x0000000000403968 in ?? ()
#3 0x00007ffff6b25841 in __libc_start_main (main=0x4031e0, argc=1, argv=0x7fffffffe668,
    init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffe658)
    at ../csu/libc-start.c:291
#4 0x0000000000404b99 in ?? ()

Karma Dorje (taaroa)
information type: Private → Public
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in iptstate (Ubuntu):
status: New → Confirmed
Revision history for this message
ironstorm (ironstorm-gmail) wrote :

Running iptstate on a Raspberry Pi 3 (armhf) yields errors including the one in this bug's title:

*** Error in `iptstate': munmap_chunk(): invalid pointer: 0x02c62e78 ***
*** Error in `iptstate': free(): invalid pointer: 0x0231ec10 ***

Seems the best that can be done without continuously crashing is to use watch :(

sudo watch iptstate -1 # Works without crashing

sudo sh -c "while [ true ]; do clear; iptstate; done" # Works with color by continuously restarting

Revision history for this message
Tim Cooijmans (timcooijmans) wrote :
Revision history for this message
Martin Jackson (mhjacks) wrote :
Revision history for this message
Martin Jackson (mhjacks) wrote :

2.2.6 just hit zesty. Would it be appropriate for a backport to xenial?

Revision history for this message
Eliezer Croitoru (eliezer) wrote :

Where can I find the deb for zsty?
+1 for backporting.

Revision history for this message
Eliezer Croitoru (eliezer) wrote :

Any movment with this package? the zesty package seems pretty stable on 16.04.2 xenial.

Revision history for this message
Brian Candler (b-candler) wrote :

2.2.5 in xenial crashes for me. Building 2.2.6 from source on xenial, it works.

+1 for backport; the package is currently not usable.

Revision history for this message
Eliezer Croitoru (eliezer) wrote :

What happens with this backport?
What is blocking to add the 2.2.6 into xenial?

Revision history for this message
Eliezer Croitoru (eliezer) wrote :

Is there anyone in ubuntu who hanldes this issue?
It's a very simple upgrade..

Nish Aravamudan (nacc)
Changed in iptstate (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Eliezer Croitoru (eliezer) wrote :

OK so on the #ubuntu-server room the response is:
x : because you haven't prepared and tested a debdiff to fix it yet
x : packages in universe are community-maintained

So, somebody who knows something about debdiff or debian packaging needs to offer a proper patch\diff\deb.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

The issue you are facing is [1].
It is easy enough of a backport to try to help you quickly by preparing a debdiff (and more) rather fast.

In 2.2.6 there were a few more minor changes and reworks on the doc and on a variable naming.
But still for the SRU process we should only backport what is needed.

There are two fixes directly for this issue. Further fixes are not stricly needed for the SRU as
e.g. [2] can be achieved by just adding -L on your own. Likewise for [3] that can be avoided by enabling counters via -C.

That said there is clearly no workaround for [1] so the backport should include [4]+[5].
Since zesty is already on 2.2.6 and Trusty working due to the older compiler only Xenial is needed.

I have a test build in [6], please try that - if you can confirm it works we can push forward to add an SRU Template to the bug and get review of the change by the SRU Team [7].

[1]: https://github.com/jaymzh/iptstate/issues/3
[2]: https://github.com/jaymzh/iptstate/commit/34c87be7a6d9e5483485f5a191f68c17a8d7b4be
[3]: https://github.com/jaymzh/iptstate/commit/fa7267bbf4ba551600e35c229f292ee62d1f3c25
[4]: https://github.com/jaymzh/iptstate/commit/50a0e17c094e5fea99a25e7a4ca70772be670abf
[5]: https://github.com/jaymzh/iptstate/commit/22a664109c6e1f85b57c119a6d10222fd3e199f4
[6]: https://launchpad.net/~ci-train-ppa-service/+archive/ubuntu/2954
[7]: https://wiki.ubuntu.com/StableReleaseUpdates

Changed in iptstate (Ubuntu Xenial):
status: New → Confirmed
description: updated
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

I added the SRU Template and the ppa fixes it for me, but waiting for another reply before going forward.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

To be clear, please test [6] from comment #18 to confirm it fixes your issues.

Changed in iptstate (Ubuntu Xenial):
status: Confirmed → Incomplete
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

There was no check on the ppa as asked in c#18, but it really works for me and is unusable without.
Therefore instead of letting this die the timeout-death I'm uploading the fix to Xenial-unapproved.
SRU Template was already added before, so it should be ready.

Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Karma, or anyone else affected,

Accepted iptstate into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/iptstate/2.2.5-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 and change the tag from verification-needed-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. In either case, details of your testing will help us make a better decision.

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

Changed in iptstate (Ubuntu Xenial):
status: Incomplete → Fix Committed
tags: added: verification-needed verification-needed-xenial
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Verified on Proposed.
While (see the original bug) it can sometimes happen to not crash even without a fix after a while I found a case again triggering it reliable. Upgrading to proposed fixed it. Setting verified.

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

This bug was fixed in the package iptstate - 2.2.5-1ubuntu0.1

---------------
iptstate (2.2.5-1ubuntu0.1) xenial; urgency=medium

  * d/p/0001-Move-to-dyanmic-memory-for-state-entries.patch,
    d/p/0002-Fix-crashing-bug-on-DstIP-sort.patch: fix a crash on the first
    UI refresh making iptstate unusuable (LP: #1562333).

 -- Christian Ehrhardt <email address hidden> Tue, 12 Sep 2017 08:15:46 +0200

Changed in iptstate (Ubuntu Xenial):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for iptstate has completed successfully and the package has now been 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.

Revision history for this message
Eliezer Croitoru (eliezer) wrote :

Seems like it works for me.

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

Other bug subscribers

Remote bug watches

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