Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

libcups can busy loop #315

Closed
michaelrsweet opened this Issue Oct 3, 2003 · 8 comments

Comments

Projects
None yet
1 participant
Collaborator

michaelrsweet commented Oct 3, 2003

Version: 1.1.17
CUPS.org User: twaugh.redhat

http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=97958

The above bug report contains detailed information about this bug, including source level debugging sessions.

In short, libcups can busy-loop inside ipp_read. It isn't clear what circumstances trigger this.

Collaborator

michaelrsweet commented Oct 6, 2003

CUPS.org User: mike

It would be interesting to have your user test 1.1.19 or 1.1.20rc2 to see if the problem occurs there, since the current code handles these conditions differently than 1.1.17 did...

Collaborator

michaelrsweet commented Oct 9, 2003

CUPS.org User: twaugh.redhat

It'll take a couple of weeks to be sure that 1.1.19 fixes the problem. I'll get back to you.

Collaborator

michaelrsweet commented Oct 9, 2003

CUPS.org User: mike

OK, I'm doing 1.1.20rc3 today with the "final" fixes before 1.1.20, so let me know if 1.1.19 and/or 1.1.20rc3 do not correct the customer's problem.

Collaborator

michaelrsweet commented Oct 14, 2003

CUPS.org User: twaugh.redhat

Initial reports look good, but it's only been a couple of working days (the problem was always intermittent).

I'm looking through the 1.1.18->1.1.19 patch. Is it the httpWait() stuff that is meant to fix it?

Collaborator

michaelrsweet commented Oct 15, 2003

CUPS.org User: mike

Yes, that is what httpWait() (and some other related changes) does...

Collaborator

michaelrsweet commented Oct 16, 2003

CUPS.org User: twaugh.redhat

cups-1.1.17-loop.patch seems to be the relevant bit of the 1.1.18->1.1.19 patch. This patch presumes that the STR75 patch has already been applied.

Does it look okay? (It replaces the patch you originally objected to.)

Collaborator

michaelrsweet commented Oct 22, 2003

CUPS.org User: mike

Sorry for the delay; yes, the patch looks correct.

Collaborator

michaelrsweet commented Oct 28, 2003

"cups-1.1.17-loop.patch":

--- cups-1.1.17/cups/ipp.c.loop 2003-10-14 16:27:00.000000000 +0100
+++ cups-1.1.17/cups/ipp.c 2003-10-14 16:27:45.000000000 +0100
@@ -2011,7 +2011,10 @@

for (tbytes = 0, bytes = 0; tbytes < length; tbytes += bytes, buffer += bytes)
{

  • if (http->used > 0)
  • if (http->state == HTTP_WAITING)
  •  break;
    
  • if (http->used > 0 && http->data_encoding == HTTP_ENCODE_LENGTH)
    {
    /*
  • Do "fast read" from HTTP buffer directly...
    @@ -2054,8 +2057,24 @@
    }
    }
    }
  • else if ((bytes = httpRead(http, (char *)buffer, length - tbytes)) < 0)
  •  break;
    
  • else
  • {
  •  /*
    
  •   \* Wait a maximum of 1 second for data...
    
  •   */
    
  •  if (!httpWait(http,1000))
    
  •  {
    
  •    /*
    
  •     \* Signal no data...
    
  •     */
    
  •    bytes = -1;
    
  •    break;
    
  •  }
    
  •  else if ((bytes = httpRead(http, (char *)buffer, length - tbytes)) < 0)
    
  •    break;
    
  • }
    }

/*

@michaelrsweet michaelrsweet added this to the Stable milestone Mar 17, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment