Menu

#26 SEGFAULT under Solaris

open
nobody
None
5
2004-01-13
2004-01-13
No

I've compiled cpu 1.4.3 with openldap 2.1.25 and gcc
3.3.2, under Solaris 9 for Sparc. The compile is fine,
but trying to run cpu with any arguments yields an
immediate segfault.

For example:

# gdb
(gdb) set args useradd newuser
(gdb) exec-file /local/sbin/cpu
(gdb) run

Starting program: /local/sbin/cpu useradd newuser

Program received signal SIGSEGV, Segmentation fault.
0xfee34164 in populateGlobals () at commandline.c:763
763 globalLdap->dn = buildDn ((operation > 2) ?
GROUPADD : USERADD,

I thought the latest CVS might fix it, but it doesn't.
The same problem occurs.

Discussion

  • Blake Matheny

    Blake Matheny - 2004-01-14

    Logged In: YES
    user_id=449107

    Unfortunately I do not have access to a Solaris 9 machine
    and the sourceforge compile farm is always down. Is there a
    possibility that I could get an account on a Solaris 9
    machine for a few days? If so, contact me at
    bmatheny@purdue.edu. Someone did the same with FreeBSD and I
    managed to get it working in a day.

     
  • Edwin Lim

    Edwin Lim - 2004-01-31

    Logged In: YES
    user_id=30924

    Seems like I have the same problem under Irix 6.5.19m. gcc 3.3.

    Running it in gdb seems to show that when
    plugins/ldap/ldap.c:CPU_init() calls parseCommand(), it
    really wants plugins/ldap/commandline.c:parseCommand() in
    libcpu_ldap.so. Instead, it got main/cpu.c:parseCommand(),
    so the globalLdap->dn does not exist.

    Cheers,
    e.

     
  • Edwin Lim

    Edwin Lim - 2004-01-31

    Logged In: YES
    user_id=30924

    OK. Here's what I did to make it work for me:

    Edit configure file, I looked for the $archive_cmds
    definition for Irix,
    I then insert ${wl}-Bsymbolic before ${wl}-set_version.
    This is for using gcc to link, which I presume it will pass
    -Bsymbolic to the native Irix ld.

    Anyway, it seems like different OSes behave differently when
    searching for symbols from shared libraries using the
    "default" linker option.

    Irix: Symbols referenced from shared library is searched
    for in the main executable first, then the shared library.
    Solaris: Looks like Irix style.
    hpux: Won't even search in main executable unless explicitly
    told to do so.
    AIX: Looks into shared library first.
    Linux: Dunno, the debian cpu .deb package seem to work.

    Another option is to rename the function names.

    Just my $5.01 (not even worth $5.02).

    Cheers,
    e.

     
  • Edwin Lim

    Edwin Lim - 2004-01-31

    Logged In: YES
    user_id=30924

    Hey! sf.net changed my ONE CENT into FIVE DOLLARS AND ONE CENT?
    Let's try again: ONE CENT $5.01

    8^D

    Cheers,
    e.

     

Log in to post a comment.

MongoDB Logo MongoDB