hpaio backend writes to fd 0, breaks saned/net

Bug #283699 reported by Mark Purcell
2
Affects Status Importance Assigned to Milestone
HPLIP
Invalid
Undecided
Unassigned
hplip (Debian)
Won't Fix
Unknown

Bug Description

Forwarded from: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=495005

From: Julien BLACHE <email address hidden>
To: <email address hidden>
Cc: <email address hidden>, <email address hidden>, <email address hidden>
Subject: Re: Bug#495005: xsane segfaults
Date: Wed, 13 Aug 2008 21:36:51 +0200

reassign 495005 hplip 2.8.6-2
retitle 495005 hpaio backend writes to fd 0, breaks saned/net
severity 495005 important
thanks

Julien Danjou <email address hidden> wrote:

Hi hplip folks,

>> That kind of segfault in the net protocol stack is usually due to a
>> standard violation by the remote backend.

> Acually, I managed to get it work using saned -a, so I can't get any
> debug value which might help, since inetd mode does not support debug.
>
> Using saned from inetd still make the remote xsane/xscanimage to
> ask for authentication and then segfault.

This is a clear indication that the hpaio backend is writing to fd 0.

It's a bug in the code, either a fd declared static that's not
initialized to -1, or an fd explicitely initialized to 0, or, more
likely, the fd member of a struct that gets memset() after allocation
and is not properly initialized to -1 afterwards.

In any case, this breaks saned when run through inetd which is
guaranteed to render hpaio unusable over the network with the net
backend as whatever is written to fd 0 will confuse the hell out of
the net protocol stack.

JB.

Changed in hplip:
status: Unknown → Confirmed
Revision history for this message
David Suffield (david-suffield) wrote :

Show me the code :)

Hpaio has no io that writes to stdout. If you set SANE_DEBUG_DLL the sanei_init_debug() will write to stderr.

-dave

Revision history for this message
Aaron Albright (albrigha-deactivatedaccount) wrote :

Please update with the information Dave is requesting.

Thanks!

Aaron

Changed in hplip:
status: New → Incomplete
Revision history for this message
Aaron Albright (albrigha-deactivatedaccount) wrote :

No update from user, closing.

Aaron

Changed in hplip:
assignee: nobody → kalosaurusrex
status: Incomplete → Invalid
Revision history for this message
Mark Purcell (msp) wrote : Re: [Bug 283699] Re: hpaio backend writes to fd 0, breaks saned/net

On Saturday 28 March 2009 08:18:21 Aaron Albright wrote:
> No update from user, closing.
>
> Aaron
>
> ** Changed in: hplip
> Assignee: (unassigned) => Aaron Albright (kalosaurusrex)
> Status: Incomplete => Invalid
> --
> hpaio backend writes to fd 0, breaks saned/net
> https://bugs.launchpad.net/bugs/283699

Aaron,

This is premature.

Whilst I can't show you the code, this still appears to be an issue for the
upstream user.

 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=495005

Mark

Revision history for this message
Mark Purcell (msp) wrote :

From: Julien BLACHE <email address hidden>
To: Mark Purcell <email address hidden>
Cc: Bug 283699 <email address hidden>, <email address hidden>, <email address hidden>, <email address hidden>
Subject: Re: [Bug 283699] Re: hpaio backend writes to fd 0, breaks saned/net
Date: Fri, 03 Apr 2009 14:35:31 +0200

Mark Purcell <email address hidden> wrote:

Hi,

> Whilst I can't show you the code, this still appears to be an issue for the
> upstream user.

The problem has been tracked down to libdbus complaining
unconditionally on stderr when it's not able to establish a connection
to the DBus daemon.

Consequently, I've added a workaround in saned CVS and sane-backends
1.0.19-26.

I have to had that this has been uncovered by a user digging deep
enough to reveal the problem. Enough said.

JB.

--
 Julien BLACHE <email address hidden> | Debian, because code matters more
 Debian & GNU/Linux Developer | <http://www.debian.org>
 Public key available on <http://www.jblache.org> - KeyID: F5D6 5169
 GPG Fingerprint : 935A 79F1 C8B3 3521 FD62 7CC7 CD61 4FD7 F5D6 5169

Changed in hplip (Debian):
status: Confirmed → Won't Fix
Changed in hplip (Debian):
status: Won't Fix → Confirmed
Changed in hplip (Debian):
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.