[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] xen 4.3 -> 4.4.0 API change / spurious file handle closure



On 18/08/14 13:28, Alex Bligh wrote:
> I have an application which works when compiled against
> Xen 4.3 but when compiled against Xen 4.4.0 causes a
> spurious file handle closure. Specifically fd 0 is
> closed when it has nothing to do with Xen. This
> happens with a simple call to libxl_ctx_alloc /
> libxl_ctx_free.
>
> This can be seen from the snippet below which
> simply lists the open fds. In the 'before' call,
> the 'ls' command (run from system) opens fd 3
> for the directory. In the 'after' call, the
> alloc/free has closed fd 0, so fd 0 is reused
> for the 'ls' command.
>
> This worked fine under Xen 4.3.
>
> The addition of
>   #define LIBXL_API_VERSION 0x040200
> does not appear to affect things.
>
> Any idea what's up here?
>

Thats antisocial.  I have reproduced the issue.

Stracing it (with some extra debugging)...

write(1, "Freeing libxl ctx", 17Freeing libxl ctx)       = 17
write(1, "\n", 1
)                       = 1
close(5)                                = 0
close(6)                                = 0
close(7)                                = 0
close(3)                                = 0
close(4)                                = 0
close(0)                                = 0
write(1, "Finished freeing", 16Finished freeing)        = 16

Shows that libxl_ctx_free() is closing fd 0.

I suspect it has an fd which is 0 rather than -1.  I will take a look.

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.