Re: make dll.c robust against it being listed in its configuration file...

From: Oliver Rauch (oliver.rauch@Wolfsburg.DE)
Date: Fri Oct 20 2000 - 06:27:07 PDT

  • Next message: Oliver Rauch: "Re: sane fronten packages"

    Jochen Eisinger wrote:
    >
    > Hi!
    >
    > [Petter Reinholdtsen]
    > >
    > > [Jochen Eisinger]
    > > > What about just checking the backend name against "dll" while
    > > > reading the dll.conf? This avoids that dll segfaults if dll is
    > > > listed in the dll.conf.
    > >
    > > Why do dll segfault? Shouldn't this be fixed first?
    > Because the dll - backend is loaded recursivly about 100.000 times...
    > actually dll doesn't segfault, but sooner or later one of the backends
    > segfaults when allocating new memory.
    >
    > > I have not tested the patch, but it looks OK to me. I only suspect it
    > > might be the wrong fix. :-)
    > Ok, might be... I've another fix: instead of linking libsane.* to
    > sane/libsane-dll.* we could copy libsane-dll.* to libsane.* and remove
    > the dll-backend from the lib/sane/ directory. This way, the dll-backend
    > can't load itself (because it isn't present as a backend)
    >
    > what about this?
    >
    Hi Jochen,

    I think the right way is to look for "dll" in dll.conf and ignore it.

    There is a good reason for the links form libsane.so to sane/libsane-dll.so:
    All sane libraries can be used directly. You can link from
    sane/libsane-mustek.so to libsane.so and the mustek backend is loaded directly.

    If someone adds dll to dll.conf it is his fault, if I program a recursive loop
    that allocates memory I also get in trouble. So checking for dll in dll.conf
    is the correct way. dll should print a warning when it finds "dll" in dll.conf
    and ignore that.

    Bye
    Oliver

    -- 
    Homepage:	http://www.wolfsburg.de/~rauch
    sane-umax:	http://www.wolfsburg.de/~rauch/sane/sane-umax.html
    xsane:		http://www.wolfsburg.de/~rauch/sane/sane-xsane.html
    E-Mail:		mailto:Oliver.Rauch@Wolfsburg.DE
    

    -- Source code, list archive, and docs: http://www.mostang.com/sane/ To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com



    This archive was generated by hypermail 2b29 : Fri Oct 20 2000 - 07:15:28 PDT