SNMP_Session re-imports Socket6, producing warnings [SRU]

Bug #946067 reported by Ryan Finnie on 2012-03-04
This bug affects 2 people
Affects Status Importance Assigned to Milestone
libsnmp-session-perl (Debian)
Fix Released
libsnmp-session-perl (Ubuntu)

Bug Description

When SNMP_Session is used/required after Socket6, warnings are produced.

Warnings are written to STDERR. Normally wouldn't be critical, except this module is mainly used by recurring programs such as mrtg and cricket. For example, in mrtg's packaged configuration, it is run every 5 minutes from cron, and the warnings will be delivered to root's mail spool, eventually filling the disk.

[Development Fix]
A patch has been submitted by Debian upstream, but upstream did not respond, and Debian handling has stalled. See .

[Stable Fix]
Apply the patch contained in this bug. It is identical to the Debian patch, with the addition of debian/changelog entry.

[Text Case]
1. sudo apt-get install libsocket6-perl libsnmp-session-perl
2. perl -MSocket6 -MSNMP_Session -e ""
Broken Behavior:
$ perl -MSocket6 -MSNMP_Session -e ""
Constant subroutine SNMP_Session::AF_INET6 redefined at /usr/share/perl/5.14/ line 67.
 at /usr/share/perl5/ line 149
Prototype mismatch: sub SNMP_Session::AF_INET6 () vs none at /usr/share/perl/5.14/ line 67.
 at /usr/share/perl5/ line 149
Constant subroutine SNMP_Session::PF_INET6 redefined at /usr/share/perl/5.14/ line 67.
 at /usr/share/perl5/ line 149
Prototype mismatch: sub SNMP_Session::PF_INET6 () vs none at /usr/share/perl/5.14/ line 67.
 at /usr/share/perl5/ line 149
Constant subroutine SNMPv1_Session::AF_INET6 redefined at /usr/share/perl/5.14/ line 67.
 at /usr/share/perl5/ line 608
Prototype mismatch: sub SNMPv1_Session::AF_INET6 () vs none at /usr/share/perl/5.14/ line 67.
 at /usr/share/perl5/ line 608
Constant subroutine SNMPv1_Session::PF_INET6 redefined at /usr/share/perl/5.14/ line 67.
 at /usr/share/perl5/ line 608
Prototype mismatch: sub SNMPv1_Session::PF_INET6 () vs none at /usr/share/perl/5.14/ line 67.
 at /usr/share/perl5/ line 608

Fixed Behavior:
$ perl -MSocket6 -MSNMP_Session -e ""

[Regression Potential]
None known. AIUI, Socket6 is required, which exports {AF,PF}_INET6 among other things, and SNMP_Session would then try to re-import its namespace. Under previous version of Perl, this was silently ignored, but this produces a warning now. An unknown series of events could possibly cause {AF,PF}_INET6 to not be imported in the first place.

[Original Report]
While mrtg works ok, on every run it produces the following warnings:

# env LANG=C /usr/bin/mrtg /etc/mrtg.cfg
Subroutine SNMP_Session::pack_sockaddr_in6 redefined at /usr/share/perl/5.14/ line 67.
 at /usr/share/perl5/ line 149
Subroutine SNMP_Session::unpack_sockaddr_in6 redefined at /usr/share/perl/5.14/ line 67.
 at /usr/share/perl5/ line 149
Subroutine SNMP_Session::sockaddr_in6 redefined at /usr/share/perl/5.14/ line 67.
 at /usr/share/perl5/ line 149
Subroutine SNMPv1_Session::pack_sockaddr_in6 redefined at /usr/share/perl/5.14/ line 67.
 at /usr/share/perl5/ line 608
Subroutine SNMPv1_Session::unpack_sockaddr_in6 redefined at /usr/share/perl/5.14/ line 67.
 at /usr/share/perl5/ line 608
Subroutine SNMPv1_Session::sockaddr_in6 redefined at /usr/share/perl/5.14/ line 67.
 at /usr/share/perl5/ line 608

This happens even when "EnableIPv6: no" is present in mrtg.cfg.

Because it's run every 5 minutes via cron, it's spamming the the user that ultimately gets root's cron mail.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: mrtg 2.17.3-2ubuntu1
ProcVersionSignature: Ubuntu 3.2.0-17.27-generic 3.2.6
Uname: Linux 3.2.0-17-generic x86_64
ApportVersion: 1.94-0ubuntu1
Architecture: amd64
Date: Sat Mar 3 19:53:25 2012
InstallationMedia: Ubuntu-Server 12.04 LTS "Precise Pangolin" - Beta amd64 (20120229)
 PATH=(custom, user)
SourcePackage: mrtg
UpgradeStatus: No upgrade log present (probably fresh install)

Ryan Finnie (fo0bar) wrote :
Changed in mrtg (Ubuntu):
assignee: nobody → Canonical Server Team (canonical-server)
importance: Undecided → Medium
Changed in mrtg (Ubuntu):
assignee: Canonical Server Team (canonical-server) → nobody
Changed in mrtg (Ubuntu Precise):
status: New → Triaged
Ryan Finnie (fo0bar) wrote :

Bug is actually present in libsnmp-session-perl, attaching patch.

affects: mrtg (Ubuntu Precise) → libsnmp-session-perl (Ubuntu Precise)
summary: - mrtg reports warnings on every run, fills cron mail
+ SNMP_Session re-imports Socket6, producing warnings

The attachment "Fix for Socket6 redefinition warnings" of this bug report has been identified as being a patch in the form of a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-sponsors team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch

FYI, upstream Debian bug is - patch was forwarded upstream to the module author, but it looks like that stalled, and applying it within Debian is stalled as well.

Changed in libsnmp-session-perl:
status: Unknown → Confirmed
Bryce Harrington (bryce) wrote :

Heya, first off, thanks for this contribution to the LTS, it's much

As it happens, Ubuntu Precise has now progressed into Final Freeze.
Right now changes to the distro are limited to just ultra-critical
release bugs that the release team has flagged as priorities. Most
other bugs, including this one, need to now be handled as Stable
Release Updates (SRUs) or left until the next release (Q-series) opens
for development.

For reference, here is the SRU Policy Doc:

I've looked at your patch and think it may qualify as an SRU, but
there's a bit extra paperwork, which helps establish the justification
for the change and makes the change easier for reviewers. Would you
mind helping by filling in some blanks?

I've pasted in the standard SRU template into the bug description.
Click the yellow pencil icon to the right of 'Bug Description', and fill
in the empty sections.

Also, while the patch itself looks ok, there are a few changes necessary
to target it as an SRU:

 1. In the changelog entry, target the upload to 'precise-proposed'
    rather than just 'precise'.

 2. The version number should increment by a point rather than a full
    number. Examples:

     Currently in precise Proposed for precise-proposed
     foobar-1.2-1 ---> foobar-1.2-1ubuntu0.1
     foobar-1.2-1ubuntu2 ---> foobar-1.2-1ubuntu2.1
     foobar-1.2~dfsg.1-1 ---> foobar-1.2~dfsg.1-1ubuntu0.1
     foobar-1.2-1ubuntu1.5 ---> foobar-1.2-1ubuntu1.6

 3. Make certain the correct bug # is listed in the changelog entry
    description, in this format: (LP: #123456)

 4. Doublecheck the maintainer is set to Ubuntu. Easy to do, just run
    `update-maintainer` and it'll fix it.

Finally, doublecheck that the patch has been forwarded upstream (as
appropriate), and that it's included in the version that will be in
Ubuntu Q-series.

description: updated
Changed in libsnmp-session-perl (Ubuntu Precise):
milestone: none → precise-updates
status: Triaged → Incomplete
summary: - SNMP_Session re-imports Socket6, producing warnings
+ SNMP_Session re-imports Socket6, producing warnings [SRU]
Bryce Harrington (bryce) wrote :

Please re-subscribe the ubuntu-sponsors team to the bug report once the above has been done.

Ryan Finnie (fo0bar) on 2012-04-20
description: updated
Ryan Finnie (fo0bar) on 2012-04-20
tags: added: precise-proposed
Ryan Finnie (fo0bar) wrote :

The SRU version of the patch has the point release and maintainer changed to Ubuntu.

The non-SRU version is still valid for q-series, but I'm hoping to ping upstream Debian to apply their patch so it's not needed by the time Q's Debian sync comes around.

Ryan Finnie (fo0bar) on 2012-04-22
Changed in libsnmp-session-perl (Ubuntu Precise):
status: Incomplete → Confirmed
Micah Gersten (micahg) wrote :

Unseeded universe freeze isn't for 48 hours and the patch looks sane and has been tested on 2 of the 4 reverse dependencies (cricket and mrtg), iog and smokeping both have low popcon

Changed in libsnmp-session-perl:
importance: Unknown → Undecided
status: Confirmed → New
no longer affects: libsnmp-session-perl (Ubuntu Q-series)
Changed in libsnmp-session-perl (Ubuntu Precise):
assignee: nobody → Micah Gersten (micahg)
milestone: precise-updates → none
status: Confirmed → In Progress
Micah Gersten (micahg) wrote :

Uploaded, waiting in unapproved

Changed in libsnmp-session-perl (Ubuntu Precise):
assignee: Micah Gersten (micahg) → nobody
status: In Progress → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libsnmp-session-perl - 1.13-1ubuntu1

libsnmp-session-perl (1.13-1ubuntu1) precise; urgency=low

  * Eliminate "Subroutine redefined" warnings by not re-importing
    Socket6 (LP: #946067)
 -- Ryan Finnie <email address hidden> Sat, 21 Apr 2012 00:44:48 -0700

Changed in libsnmp-session-perl (Ubuntu Precise):
status: Fix Committed → Fix Released
Changed in libsnmp-session-perl (Debian):
status: Unknown → Confirmed
Changed in libsnmp-session-perl (Debian):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
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.