[dtn-users] Has anyone tried running DTN2 under valgrind lately?

Amy Alford <aloomis@sarn.org> Mon, 12 November 2012 16:10 UTC

Return-Path: <aloomis@sarn.org>
X-Original-To: dtn-users@ietfa.amsl.com
Delivered-To: dtn-users@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 3FBF421F854B for <dtn-users@ietfa.amsl.com>; Mon, 12 Nov 2012 08:10:27 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.976
X-Spam-Level:
X-Spam-Status: No, score=-2.976 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-1]
Received: from mail.ietf.org ([64.170.98.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6ZfuJ+AHjYS9 for <dtn-users@ietfa.amsl.com>; Mon, 12 Nov 2012 08:10:26 -0800 (PST)
Received: from mail-qa0-f47.google.com (mail-qa0-f47.google.com [209.85.216.47]) by ietfa.amsl.com (Postfix) with ESMTP id 9C1FA21F8419 for <dtn-users@irtf.org>; Mon, 12 Nov 2012 08:10:26 -0800 (PST)
Received: by mail-qa0-f47.google.com with SMTP id t11so1831438qaa.13 for <dtn-users@irtf.org>; Mon, 12 Nov 2012 08:10:25 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type :x-gm-message-state; bh=VNpOF1Wl2Cry0nkJkTrP77382UFgpaOFWk89hhCrtJc=; b=Ri0hjPSI86VfuR9Tu2mDu52fAPsWGY8+HT94awjuERSIFofcEWE07QZpeNL+ntNTC0 O+lFheblNnxY/ubofDucPr/6RLyIMNCXTwp1OP8rJrBOHm/zMZtS00rRs2YtsZYFNOAp tnYnmsiPpN6lR0s0wEk7pJJET1+12jtDO49E05mls6S/C3/JYd2vaoFeQrXiIsjLUHJH 3D2MXvgrVtIgDn/kmIB2twcgTenaYS76CIjuOCs63fRIw0sexaPWx8g47wBa7vuUzJxh Y+wIUXWH+ZZ9i0y+083T0H//X5vGyEHK7OewF7OE7tG3yaUpgNPZSxXoSfs92wF6/4kq PnMw==
MIME-Version: 1.0
Received: by 10.224.33.135 with SMTP id h7mr21514766qad.26.1352736625743; Mon, 12 Nov 2012 08:10:25 -0800 (PST)
Received: by 10.49.86.169 with HTTP; Mon, 12 Nov 2012 08:10:25 -0800 (PST)
Date: Mon, 12 Nov 2012 11:10:25 -0500
Message-ID: <CAB9rx+9nor+Lpxm3y0bfHghS7SddHH4PoE5tgvFo4mRKk5E0zA@mail.gmail.com>
From: Amy Alford <aloomis@sarn.org>
To: dtn-users@irtf.org
Content-Type: multipart/alternative; boundary="20cf306f77040d55d704ce4e8a86"
X-Gm-Message-State: ALoCoQnOBLkQSi3S+YCHCknJEuICnra6gbwyk9n10u4fl813G/fasaDWFRggUWGcw8Svohn/zvq4
Subject: [dtn-users] Has anyone tried running DTN2 under valgrind lately?
X-BeenThere: dtn-users@irtf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: "The Delay-Tolerant Networking Research Group \(DTNRG\) - Users." <dtn-users.irtf.org>
List-Unsubscribe: <https://www.irtf.org/mailman/options/dtn-users>, <mailto:dtn-users-request@irtf.org?subject=unsubscribe>
List-Archive: <http://www.irtf.org/mail-archive/web/dtn-users>
List-Post: <mailto:dtn-users@irtf.org>
List-Help: <mailto:dtn-users-request@irtf.org?subject=help>
List-Subscribe: <https://www.irtf.org/mailman/listinfo/dtn-users>, <mailto:dtn-users-request@irtf.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Nov 2012 16:10:27 -0000

I've been trying to do this, but I get a lot of spurious output.  Most of
it falls into the following couple of categories:

1) Threads shutdown uncleanly.  Sometimes one thread is accessing variables
another thread has already freed.
2) Lots of memory is intentionally freed by the OS on exit.  This wouldn't
be such a problem, since valgrind classifies this as "still reachable"
rather than a memory leak.  However, the gcc STL implementation uses an
internal pointer to the block of memory it has allocated (rather than a
pointer to the beginning of the block).  This causes valgrind to classify
this memory as "possibly lost" instead of "still reachable".

I discovered an environment variable "OASYS_CLEANUP_SINGLETONS" that causes
oasys to delete classes that inherit from Singleton on exit.  This helps
with the valgrind output, but actually causes dtnd to segfault since some
Singletons are already manually deleted.

I have a slew of changes that got the valgrind output down from about 2000
lines to 500, but I'm not sure that my changes don't have unintended
effects.

- Amy