bugdmidecode - Bugs: bug #48158, Error messages go to stdout

 
 

bug #48158: Error messages go to stdout

Submitted by:  Simon Rettberg <simonr>
Submitted on:  Tue 07 Jun 2016 09:02:00 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: Jean Delvare <khali>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 22 Jul 2016 08:48:43 AM UTC, comment #3:

Fix committed:

http://git.savannah.gnu.org/cgit/dmidecode.git/commit/?id=74614633b31a2ac01240c72890722a86a3f3fc97

Jean Delvare <khali>
Project AdministratorIn charge of this item.
Thu 14 Jul 2016 11:31:55 AM UTC, comment #2:

Looks good to me so far, no more errors on the iMac. :)

Simon Rettberg <simonr>
Mon 04 Jul 2016 10:03:01 AM UTC, comment #1:

With so many people asking for error messages to go to stderr, I have to admit I was wrong and just do it. Can you try the attached patch? Thanks.

(file #37700)

Jean Delvare <khali>
Project AdministratorIn charge of this item.
Tue 07 Jun 2016 09:02:00 AM UTC, original submission:

I'm running dmidecode on an iMac, and get the following error message at the end of the output:

Invalid entry length (0). DMI table is broken! Stop.

Since this message is printed to stdout, it's a little cumbersome to get e.g. the system-uuid in scripts, since it looks like this:

# dmidecode -q -s system-uuid 2>/dev/null
3EE36F19-40F6-BA5C-8D30-23ED91AF7068
Invalid entry length (0). DMI table is broken! Stop.

You'd need some extra work using e.g. grep to make sure to get the UUID only, without trailing garbage.

I think this error should be printed to stderr, at least when using the -s command line switch. I also noticed the exit code is 0, but maybe this should be kept this way as long as the table could be parsed up until the point where the requested info lies.

This is very similar to #47274, and maybe there are more instances where errors go to stdout; could only spot one more instance at a quick glance however.

Simon Rettberg <simonr>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #37700:  dmidecode-errors-to-stderr.patch added by khali (3KiB - text/x-patch - [PATCH] dmidecode: Move error messages to stderr)
file #37418:  stderr.patch added by simonr (799B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by khali (Updated the item)
  • -unavailable- added by simonr (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 22 Jul 2016 08:48:56 AM UTCkhaliOpen/ClosedOpen=>Closed
    Fri 22 Jul 2016 08:48:42 AM UTCkhaliStatusConfirmed=>Fixed
    Mon 04 Jul 2016 10:03:01 AM UTCkhaliAttached File-=>Added dmidecode-errors-to-stderr.patch, #37700
      StatusNone=>Confirmed
      Assigned toNone=>khali
    Tue 07 Jun 2016 09:02:00 AM UTCsimonrAttached File-=>Added stderr.patch, #37418

    Back to the top


    Powered by Savane 3.1-cleanup1