Project

General

Profile

Actions

Fix #9678

closed

errno shadowed in Pipe.cc

Added by Loïc Dachary over 9 years ago. Updated about 5 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
% Done:

0%

Source:
other
Tags:
Backport:
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

In some places errno is used after it has been reset and the original error code does not show in the message. For instance https://github.com/ceph/ceph/blob/giant/src/msg/Pipe.cc#L1473

2014-10-07 14:37:05.473776 7facdbf15700  2 -- 192.168.99.252:6805/25809 >> 192.168.99.251:0/2012331 pipe(0x7fad20850800 sd=138 :6805 s=4 pgs=47 cs=1 l=1 c=0x7fad22fa1b20).reader couldn't read tag, (0) Success

Actions #1

Updated by Loïc Dachary over 9 years ago

  • Subject changed from errno shadowd in Pipe.cc to errno shadowed in Pipe.cc
Actions #2

Updated by Loïc Dachary over 9 years ago

  • Backport set to firefly, giant
Actions #3

Updated by Greg Farnum over 9 years ago

Where's it being reset? That error message is admittedly strange but it actually happens because the underlying function can return without it being an error. (I don't remember exactly how, but I think it's if the other end closes a socket we wake up without error codes but then we return -1 because there's no data available to read.)

Actions #4

Updated by Loïc Dachary over 9 years ago

  • Priority changed from High to Normal
  • Backport deleted (firefly, giant)

If it is expected to see an error message when there is nothing to read, then I was mistaken.

Not retrieving the content of errno opens the possibility that other system calls happen in between (if not now then when the code being called in between evolve), making it unreliable to read afterwards.

Feel free to reject if you think this is not a concern.

Actions #5

Updated by Greg Farnum over 9 years ago

  • Status changed from 12 to Rejected
Actions #6

Updated by Greg Farnum about 5 years ago

  • Project changed from Ceph to Messengers
  • Category deleted (msgr)
Actions

Also available in: Atom PDF