Opened 6 months ago

Last modified 6 months ago

#65622 new defect

samba4: configure freezes on Checking for setproctitle_init

Reported by: barracuda156 Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.7.2
Keywords: powerpc Cc: mascguy (Christopher Nielsen)
Port: samba4


I tried both existing in Macports v. 4.15.5 and the latest 4.16.4 (I thought to update the port), same failure – configure reaches the following and then freezes, nothing is happening further:

Checking for library setproctitle                                     : no 
Checking for setproctitle                                             : not found 
Checking for library bsd                                              : no 
Checking for setproctitle                                             : not found 
Checking for setproctitle_init                                        : not found 
Checking for library bsd                                              : no 
Checking for setproctitle_init                                        : not found 
Checking for closefrom                                                : not found 
Checking for library bsd                                              : no 

Any idea what is going wrong?

Change History (4)

comment:1 Changed 6 months ago by barracuda156

So it freezes somewhere around this part of configure script:

    # libbsd on some platforms provides strlcpy and strlcat
    if not conf.CHECK_FUNCS('strlcpy strlcat'):
        if conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h',
            strlcpy_in_bsd = True
    if not conf.CHECK_FUNCS('getpeereid'):
        conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h')
    if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'):
        conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h')
    if not conf.CHECK_FUNCS('setproctitle_init'):
        conf.CHECK_FUNCS_IN('setproctitle_init', 'bsd', headers='sys/types.h bsd/unistd.h')

    if not conf.CHECK_FUNCS('closefrom'):
        conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h')

                struct ucred cred;
                socklen_t cred_len;
                int ret = getsockopt(0, SOL_SOCKET, SO_PEERCRED, &cred, &cred_len);''',
                msg="Checking whether we can use SO_PEERCRED to get socket credentials",
                headers='sys/types.h sys/socket.h')

    #Some OS (ie. freebsd) return EINVAL if the conversion could not be done, it's not what we expect
    #Let's detect those cases
                        long long nb = strtoll("Text", NULL, 0);
                        if (errno == EINVAL) {
                            return 0;
                        } else {
                            return 1;
                        msg="Checking correct behavior of strtoll",
                        headers = 'errno.h',
                        execute = True,
                        define = 'HAVE_BSD_STRTOLL',
    conf.CHECK_FUNCS('if_nametoindex strerror_r')
    conf.CHECK_FUNCS('gai_strerror get_current_dir_name')
    conf.CHECK_FUNCS('timegm getifaddrs freeifaddrs mmap setgroups syscall setsid')
    conf.CHECK_FUNCS('getgrent_r getgrgid_r getgrnam_r getgrouplist getpagesize')
    conf.CHECK_FUNCS('getpwent_r getpwnam_r getpwuid_r epoll_create')
    if not conf.CHECK_FUNCS('copy_file_range'):
                        headers='sys/syscall.h unistd.h',
                        msg='Checking whether we have copy_file_range system call')

    conf.SET_TARGET_TYPE('attr', 'EMPTY')

    xattr_headers='sys/attributes.h attr/xattr.h sys/xattr.h'

    # default to 1, we set it to 0 if we don't find any EA implementation below:
    if conf.CHECK_FUNCS_IN('getxattr', 'attr', checklibc=True, headers=xattr_headers):
        conf.DEFINE('HAVE_XATTR_XATTR', 1)
        # Darwin has extra options to xattr-family functions
        conf.CHECK_CODE('getxattr(NULL, NULL, NULL, 0, 0, 0)',
                        headers=xattr_headers, local_include=False,
                        msg="Checking whether xattr interface takes additional options")
    elif conf.CHECK_FUNCS_IN('attr_listf', 'attr', checklibc=True, headers=xattr_headers):
        conf.DEFINE('HAVE_XATTR_ATTR', 1)
    elif conf.CHECK_FUNCS('extattr_list_fd'):
        conf.DEFINE('HAVE_XATTR_EXTATTR', 1)
    elif conf.CHECK_FUNCS('flistea'):
        conf.DEFINE('HAVE_XATTR_EA', 1)
    elif not conf.CHECK_FUNCS('attropen'):
            conf.DEFINE('HAVE_XATTR_SUPPORT', 0)

    conf.CHECK_FUNCS_IN('dlopen dlsym dlerror dlclose', 'dl',
                        checklibc=True, headers='dlfcn.h dl.h')

    conf.CHECK_C_PROTOTYPE('dlopen', 'void *dlopen(const char* filename, unsigned int flags)',
                           define='DLOPEN_TAKES_UNSIGNED_FLAGS', headers='dlfcn.h dl.h')

comment:2 Changed 6 months ago by mascguy (Christopher Nielsen)

Cc: mascguy added

comment:3 Changed 6 months ago by mascguy (Christopher Nielsen)

Is this happening for legacy 10.5 and/or 10.6...?

comment:4 in reply to:  3 Changed 6 months ago by barracuda156

Replying to mascguy:

Is this happening for legacy 10.5 and/or 10.6...?

I will check Leopard and SL PPC by the end of this month. Rosetta has the problem on 10.6.8. I am quite sure I never had samba4 built on either of three systems, but I don’t recall to what extent I tried.

But btw, if you remember, Ruby31 has troubles on some socket-related stuff on PPC too.

Note: See TracTickets for help on using tickets.