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

[Pkg-xfce-devel] Bug#829557: Bug#829557: Bug#829557: firefox: error box at start-up / D-BUS related issue



On 2016-07-11 16:05:50 +0200, Yves-Alexis Perez wrote:
> On Mon, 2016-07-11 at 06:46 -0700, Vincent Lefevre wrote:
> > On 2016-07-11 13:03:55 +0200, Yves-Alexis Perez wrote:
> > > So it seems stdin is closed for the second login. Could it break dbus-
> > > launch/dbus-daemon somehow?
> > 
> > In general, closing stdin is a bad idea, at least under Linux,
> > because if a new file needs to be opened by the process or one of
> > its descendants, fd 0 will be reused (while it is not expected to
> > correspond to stdin), and this may clash with other functions that
> > try to read stdin (= fd 0)...
> 
> Well, lightdm is not explicitely closing /dev/stdin. And adding
> checks for (fd == 0) before every close() call might not be the best
> practice either.

I think that the best thing to do if one doesn't want to leave
the fd on stdin may be to redirect it to /dev/null. I suppose
that the "close" was not there to save a file descriptor, so
that a redirection could be sufficient. Now, it is also possible
that the problem would reappear if fd 0 is redirected (there are
unfortunately no explanations of the bug in the correction).

-- 
Vincent Lef?vre <vincent at vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)




Reply to: