Share

NSS MySQL Library

The forum address has changed, you have been automatically redirected. Please update any bookmarks to use the new URL.

Subscribe

Segfault on FreeBSD 7.0 AMD64 on group query

You are viewing a single message from this topic. View all messages.

  1. 2009-01-22 18:09:26 UTC
    After looking at the backtrace and understanding what is going on a little more, it looks like something in the output of my getgrgid query isn't being handled properly; strlen() is segfaulting for some reason:

    #0 0x00000008008209e2 in strlen () from /lib/libc.so.7
    #1 0x000000080081dd1b in strchr () from /lib/libc.so.7
    #2 0x00000008008181fa in snprintf () from /lib/libc.so.7
    #3 0x0000000800b0494b in nss_module_register () from /usr/local/lib/nss_mysql.so.1
    #4 0x0000000800b0524f in nss_module_register () from /usr/local/lib/nss_mysql.so.1
    #5 0x000000080078792e in __nss_compat_getgrgid_r () from /lib/libc.so.7
    #6 0x0000000800802c49 in nsdispatch () from /lib/libc.so.7
    #7 0x00000008007d3144 in getgrgid_r () from /lib/libc.so.7
    #8 0x00000008007d2fc1 in innetgr () from /lib/libc.so.7

    The last lines in my debug are:
    [27313]: _nss_mysql_build_query: ENTER
    [27313]: _nss_mysql_build_query: BYNUM, num = '2176'

    So it looks like it's trying to build a query and segfaults where somehow.

    After looking at my query some more; I finally found the problem:

    getgrgid SELECT project AS name, '*' AS password, (projId + 2000) AS gid \
    FROM domain_projects \
    WHERE projId = '%1$s' - 2000 \
    LIMIT 1

    For my where query I was doing a string comparison ("%1$s") instead of numeric ("%1$u"). I fixed this (and in several other queries as well) and things are functioning.

    Hope this is helpful to others!

    Now I hope nscd helps with my run time since querying *all* of my groups in mysql takes some time :-P.

    -Doug
< Previous | 1 | Next >

Add a Reply

This forum does not allow anonymous participation.

Log in to add a reply. Not registered? Create an account to participate and receive email updates when replies are posted to this topic.