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

 
 

bug #43611: select might return with EINTR in _openipmi_read

Submitter:  None
Submitted:  Fri 14 Nov 2014 02:33:20 PM UTC
   
 
Category:  libfreeipmi Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Improper Behaviour
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Closed
Operating System:  GNU/Linux
* Mandatory Fields

Add a New Comment Rich Markup
   

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>
Group 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>
Group 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>
Group 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>
Group 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 Files:
   
   
Comment:
   

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-11-17 chu11 Open/ClosedOpen Closed
    2014-11-14 None Attached File- Added ipmi-openipmi-driver.c__2014_11_14_001.patch, #32434

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code