Bug 501888 - internal error: reply callback called twice
internal error: reply callback called twice
Status: CLOSED UPSTREAM
Product: Virtualization Tools
Classification: Community
Component: libguestfs (Show other bugs)
unspecified
All Linux
low Severity medium
: ---
: ---
Assigned To: Richard W.M. Jones
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-05-21 04:43 EDT by Richard W.M. Jones
Modified: 2010-03-27 06:06 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-03-27 06:06:50 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
Potential fix - switch to reading single messages only in the socket read callback (2.42 KB, patch)
2009-06-26 06:15 EDT, Richard W.M. Jones
no flags Details | Diff

  None (edit)
Description Richard W.M. Jones 2009-05-21 04:43:51 EDT
Functions which have FileOut parameters can cause
"internal error: reply callback called twice"

The reason is that the socket read handler reads
two or more messages in a single buffer read, and
calls the upper reply callback twice in succession.

In the normal case, the reply callback is switched
after the first callback to the special callback for
reading files.  However if the socket read handler
calls the first reply callback twice in quick succession
this doesn't happen (the main loop isn't exited between
callbacks).

This only happens very rarely, and the fix is fairly
ugly.
Comment 1 Mark McLoughlin 2009-05-25 10:50:08 EDT
Moving upstream, since it happens very rarely
Comment 2 Richard W.M. Jones 2009-06-26 06:15:43 EDT
Created attachment 349531 [details]
Potential fix - switch to reading single messages only in the socket read callback

Matt, could you test this patch please.

I have checked that it still passes the tests, but since I
can't reproduce the original bug I'm not certain that it's
a fix.
Comment 3 Richard W.M. Jones 2009-06-27 09:38:37 EDT
Comment on attachment 349531 [details]
Potential fix - switch to reading single messages only in the socket read callback

This patch causes a segfault for some large messages - please ignore it.
Comment 4 Richard W.M. Jones 2009-09-14 14:40:53 EDT
We think the following patch should fix this error
comprehensively:

http://git.et.redhat.com/?p=libguestfs.git;a=commitdiff;h=0a0d743ba80e33e676084f2a254c63d4188857b0
Comment 5 Fedora Update System 2009-09-15 07:00:15 EDT
libguestfs-1.0.70-1.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/libguestfs-1.0.70-1.fc11
Comment 6 Fedora Update System 2009-09-15 07:34:26 EDT
libguestfs-1.0.70-1.el5 has been submitted as an update for Fedora EPEL 5.
http://admin.fedoraproject.org/updates/libguestfs-1.0.70-1.el5
Comment 7 Fedora Update System 2009-10-03 15:03:00 EDT
libguestfs-1.0.70-1.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 8 Richard W.M. Jones 2010-03-27 06:06:50 EDT
As noted in comment 4, the main loop was completely
rewritten, fixing this problem.

Note You need to log in before you can comment on or make changes to this bug.