Re: autofs 5.1.6 : segfault at startup

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

 



On Tue, 2020-12-08 at 10:39 +0800, Ian Kent wrote:
> On Sun, 2020-12-06 at 06:49 +0800, Ian Kent wrote:
> > On Sat, 2020-12-05 at 12:38 -0300, Andreas Hasenack wrote:
> > > Hi,
> > > 
> > > On Sat, Dec 5, 2020 at 6:32 AM Ian Kent <raven@xxxxxxxxxx> wrote:
> > > 
> > > > Removing the LDFLAGS option -Wl,-Bsymbolic-functions makes the
> > > > problem go away.
> > > 
> > > Related:
> > > https://www.spinics.net/lists/autofs/msg01903.html
> > > 
> > > In Ubuntu, -Wl,-Bsymbolic-functions is a system-wide default and
> > > we
> > > remove it from the flags when building autofs in d/rules:
> > > 
> > > # Taken from #1636781 as it's the same problem here. Also see
> > > # 
> > > https://lists.ubuntu.com/archives/ubuntu-devel/2018-June/040369.html
> > > ifeq ($(shell dpkg-vendor --derives-from Ubuntu && echo yes),yes)
> > >   export DEB_LDFLAGS_MAINT_STRIP = -Wl,-Bsymbolic-functions
> > > endif
> > > 
> > > 
> > > > I'm not sure why this happens, the best I could find is this:
> > > > https://stackoverflow.com/questions/7216973/is-there-a-downside-to-using-bsymbolic-functions/20729291
> > 
> > The unfortunate fact is that automount is a threaded application,
> > and
> > it does allocate and initialize that configuration variable earlier
> > than any accesses from functions in lib/defaults.c, so the
> > configuration variable should not be NULL in any thread at some
> > later point.
> > 
> > Admittedly that initialization function return should be checked
> > but I don't see how that can cause this. The validity of this
> > variable shouldn't need to be checked elsewhere in the config.
> > handling functions.
> > 
> > It's fine to call this a bug in autofs but what is the bug, IDGT?
> > Is it certain the optimisation option isn't broken in some way?
> 
> Thinking about this further it may be due to my use of a static
> library that is linked to each object, automount and the shared
> lookup, parse and mount shared libraries.
> 
> Still, this problem occurring entirely within in the main() function,
> before any shared libraries are used where only the fork() to become
> a daemon has occurred when this crash occurs, makes me wonder about
> this link option.
> 
> It may be that to fix this I need to change that static library to a
> shared library. I'm not sure how much work that would be but I
> suspect
> it would be quite a bit ... or maybe the use that link option is
> broken
> and so misguided in itself ...

So making the static library a shared library fixes this and, if
I haven't made any mistakes that haven't showed up yet, seems
fairly straight forward to do.

Ian




[Index of Archives]     [Linux Filesystem Development]     [Linux Ext4]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux