{"action":"created","issue":{"url":"https://api.github.com/repos/FreeRADIUS/freeradius-server/issues/1127","labels_url":"https://api.github.com/repos/FreeRADIUS/freeradius-server/issues/1127/labels{/name}","comments_url":"https://api.github.com/repos/FreeRADIUS/freeradius-server/issues/1127/comments","events_url":"https://api.github.com/repos/FreeRADIUS/freeradius-server/issues/1127/events","html_url":"https://github.com/FreeRADIUS/freeradius-server/issues/1127","id":93473557,"number":1127,"title":"Segfault after ldap user object is found","user":{"login":"kokel","id":2283789,"avatar_url":"https://avatars.githubusercontent.com/u/2283789?v=3","gravatar_id":"","url":"https://api.github.com/users/kokel","html_url":"https://github.com/kokel","followers_url":"https://api.github.com/users/kokel/followers","following_url":"https://api.github.com/users/kokel/following{/other_user}","gists_url":"https://api.github.com/users/kokel/gists{/gist_id}","starred_url":"https://api.github.com/users/kokel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kokel/subscriptions","organizations_url":"https://api.github.com/users/kokel/orgs","repos_url":"https://api.github.com/users/kokel/repos","events_url":"https://api.github.com/users/kokel/events{/privacy}","received_events_url":"https://api.github.com/users/kokel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-07T08:40:54Z","updated_at":"2015-07-07T15:54:56Z","closed_at":null,"body":"Hello,\r\n\r\nusing here FreeRADIUS 3.0.8 on CentOS 7 with OpenLDAP 2.4.39.\r\nradiusd is segfaulting after ldap user object is found:\r\n```\r\nReady to process requests\r\n(0) Received Access-Request Id 179 from 127.0.0.1:58849 to 127.0.0.1:1812 length 93\r\n(0)   User-Name = 'hachmer'\r\n(0)   User-Password = 'pass'\r\n(0)   NAS-IP-Address = 10.110.10.12\r\n(0)   NAS-Port = 0\r\n(0)   Message-Authenticator = 0xbbc3d675f6cbfa3c16a14d340342375f\r\n(0)   Framed-Protocol = PPP\r\n(0) # Executing section authorize from file /etc/raddb/sites-enabled/default\r\n(0)   authorize {\r\n(0)     [preprocess] = ok\r\n(0)     [files] = noop\r\nrlm_ldap (ldap): Reserved connection (4)\r\n(0) ldap: EXPAND (&(uid=%{%{Stripped-User-Name}:-%{User-Name}})(objectClass=radiusProfile))\r\n(0) ldap:    --> (&(uid=hachmer)(objectClass=radiusProfile))\r\n(0) ldap: Performing search in \"ou=asaradius,dc=example,dc=com\" with filter \"(&(uid=hachmer)(objectClass=radiusProfile))\", scope \"sub\"\r\n(0) ldap: Waiting for search result...\r\n(0) ldap: User object found at DN \"uid=hachmer,ou=netzwerk,ou=users,ou=asaradius,dc=example,dc=com\"\r\n\r\nProgram received signal SIGSEGV, Segmentation fault.\r\n0x00007ffff7977076 in fr_cursor_insert (cursor=cursor@entry=0x7fffffffbc10, vp=vp@entry=0xc33270) at src/lib/cursor.c:306\r\n306             if (!*cursor->first) {\r\nMissing separate debuginfos, use: debuginfo-install cyrus-sasl-lib-2.1.26-17.el7.x86_64 glibc-2.17-78.el7.x86_64 keyutils-libs-1.5.8-3.el7.x86_64 krb5-libs-1.12.2-14.el7.x86_64 libcom_err-1.42.9-7.el7.x86_64 libpcap-1.5.3-4.el7_1.2.x86_64 libselinux-2.2.2-6.el7.x86_64 libtalloc-2.1.1-1.el7.x86_64 ncurses-libs-5.9-13.20130511.el7.x86_64 nspr-4.10.8-1.el7_1.x86_64 nss-3.19.1-3.el7_1.x86_64 nss-softokn-3.16.2.3-9.el7.x86_64 nss-softokn-freebl-3.16.2.3-9.el7.x86_64 nss-util-3.19.1-1.el7_1.x86_64 openldap-2.4.39-6.el7.x86_64 openssl-libs-1.0.1e-42.el7.9.x86_64 pcre-8.32-14.el7.x86_64 readline-6.2-9.el7.x86_64 sqlite-3.7.17-4.el7.x86_64 xz-libs-5.1.2-9alpha.el7.x86_64 zlib-1.2.7-13.el7.x86_64\r\n```\r\nDebug Output from ```radiusd -X```:\r\n```\r\n  # Instantiating module \"ldap\" from file /etc/raddb/mods-enabled/ldap\r\n  ldap {\r\n        server = \"ldapserver\"\r\n        port = 389\r\n        password = <<< secret >>>\r\n        identity = \"uid=radius,ou=systems,dc=example,dc=de\"\r\n        valuepair_attribute = \"radiusAttribute\"\r\n        read_clients = no\r\n   user {\r\n        scope = \"sub\"\r\n        access_attribute = \"radiusAccountStatus\"\r\n        access_positive = yes\r\n   }\r\n   group {\r\n        filter = \"(objectClass=posixGroup)\"\r\n        scope = \"sub\"\r\n        name_attribute = \"cn\"\r\n        membership_attribute = \"memberOf\"\r\n        membership_filter = \"(member=%{control:Ldap-UserDn})\"\r\n        cacheable_name = no\r\n        cacheable_dn = yes\r\n   }\r\n   client {\r\n        scope = \"sub\"\r\n        base_dn = \"\"\r\n   }\r\n   profile {\r\n        attribute = \"radiusProfileDn\"\r\n   }\r\n   options {\r\n        ldap_debug = 40\r\n        chase_referrals = yes\r\n        rebind = yes\r\n        net_timeout = 1\r\n        res_timeout = 20\r\n        srv_timelimit = 20\r\n        idle = 60\r\n        probes = 3\r\n        interval = 3\r\n   }\r\n   tls {\r\n        ca_file = \"/etc/raddb/certs/rootca_cert.pem\"\r\n        start_tls = yes\r\n        require_cert = \"demand\"\r\n   }\r\n  }\r\nrlm_ldap: libldap vendor: OpenLDAP, version: 20439\r\n   accounting {\r\n        reference = \"%{tolower:type.%{Acct-Status-Type}}\"\r\n   }\r\n   post-auth {\r\n        reference = \".\"\r\n   }\r\nrlm_ldap (ldap): Initialising connection pool\r\n   pool {\r\n        start = 5\r\n        min = 4\r\n        max = 32\r\n        spare = 3\r\n        uses = 0\r\n        lifetime = 0\r\n        cleanup_interval = 30\r\n        idle_timeout = 60\r\n        retry_delay = 1\r\n        spread = no\r\n   }\r\n```\r\nConfiguration in ldap-module config-file:\r\n```\r\nldap {\r\n        server = 'ldapserver'\r\n        port = 389\r\n        identity = 'uid=radius,ou=systems,dc=example,dc=de'\r\n        password = pass\r\n        base_dn = 'ou=asaradius,dc=example,dc=de'\r\n        valuepair_attribute = 'radiusAttribute'\r\n        update {\r\n                control:Password-With-Header    += 'userPassword'\r\n                reply:Idle-Timeout              := 'radiusIdleTimeout'\r\n                reply:Session-Timeout           := 'radiusSessionTimeout'\r\n                reply:Service-Type              := 'radiusServiceType'\r\n                request:Simultaneous-Use        := 'radiusSimultaneousUse'\r\n                control:Expiration              := 'radiusExpiration'\r\n                request:Huntgroup-Name          := 'radiusHuntgroupName'\r\n                control:Auth-Type               := 'radiusAuthType'\r\n        }\r\n        user {\r\n                base_dn = \"${..base_dn}\"\r\n                filter = \"(&(uid=%{%{Stripped-User-Name}:-%{User-Name}})(objectClass=radiusProfile))\"\r\n                scope = 'sub'\r\n                access_attribute = 'radiusAccountStatus'\r\n                access_positive = yes\r\n        }\r\n        group {\r\n                base_dn = \"${..base_dn}\"\r\n                filter = '(objectClass=posixGroup)'\r\n                scope = 'sub'\r\n                name_attribute = cn\r\n                membership_filter = \"(member=%{control:Ldap-UserDn})\"\r\n                membership_attribute = 'memberOf'\r\n                cacheable_dn = 'yes'\r\n        }\r\n        profile {\r\n                filter = '(objectclass=radiusObjectProfile)'\r\n                default = 'uid=defaultprofile,ou=asaradius,dc=example,dc=de'\r\n                attribute = 'radiusProfileDn'\r\n        }\r\n        client {\r\n                template {\r\n                }\r\n        }\r\n        read_clients = no\r\n        accounting {\r\n                reference = \"%{tolower:type.%{Acct-Status-Type}}\"\r\n                type {\r\n                        start {\r\n                                update {\r\n                                        description := \"Online at %S\"\r\n                                }\r\n                        }\r\n                        interim-update {\r\n                                update {\r\n                                        description := \"Last seen at %S\"\r\n                                }\r\n                        }\r\n                        stop {\r\n                                update {\r\n                                        description := \"Offline at %S\"\r\n                                }\r\n                        }\r\n                }\r\n        }\r\n        post-auth {\r\n                update {\r\n                        description := \"Authenticated at %S\"\r\n                }\r\n        }\r\n        options {\r\n                chase_referrals = yes\r\n                rebind = yes\r\n                timeout = 10\r\n                timelimit = 3\r\n                net_timeout = 1\r\n                idle = 60\r\n                probes = 3\r\n                interval = 3\r\n                ldap_debug = 0x0028\r\n        }\r\n        tls {\r\n                start_tls = yes\r\n                ca_file = ${certdir}/rootca_cert.pem\r\n                require_cert    = 'demand'\r\n        }\r\n        pool {\r\n                start = 5\r\n                min = 4\r\n                max = ${thread[pool].max_servers}\r\n                spare = 3\r\n                uses = 0\r\n                lifetime = 0\r\n                idle_timeout = 60\r\n                retry_delay = 1\r\n        }\r\n}\r\n```\r\n\r\nAnother thing I have noticed that the variable ```base_dn = '${..base_dn}'``` is only expanded when double quotes are used: ```base_dn = \"${..base_dn}\"```:\r\n```\r\n(0) ldap: EXPAND (&(uid=%{%{Stripped-User-Name}:-%{User-Name}})(objectClass=radiusProfile))\r\n(0) ldap:    --> (&(uid=hachmer)(objectClass=radiusProfile))\r\n(0) ldap: Performing search in \"${..base_dn}\" with filter \"(&(uid=hachmer)(objectClass=radiusProfile))\", scope \"sub\"\r\n(0) ldap: Waiting for search result...\r\n(0) ldap: ERROR: Failed performing search: Invalid DN syntax\r\n(0) ldap: ERROR: Server said: invalid DN. \r\nrlm_ldap (ldap): Released connection (4)\r\n```\r\n\r\nIf any further information needed please let me know.\r\nThanks in advance!"},"comment":{"url":"https://api.github.com/repos/FreeRADIUS/freeradius-server/issues/comments/119247229","html_url":"https://github.com/FreeRADIUS/freeradius-server/issues/1127#issuecomment-119247229","issue_url":"https://api.github.com/repos/FreeRADIUS/freeradius-server/issues/1127","id":119247229,"user":{"login":"qnet-herwin","id":2010013,"avatar_url":"https://avatars.githubusercontent.com/u/2010013?v=3","gravatar_id":"","url":"https://api.github.com/users/qnet-herwin","html_url":"https://github.com/qnet-herwin","followers_url":"https://api.github.com/users/qnet-herwin/followers","following_url":"https://api.github.com/users/qnet-herwin/following{/other_user}","gists_url":"https://api.github.com/users/qnet-herwin/gists{/gist_id}","starred_url":"https://api.github.com/users/qnet-herwin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qnet-herwin/subscriptions","organizations_url":"https://api.github.com/users/qnet-herwin/orgs","repos_url":"https://api.github.com/users/qnet-herwin/repos","events_url":"https://api.github.com/users/qnet-herwin/events{/privacy}","received_events_url":"https://api.github.com/users/qnet-herwin/received_events","type":"User","site_admin":false},"created_at":"2015-07-07T15:54:56Z","updated_at":"2015-07-07T15:54:56Z","body":"Could you provide the information as described on http://wiki.freeradius.org/project/bug-reports#Crashes-%28Segmentation-violations,-Memory-alignment-errors,-ASSERTs-etc...%29, thus building with development symbols and added a gdb backtrace."}}