[cups.bugs] [MOD] STR #3381: cups-polld wedged at 100% processor usage (reproduced)

Maciej Bliziński maciej.blizinski at gmail.com
Wed Oct 21 02:35:47 PDT 2009


DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

An updated version of the explanation:

httpGets is expecting errno to be set upon the return from
gnutls_record_recv. However, gnutls_record_recv uses different semantics;
it doesn't rely on returning -1 and setting the errno; instead, it returns
an error code as defined in includes/gnutls/gnutls.h. In this case, number
-10 corresponds to GNUTLS_E_INVALID_SESSION.

If gnutls_record_recv has a different API, why does httpGets() work at
all? I think that it's because gnutls_record_recv relies on recv() itself;
if recv() returns an error, the 'errno' variable is being set by it, and in
consequence, readby httpGets (). The problem is when gnutls_record_recv
returns an error which did not originate in recv().
GNUTLS_E_INVALID_SESSION is an example of that. In the case of an invalid
session, gnutls_record_recv returns an error immediately, and does not set
errno.

A better way of handling gnutls errors would be to rely on the values
returned by gnutls_record_recv rather than errno, since setting errno is
not part of gnutls' API.

I wrote a patch[1] for CUPS and built CSWcups-1.4.0,REV=2009.10.20.15.35 -
it's being currently tested[2].

[1]
https://gar.svn.sourceforge.net/svnroot/gar/csw/mgar/pkg/cups/branches/cups-1.4.0/files/0005-Mapping-GNUTLS_E_INVALID_SESSION-to-EIO-in-http_read.patch

[2] http://mirror.opencsw.org/testing.html

Link: http://www.cups.org/str.php?L3381
Version: 1.4.0





More information about the cups-devel mailing list