Bug 501888 - internal error: reply callback called twice
Summary: internal error: reply callback called twice
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libguestfs
Version: unspecified
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-05-21 08:43 UTC by Richard W.M. Jones
Modified: 2010-03-27 10:06 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2010-03-27 10:06:50 UTC
Embargoed:


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

Description Richard W.M. Jones 2009-05-21 08:43:51 UTC
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 14:50:08 UTC
Moving upstream, since it happens very rarely

Comment 2 Richard W.M. Jones 2009-06-26 10:15:43 UTC
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 13:38:37 UTC
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 18:40:53 UTC
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 11:00:15 UTC
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 11:34:26 UTC
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 19:03:00 UTC
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 10:06:50 UTC
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.