dmidecode should print diagnostic messages to stderr

Bug #1688162 reported by Jens Elkner
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
dmidecode (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Ubuntu version of dmidecode breaks several scripts because it prints diagnostics messages to stdout instead of stderr.

E.g.: sudo /bin/ksh93
# /usr/sbin/dmidecode -s baseboard-manufacturer 2>/dev/null
Supermicro
Invalid entry length (16). Fixed up to 11.

The original version (https://git.savannah.nongnu.org/git/dmidecode.git) however, works as expected:
# /tmp/dmidecode -s baseboard-manufacturer 2>/dev/null
Supermicro

$ /usr/bin/lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.2 LTS
Release: 16.04
Codename: xenial

Tags: dmidecode
Jens Elkner (jelmd)
affects: qemu (Ubuntu) → dmidecode (Ubuntu)
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Hi Jens,
this seems to be specific to that invalid length error.
As I have seen that e.g. access denied or wrong option errors work just the way they should.

# insufficient permission
$ /usr/sbin/dmidecode -s baseboard-manufacturer 2>/dev/null
# bad option
$ sudo /usr/sbin/dmidecode -s wrong 2>/dev/null

I found a change upstream that could explain why this fixes it for you:
https://github.com/mirror/dmidecode/commit/74614633b31a2ac01240c72890722a86a3f3fc97

Applying only has slight errors that are easily fixed (5x offset and one fail that is easy to resolve).

I'll leave it as this for now as I'm in no way a dmidecode expert - I've only seen it because it was accidentally qemu and found it interesting. But I'll subscribe myself, if nothing is happening in ~2 weeks please ping and I'll take another look.

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

Also I think the bios needs to report wrong data length to trigger this, which might be why it isn't seen all around IMHO.

Changed in dmidecode (Ubuntu):
status: New → Triaged
Revision history for this message
Jens Elkner (jelmd) wrote :

Hi Christian,

Yepp, the patch looks good. Would be nice to get this integrated (or to sync dmidecode with the current GNU version).

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

Hi Jens, we usually try to keep dmidecode without Delta to Debian.
For the SRUs Delta is fine and as I said if no one helps I can try to assist here.
If you want to volunteer there is also the USBSD [1] where new people are guided to help themselfe and the community.

For the current release it would be great if Debian would pick that up and we coudl sync into Artful. Would you mind opening a Debian bug about moving to the current release (preferred) or at least picking this patch? Afterwards link the bug info here - that would be great.

[1]: https://wiki.ubuntu.com/ServerTeam/BugSquashingDay

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

This bug was fixed in the package dmidecode - 3.1-1

---------------
dmidecode (3.1-1) unstable; urgency=medium

  * New upstream release (LP: #1688162) (Closes: #860897):
    - Remove applied patches:
      + debian/patches/0110-nosysfs.patch
      + debian/patches/0115-no_smbios_DMI_entry_point.patch
      + debian/patches/0120-return_actual_data_size.patch
      + debian/patches/0125-use_read_file_to_read_DMI_table_from_sysfs.patch
      + debian/patches/0130-use_DWORD_for_table_max_size.patch
      + debian/patches/0135-hide_fixup_msg.patch
  * debian/copyright:
    - Add year 2017.
    - Change upstream email address.
  * debian/control:
    - Change Homepage.
  * Migrate to debhelper 10:
    - Change debian/compat to 10.
    - Bump minimum debhelper version in debian/control to >= 10.
  * Use the automatic debug symbol packages:
    - Remove dmidecode-dbg section from debian/control.
    - Remove override_dh_strip from debian/rules.
  * New README.source to explain the branching model used.
  * Declare compliance with Debian Policy 4.0.0. (No changes needed).

 -- Jörg Frings-Fürst <email address hidden> Sat, 24 Jun 2017 23:21:09 +0200

Changed in dmidecode (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Oleg "Nightwing" Lomakin (nightwing666) wrote :

Still affected on xenial,

dmidecode:
  Installed: 3.0-2ubuntu0.2

Was this bug really fixed?

Revision history for this message
Oleg "Nightwing" Lomakin (nightwing666) wrote :

This is latest version:
dmidecode:
  Installed: 3.0-2ubuntu0.2
  Candidate: 3.0-2ubuntu0.2
  Version table:
 *** 3.0-2ubuntu0.2 500
        500 http://mirror.yandex.ru/ubuntu xenial-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     3.0-2 500
        500 http://mirror.yandex.ru/ubuntu xenial/main amd64 Packages

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.