Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Mar 2008 19:24:15 -0300
From:      "Alexandre Biancalana" <biancalana@gmail.com>
To:        freebsd-stable@freebsd.org
Subject:   AMD64 only Segmentation fault (was: 7-STABLE(AMD64)+Qmail-LDAP core dump)
Message-ID:  <8e10486b0803031424x31556698qa1bd1bbab8e8376f@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hi list,

  I found a situation that I can't explain, I have qmail-ldap running
at some FreeBSD 6.2 without any problem. Friday after Installed a new
server this time with 7-STABLE. I stated to get core dumped from
qmail-ldap when they try access the OpenLDAP database.

 I compiled/run this simple C program in 7-STABLE i386 and AMD64 and
the program dumps the core only in AMD64.

 The following the C program trigger the core dump

#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <unistd.h>
#include <lber.h>
#include <ldap.h>


int main (void ) {

        LDAP *ld;
        int rc,version;
        version=3;

        if ( (ld = ldap_init("127.0.0.1",LDAP_PORT)) == 0) {
                perror("Connecting..");
        }

        rc = ldap_set_option(ld, LDAP_OPT_PROTOCOL_VERSION, &version);

        if ( rc != LDAP_OPT_SUCCESS) {

                printf("Errorrrr (%s)\n", ldap_err2string(rc));
        }

}

Using the following commands to compile:
# gcc -I/usr/local/include -g -c  a.c
# gcc -L/usr/local/lib -o a  a.o -lldap

When I run the binary in AMD64 I get this:

# ./a
Segmentation fault (core dumped)

Then I compiled the libldap.so with debug symbols and run the program
througth gdb:

# gdb a
                                                      GNU gdb 6.1.1
[FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "amd64-marcel-freebsd"...
(gdb) run
Starting program: /tmp/a

Program received signal SIGSEGV, Segmentation fault.
ldap_set_option (ld=0xf30040, option=17, invalue=0x7fffffffec2c) at
options.c:358
358                     assert( LDAP_VALID( ld ) );
(gdb) bt
#0  ldap_set_option (ld=0xf30040, option=17, invalue=0x7fffffffec2c)
at options.c:358
#1  0x000000000040083c in main () at a.c:19
(gdb)

 Now I reach to a point that I don't know what more to do....

 Any help is *very* appreciated !

 Best Regards,

Alexandre



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8e10486b0803031424x31556698qa1bd1bbab8e8376f>