Thanks for the feedback. I have moved a version of sanei_init_debug into
hpaio source tree. This should remove the libsane.so dependency in the
next hplip release.

-dave 

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf 
> Of Jeremy White
> Sent: Monday, March 19, 2007 6:21 AM
> To: hplip-devel@lists.sourceforge.net
> Subject: [HPLIP-Devel] Subtle bug with libsane-hpaio.so and 
> unresolvedsymbol sanei_init_debug
> 
> I recently uncovered what appears to be a subtle bug with 
> libsane-hpaio.so.  I did some digging, but felt that I wasn't 
> familiar enough with either sane or the hplip project to 
> propose a patch.
> 
> I'm hoping that someone here will step up and resolve the issue.
> 
> Specifically, libsane-hpaio.so is built with a weak symbolic 
> reference to sanei_init_debug; all 'normal' sane backends 
> include their own private copy of that function and so have 
> no need for libsane.so.  This breaks applications in rare situations.
> 
> Now, in normal operation, libsane is dlopen'd by an 
> application with RTLD_GLOBAL, so that all of it's symbols are 
> available for further resolution.
> 
> When libsane initializes, it dlopen's libsane-hpaio with 
> local|lazy, and then dlsyms to the various functions.  Then, 
> when those functions are invoked, ld fixes them up, uses the 
> global libsane to resolve sanei_init_debug, and life is good.
> 
> However, if you have an application which dlopen's libsane.so
> *without* RTLD_GLOBAL, life is much worse.  Because when ld 
> goes to fix up the dlsym'd functions, it realizes - ZOMG - 
> that sanei_debug_init isn't available, and crashes the whole 
> application.
> 
> This results in Wine applications crashing any time they 
> attempt to initialize libsane, which is quite awful, as you 
> can imagine.
> 
> Now, I've patched Wine to explicitly load libsane with RTLD_GLOBAL:
>   
> http://source.winehq.org/git/wine.git/?a=commit;h=16f33d8b436a
> abf3b9e3ba810b68b596d9ddd687
> 
> But I felt honor bound to report this problem 'upstream', in 
> the hopes that someone here could fix it properly.  At the 
> least, I've now done my duty :-/.
> 
> I've attached a test program I used in probing this, in case 
> it's handy, along with output runs (on a Fedora Core 6 box, 
> where I first noticed this) that illustrate the problem.
> 
> Cheers,
> 
> Jeremy
> 
> 

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
HPLIP-Devel mailing list
HPLIP-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hplip-devel

Reply via email to