Re: segfault in lookup_ldap and elsewhere when building with -Wl,-Bsymbolic-functions

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

 



On Tue, 2018-06-12 at 07:49 +0800, Ian Kent wrote:
> On Mon, 2018-06-11 at 14:56 -0300, Andreas Hasenack wrote:
> > Hello,
> > 
> > I was pulling the latest autofs from Debian into Ubuntu and, due to a
> > mistake of mine, I dropped a line in d/rules that was _removing_ the
> > -Wl,-Bsymbolic-functions flag from LDFLAGS set by Ubuntu.
> > 
> > The build proceeded as normal, packages installed, and I started
> > getting segfaults all over the place.
> > 
> > This has happened before:
> > https://bugs.launchpad.net/ubuntu/+source/autofs/+bug/1470687: Not
> > working properly with compile options "-symbolic-functions"
> > https://bugs.launchpad.net/ubuntu/+source/autofs/+bug/1472115: autofs
> > start fails: segfault at 0 ip ....
> > https://bugs.launchpad.net/ubuntu/+source/autofs/+bug/1503034: Autofs
> > 5.1.1-1ubuntu2 crashes with segfault on startup
> > 
> > For the lookup_ldap specific case, just dropping the linker flag from
> > Ubuntu's LDFLAGS wasn't enough, because it leaks back in via
> > $(krb5-config --libs), so a patch (attached) was contributed by
> > Malcolm Scott (https://bugs.launchpad.net/ubuntu/+source/autofs/+bug/1503034
> > /c
> > omments/7).
> > The patch still applies to current master, but with some offset.
> > 
> > Would there be interest from upstream in adopting this patch, even
> > though there is no crash on a default upstream build? If this makes
> > sense, other modules could follow the same path.

There would be but ...

> > 
> > I also asked ubuntu-devel for the reasoning for
> > -Wl,-Bsymbolic-functions and why Debian isn't using it:
> > https://lists.ubuntu.com/archives/ubuntu-devel/2018-June/040369.html.
> > It looks like it's one of those things that just never converged
> > between the two distros.
> 
> Interesting.
> I thought I initialized the config earlier, during startup.
> I'll have a closer look later.

I do call defaults_read_config(0) to perform the initialization
quite early in the program start up.

ie. in daemon/automount.c

        program = argv[0];

        defaults_read_config(0);

        nfs_mount_uses_string_options = check_nfs_mount_version(&vers, &check);

        kpkt_len = get_kpkt_len();
        master_wait = defaults_get_master_wait();
        timeout = defaults_get_timeout();
        ghost = defaults_get_browse_mode();
        logging = defaults_get_logging();
        global_selection_options = 0;
        global_options = NULL;
        have_global_options = 0;
        foreground = 0;
        dumpmaps = 0;
        daemon_check = 1;

        remove_empty_args(argv, &argc);

which occurs before program options processing.

So I'm not sure why you started seeing SEGVs .... and I wonder why
it looked like it was due to a lack of defaults initialization?

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