bugGNU FreeIPMI - Bugs: bug #43611, select might return with EINTR in...

 
 

bug #43611: select might return with EINTR in _openipmi_read

Submitted by:  None
Submitted on:  Fri 14 Nov 2014 02:33:20 PM UTC  
 
Category: libfreeipmiSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Improper Behaviour
Status: NonePrivacy: Public
Assigned to: NoneOpen/Closed: Closed
Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

(Jump to the original submission Jump to the original submission)

Mon 17 Nov 2014 06:19:39 PM UTC, comment #6:

Great. I'll merge and it'll be in the next release of FreeIPMI

Albert Chu <chu11>
Project Administrator
Mon 17 Nov 2014 09:36:02 AM UTC, comment #5:

Hi Albert,
thanks for the quick answer and for the patch. I tested it on our system and it works for me.

Robin Geyer <rgeyer>
Fri 14 Nov 2014 10:13:03 PM UTC, comment #4:

BTW, I gave you credit in the ChangeLog for finding the issue.

Albert Chu <chu11>
Project Administrator
Fri 14 Nov 2014 10:07:20 PM UTC, comment #3:

Robin, could you try out this branch?

svn co http://svn.savannah.gnu.org/svn/freeipmi/branches/inbandselectloop
freeipmi
cd freeipmi
./autogen.sh
./configure
make
ipmi-sensors/ipmi-sensors

or whatever commands you want to test.

Albert Chu <chu11>
Project Administrator
Fri 14 Nov 2014 06:37:08 PM UTC, comment #2:

Hi Robin, you're absolutely correct. This was lazy-ish programming on my (and others) parts over the years. There are some issues with your patch, as it should only loop if the error is EINTR and the timeout should be lowered as it loops.

I have code that does this from other projects and it should be copied to other drivers (sunbmc & ssif I think). I'll whip up something and give you a branch you can try.

Albert Chu <chu11>
Project Administrator
Fri 14 Nov 2014 03:01:12 PM UTC, comment #1:

Sorry I was not aware that one can submit as anonymous. I Submitted this issue.

Robin Geyer <rgeyer>
Fri 14 Nov 2014 02:33:20 PM UTC, original submission:

ipmi_cmd_raw() sometimes returns with < 0 which indicates an error. We have a specific case where this is caused by the select() function on line 510 in the file ipmi-openipmi-driver.c. This select returns with -1 and sets errno to EINTR, which indicates that the select has received a signal and hence aborts.
It is my understanding that this can happen during an select especially when working with an external resource. This is however not an unrecoverable error which should lead to ipmi_cmd_raw() ending with an error. Usually, as I understand, the select() can, and should, be retried multiple times in case of an EINTR. In this way ipmi_cmd_raw() can return without an error and the correct value read.
I'd like to propose the attached patch, which retries the select a specific number of times in case of an failed select caused by EINTR. In other cases it does not attempt to retry and behaves like before.

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by chu11 (Posted a comment)
  • -unavailable- added by rgeyer (Posted a comment)
  •  

    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 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 17 Nov 2014 06:19:58 PM UTCchu11Open/ClosedOpen=>Closed
    Fri 14 Nov 2014 02:33:20 PM UTCNoneAttached File-=>Added ipmi-openipmi-driver.c__2014_11_14_001.patch, #32434

    Back to the top


    Powered by Savane 3.1-cleanup1