#6 sid-filter v0.2.3 binary dies on Solaris9 arch Sparc

v0.2.3
closed-fixed
5
2004-12-08
2004-12-02
No

I saw a older mail-discussion in the sid-milter
mail-archives about a problem on sid-filter v0.2.2 and
Solaris 9, Sparc. This seems to be a related
problem...on first milter "connection" from sendmail to
sid-filter, sid-filter process dies...

There was no big problems during the compile with gcc
2.95.3 (just minor error in the Makefile
./obj.SunOS.5.9.sun4/libmarid/Makefile)

1. Line 137 and 138 fails to be written right:
137: libmaridSRCS= ...blabla... sm-marid-dir-.c
...blabla... ${SRCADD}
138: libmaridOBJS= ...blabla... sm-marid-dir-.o
...blabla... ${OBJADD} ${libmaridOBJADD}

The failing entry of the two lines are:
sm-marid-dir-.c ---> sm-marid-dir-include.c
sm-marid-dir-.o ---> sm-marid-dir-include.o

2. And Vanilla Solaris do not include paths.h, but i
got it from the bind source...

However, this is the truss i get the sid-filter process
dies...
I'm not a programer, but is there any more information
i give to help solving this problem?

Daemon started like this:
/usr/bin/sid-filter -p inet:4444@localhost -f -l -t

Syslog output:
Dec 2 10:10:28 test1 sendmail[17453]: [ID 801593
mail.error] iB29AGsN017453: milter_read(sid-filter):
cmd read returned 0, expecting 5
Dec 2 10:10:28 test1 sendmail[17453]: [ID 801593
mail.info] iB29AGsN017453: Milter (sid-filter): to
error state
Dec 2 10:10:28 test1 sendmail[17453]: [ID 801593
mail.info] iB29AGsN017453: Milter: data, reject=451
4.3.2 Please try again later

Truss output:
/4: read(8, " E { m s g _ i d }\0 < 2".., 60)
= 60
/4: poll(0xFECFBBF8, 1, 7210000) = 1
/4: read(8, "\0\0\001 E", 5) = 5
/4: poll(0xFECF5F40, 1, 0) = 1
/4: write(6, "\0\0\0\0", 4) = 4
/2: poll(0xFEEFBC80, 2, -1) = 1
/2: read(5, "\0\0\0\0", 4) = 4
/2: poll(0xFEEFBC80, 2, -1) = 1
/2: stat("/etc/resolv.conf", 0xFEEFBAE0) = 0
/2: sendto(4, "84F201\0\001\0\0\0\0\0\0".., 31, 0,
0x00039F30, 16) = 31
/2: poll(0xFEEFBC80, 2, -1) = 1
/2: recvfrom(4, "84F28180\001\0\0\001\0\0".., 8204,
0, 0x00000000, 0x00000000) = 92
/2: lwp_unpark(4, 1) = 0
/4: lwp_park(0xFECF5F98, 0) = 0
/4: Incurred fault #5, FLTACCESS %pc = 0x000151EC
/4: siginfo: SIGBUS BUS_ADRALN addr=0x0008C946
/4: Received signal #10, SIGBUS [default]
/4: siginfo: SIGBUS BUS_ADRALN addr=0x0008C946

Re,
/P

Discussion

1 2 > >> (Page 1 of 2)
  • Anonymous

    Anonymous - 2004-12-02
    • labels: --> Functionality
    • assigned_to: nobody --> sm-msk
     
  • Anonymous

    Anonymous - 2004-12-02

    Logged In: YES
    user_id=1048957

    Does a core get produced? A stack trace would be really
    helpful.

    I'll try to reproduce it in the interim.

     
  • Fredrik Pettai

    Fredrik Pettai - 2004-12-02

    Logged In: YES
    user_id=370342

    Yes, here is a core-file, bzip2:ed...

    Re,
    /P

     
  • Fredrik Pettai

    Fredrik Pettai - 2004-12-02

    Logged In: YES
    user_id=370342

    And another one, just in case...

    Re,
    /P

     
  • Anonymous

    Anonymous - 2004-12-02

    Logged In: YES
    user_id=1048957

    I'll need your binary too, and a diff to the distribution of
    any source changes you made.

     
  • Anonymous

    Anonymous - 2004-12-02

    Logged In: YES
    user_id=1048957

    The cores were apparently from binaries not built with -g
    and/or not built with a compiler I have.

    How was it built?

     
  • Fredrik Pettai

    Fredrik Pettai - 2004-12-02

    Logged In: YES
    user_id=370342

    Okidoki,

    Heres the binary + library... the diffs will take some time
    to compile since i deleted the source/build... But i will
    upload them asap.

    Re,
    /P

     
  • Fredrik Pettai

    Fredrik Pettai - 2004-12-02

    Logged In: YES
    user_id=370342

    > The cores were apparently from binaries not built with -g
    > and/or not built with a compiler I have.

    Sorry, thats right... i will do it from the begining and
    send it again.
    I suppose the binaries aren't that useful then?

    Re,
    /P

     
  • Anonymous

    Anonymous - 2004-12-02

    Logged In: YES
    user_id=1048957

    I don't have dbx installed on our sun9 box it seems, so gcc
    -g would be really helpful.

    No harm, leave the binary and cores there. I'll see if I
    can make some sense out of them while I wait for your new data.

     
  • Anonymous

    Anonymous - 2004-12-02
    • milestone: --> v0.2.3
     
  • Anonymous

    Anonymous - 2004-12-02

    Logged In: YES
    user_id=1048957

    By strings-ing the core and running my debug code, it looks
    like the TXT record for vattenfall.se causes the failure.
    We're debugging it now.

     
  • Anonymous

    Anonymous - 2004-12-02

    Logged In: YES
    user_id=1048957

    This appears to be an alignment problem. A patch is attached.

     
  • Fredrik Pettai

    Fredrik Pettai - 2004-12-02

    Logged In: YES
    user_id=370342

    How I do it:

    Uncompress the source...
    copy the ./devtools/Site/site.config.m4 & site.SunOS.m4 from my sendmail-8.
    13.1 build to ./devtools/Site/ directory.
    # ./sh Build

    Get error the error almost at the begining:

    gcc -M -I. -I../../include -I/opt/csw/bdb4/include -I/opt/csw/include -
    DSOLARIS=20900 -DSM_CONF_LDAP_MEMFREE sm-marid-address.c sm-
    marid-arena.c sm-marid.c sm-marid-dir-a.c sm-marid-dir-all.c sm-marid-dir-
    exists.c sm-marid-dir-.c sm-marid-dir-ip.c sm-marid-dir-ptr.c sm-marid-dns.c
    sm-marid-domain.c sm-marid-evaluate.c sm-marid-fqdn.c sm-marid-ip.c sm-
    marid-mod.c sm-marid-mod-exp.c sm-marid-mod-redirect.c sm-marid-record.c
    sm-marid-scan.c sm-marid-util.c sm-marid-log.c sm-marid-frame.c >>
    Makefile
    sparc-sun-solaris2.8-gcc: sm-marid-dir-.c: No such file or directory
    *** Error code 1
    make: Fatal error: Command failed for target `depend'
    Current working directory /sun/sendmail/sid-milter-0.2.3/obj.SunOS.5.9.sun4/
    libmarid
    Making in /sun/sendmail/sid-milter-0.2.3/obj.SunOS.5.9.sun4/libmarid
    make: Warning: Too many rules defined for target sysexits.h
    Current working directory /sun/sendmail/sid-milter-0.2.3/obj.SunOS.5.9.sun4/
    libmarid
    gcc -O -I. -I../../include -I/opt/csw/bdb4/include -I/opt/csw/include -
    DSOLARIS=20900 -DSM_CONF_LDAP_MEMFREE -c sm-marid-address.c
    gcc -O -I. -I../../include -I/opt/csw/bdb4/include -I/opt/csw/include -
    DSOLARIS=20900 -DSM_CONF_LDAP_MEMFREE -c sm-marid-arena.c
    gcc -O -I. -I../../include -I/opt/csw/bdb4/include -I/opt/csw/include -
    DSOLARIS=20900 -DSM_CONF_LDAP_MEMFREE -c sm-marid.c
    gcc -O -I. -I../../include -I/opt/csw/bdb4/include -I/opt/csw/include -
    DSOLARIS=20900 -DSM_CONF_LDAP_MEMFREE -c sm-marid-dir-a.c
    gcc -O -I. -I../../include -I/opt/csw/bdb4/include -I/opt/csw/include -
    DSOLARIS=20900 -DSM_CONF_LDAP_MEMFREE -c sm-marid-dir-all.c
    gcc -O -I. -I../../include -I/opt/csw/bdb4/include -I/opt/csw/include -
    DSOLARIS=20900 -DSM_CONF_LDAP_MEMFREE -c sm-marid-dir-exists.
    c
    make: Fatal error: Don't know how to make target `sm-marid-dir-.o'
    Current working directory /sun/sendmail/sid-milter-0.2.3/obj.SunOS.5.9.sun4/
    libmarid
    *** Error code 1
    make: Fatal error: Command failed for target `all'

    Then i make the change in (hope this gets posted well):

    # diff ./obj.SunOS.5.9.sun4/libmarid/Makefile ./obj.SunOS.5.9.sun4/libmarid/
    Makefile.orig
    137,138c137,138
    < libmaridSRCS= sm-marid-address.c sm-marid-arena.c sm-marid.c sm-
    marid-dir-a.c sm-marid-dir-all.c sm-marid-dir-exists.c sm-marid-dir-include.c
    sm-marid-dir-ip.c sm-marid-dir-ptr.c sm-marid-dns.c sm-marid-domain.c sm-
    marid-evaluate.c sm-marid-fqdn.c sm-marid-ip.c sm-marid-mod.c sm-marid-
    mod-exp.c sm-marid-mod-redirect.c sm-marid-record.c sm-marid-scan.c sm-
    marid-util.c sm-marid-log.c sm-marid-frame.c ${SRCADD}
    < libmaridOBJS= sm-marid-address.o sm-marid-arena.o sm-marid.o sm-
    marid-dir-a.o sm-marid-dir-all.o sm-marid-dir-exists.o sm-marid-dir-include.o
    sm-marid-dir-ip.o sm-marid-dir-ptr.o sm-marid-dns.o sm-marid-domain.o sm-
    marid-evaluate.o sm-marid-fqdn.o sm-marid-ip.o sm-marid-mod.o sm-marid-
    mod-exp.o sm-marid-mod-redirect.o sm-marid-record.o sm-marid-scan.o sm-
    marid-util.o sm-marid-log.o sm-marid-frame.o ${OBJADD}
    ${libmaridOBJADD}
    ---
    > libmaridSRCS= sm-marid-address.c sm-marid-arena.c sm-marid.c sm-
    marid-dir-a.c sm-marid-dir-all.c sm-marid-dir-exists.c sm-marid-dir-.c sm-
    marid-dir-ip.c sm-marid-dir-ptr.c sm-marid-dns.c sm-marid-domain.c sm-
    marid-evaluate.c sm-marid-fqdn.c sm-marid-ip.c sm-marid-mod.c sm-marid-
    mod-exp.c sm-marid-mod-redirect.c sm-marid-record.c sm-marid-scan.c sm-
    marid-util.c sm-marid-log.c sm-marid-frame.c ${SRCADD}
    > libmaridOBJS= sm-marid-address.o sm-marid-arena.o sm-marid.o sm-
    marid-dir-a.o sm-marid-dir-all.o sm-marid-dir-exists.o sm-marid-dir-.o sm-
    marid-dir-ip.o sm-marid-dir-ptr.o sm-marid-dns.o sm-marid-domain.o sm-
    marid-evaluate.o sm-marid-fqdn.o sm-marid-ip.o sm-marid-mod.o sm-marid-
    mod-exp.o sm-marid-mod-redirect.o sm-marid-record.o sm-marid-scan.o sm-
    marid-util.o sm-marid-log.o sm-marid-frame.o ${OBJADD}
    ${libmaridOBJADD}

    After that change the ./sh Build runs to this point:

    gcc -O -I. -I../../libar -I../../libmarid -I../../sendmail -I../../include -I/opt/csw/bdb4/
    include -I/opt/csw/include -DSOLARIS=20900 -
    DSM_CONF_LDAP_MEMFREE -DUSE_ARLIB -D_REENTRANT -DXP_MT -
    c sid-filter.c
    sid-filter.c:41: paths.h: No such file or directory
    *** Error code 1
    make: Fatal error: Command failed for target `sid-filter.o'
    Current working directory /sun/sendmail/sid-milter-0.2.3/obj.SunOS.5.9.sun4/
    sid-filter
    *** Error code 1
    make: Fatal error: Command failed for target `all'

    Then i just copy paths.h from the bind-source:

    # cp ../bind-9.2.4/lib/bind/port/solaris/include/paths.h ./include/

    And the i finishes...

    # make
    # make install

    Thats it...

    btw.
    Compileing using the -g flag, how should i add it in the best way?
    Nor:
    CCFLAGS=-g; export CCFLAGS
    or
    ./sh Build -g
    seems to be a good way to go?

    I'm a little lost about debugging, sorry...

    Re,
    /P

     
  • Fredrik Pettai

    Fredrik Pettai - 2004-12-02

    Logged In: YES
    user_id=370342

    How I do it:

    Uncompress the source...
    copy the ./devtools/Site/site.config.m4 & site.SunOS.m4 from my sendmail-8.
    13.1 build to ./devtools/Site/ directory.
    # ./sh Build

    Get error the error almost at the begining:

    gcc -M -I. -I../../include -I/opt/csw/bdb4/include -I/opt/csw/include -
    DSOLARIS=20900 -DSM_CONF_LDAP_MEMFREE sm-marid-address.c sm-
    marid-arena.c sm-marid.c sm-marid-dir-a.c sm-marid-dir-all.c sm-marid-dir-
    exists.c sm-marid-dir-.c sm-marid-dir-ip.c sm-marid-dir-ptr.c sm-marid-dns.c
    sm-marid-domain.c sm-marid-evaluate.c sm-marid-fqdn.c sm-marid-ip.c sm-
    marid-mod.c sm-marid-mod-exp.c sm-marid-mod-redirect.c sm-marid-record.c
    sm-marid-scan.c sm-marid-util.c sm-marid-log.c sm-marid-frame.c >>
    Makefile
    sparc-sun-solaris2.8-gcc: sm-marid-dir-.c: No such file or directory
    *** Error code 1
    make: Fatal error: Command failed for target `depend'
    Current working directory /sun/sendmail/sid-milter-0.2.3/obj.SunOS.5.9.sun4/
    libmarid
    Making in /sun/sendmail/sid-milter-0.2.3/obj.SunOS.5.9.sun4/libmarid
    make: Warning: Too many rules defined for target sysexits.h
    Current working directory /sun/sendmail/sid-milter-0.2.3/obj.SunOS.5.9.sun4/
    libmarid
    gcc -O -I. -I../../include -I/opt/csw/bdb4/include -I/opt/csw/include -
    DSOLARIS=20900 -DSM_CONF_LDAP_MEMFREE -c sm-marid-address.c
    gcc -O -I. -I../../include -I/opt/csw/bdb4/include -I/opt/csw/include -
    DSOLARIS=20900 -DSM_CONF_LDAP_MEMFREE -c sm-marid-arena.c
    gcc -O -I. -I../../include -I/opt/csw/bdb4/include -I/opt/csw/include -
    DSOLARIS=20900 -DSM_CONF_LDAP_MEMFREE -c sm-marid.c
    gcc -O -I. -I../../include -I/opt/csw/bdb4/include -I/opt/csw/include -
    DSOLARIS=20900 -DSM_CONF_LDAP_MEMFREE -c sm-marid-dir-a.c
    gcc -O -I. -I../../include -I/opt/csw/bdb4/include -I/opt/csw/include -
    DSOLARIS=20900 -DSM_CONF_LDAP_MEMFREE -c sm-marid-dir-all.c
    gcc -O -I. -I../../include -I/opt/csw/bdb4/include -I/opt/csw/include -
    DSOLARIS=20900 -DSM_CONF_LDAP_MEMFREE -c sm-marid-dir-exists.
    c
    make: Fatal error: Don't know how to make target `sm-marid-dir-.o'
    Current working directory /sun/sendmail/sid-milter-0.2.3/obj.SunOS.5.9.sun4/
    libmarid
    *** Error code 1
    make: Fatal error: Command failed for target `all'

    Then i make the change in (hope this gets posted well):

    # diff ./obj.SunOS.5.9.sun4/libmarid/Makefile ./obj.SunOS.5.9.sun4/libmarid/
    Makefile.orig
    137,138c137,138
    < libmaridSRCS= sm-marid-address.c sm-marid-arena.c sm-marid.c sm-
    marid-dir-a.c sm-marid-dir-all.c sm-marid-dir-exists.c sm-marid-dir-include.c
    sm-marid-dir-ip.c sm-marid-dir-ptr.c sm-marid-dns.c sm-marid-domain.c sm-
    marid-evaluate.c sm-marid-fqdn.c sm-marid-ip.c sm-marid-mod.c sm-marid-
    mod-exp.c sm-marid-mod-redirect.c sm-marid-record.c sm-marid-scan.c sm-
    marid-util.c sm-marid-log.c sm-marid-frame.c ${SRCADD}
    < libmaridOBJS= sm-marid-address.o sm-marid-arena.o sm-marid.o sm-
    marid-dir-a.o sm-marid-dir-all.o sm-marid-dir-exists.o sm-marid-dir-include.o
    sm-marid-dir-ip.o sm-marid-dir-ptr.o sm-marid-dns.o sm-marid-domain.o sm-
    marid-evaluate.o sm-marid-fqdn.o sm-marid-ip.o sm-marid-mod.o sm-marid-
    mod-exp.o sm-marid-mod-redirect.o sm-marid-record.o sm-marid-scan.o sm-
    marid-util.o sm-marid-log.o sm-marid-frame.o ${OBJADD}
    ${libmaridOBJADD}
    ---
    > libmaridSRCS= sm-marid-address.c sm-marid-arena.c sm-marid.c sm-
    marid-dir-a.c sm-marid-dir-all.c sm-marid-dir-exists.c sm-marid-dir-.c sm-
    marid-dir-ip.c sm-marid-dir-ptr.c sm-marid-dns.c sm-marid-domain.c sm-
    marid-evaluate.c sm-marid-fqdn.c sm-marid-ip.c sm-marid-mod.c sm-marid-
    mod-exp.c sm-marid-mod-redirect.c sm-marid-record.c sm-marid-scan.c sm-
    marid-util.c sm-marid-log.c sm-marid-frame.c ${SRCADD}
    > libmaridOBJS= sm-marid-address.o sm-marid-arena.o sm-marid.o sm-
    marid-dir-a.o sm-marid-dir-all.o sm-marid-dir-exists.o sm-marid-dir-.o sm-
    marid-dir-ip.o sm-marid-dir-ptr.o sm-marid-dns.o sm-marid-domain.o sm-
    marid-evaluate.o sm-marid-fqdn.o sm-marid-ip.o sm-marid-mod.o sm-marid-
    mod-exp.o sm-marid-mod-redirect.o sm-marid-record.o sm-marid-scan.o sm-
    marid-util.o sm-marid-log.o sm-marid-frame.o ${OBJADD}
    ${libmaridOBJADD}

    After that change the ./sh Build runs to this point:

    gcc -O -I. -I../../libar -I../../libmarid -I../../sendmail -I../../include -I/opt/csw/bdb4/
    include -I/opt/csw/include -DSOLARIS=20900 -
    DSM_CONF_LDAP_MEMFREE -DUSE_ARLIB -D_REENTRANT -DXP_MT -
    c sid-filter.c
    sid-filter.c:41: paths.h: No such file or directory
    *** Error code 1
    make: Fatal error: Command failed for target `sid-filter.o'
    Current working directory /sun/sendmail/sid-milter-0.2.3/obj.SunOS.5.9.sun4/
    sid-filter
    *** Error code 1
    make: Fatal error: Command failed for target `all'

    Then i just copy paths.h from the bind-source:

    # cp ../bind-9.2.4/lib/bind/port/solaris/include/paths.h ./include/

    And the i finishes...

    # make
    # make install

    Thats it...

    btw.
    Compileing using the -g flag, how should i add it in the best way?
    Nor:
    CCFLAGS=-g; export CCFLAGS
    or
    ./sh Build -g
    seems to be a good way to go?

    I'm a little lost about debugging, sorry...

    Re,
    /P

     
  • Fredrik Pettai

    Fredrik Pettai - 2004-12-02

    Logged In: YES
    user_id=370342

    Okay, that didn't go very well...
    I posted the diff as a file instead.

    Re,
    /P

     
  • Fredrik Pettai

    Fredrik Pettai - 2004-12-02

    diff of ./obj.SunOS.5.9.sun4/libmarid/Makefile

     
  • Anonymous

    Anonymous - 2004-12-02

    Logged In: YES
    user_id=1048957

    I can't reproduce the build problem, but the paths.h problem
    has been fixed for the next release. Copying it from
    another package is fine for now; all I need is _PATH_DEVNULL
    which is now defined manually for Solaris builds. Since you
    have a solution already I won't bother with a patch for that.

    Your Makefile.m4, or perhaps the Makefile it produces,
    appears to have snuck a newline in a bad place.

     
  • Fredrik Pettai

    Fredrik Pettai - 2004-12-05

    Logged In: YES
    user_id=370342

    > Your Makefile.m4, or perhaps the Makefile it produces,
    > appears to have snuck a newline in a bad place.

    Yes, the Makefile.m4 looks correct, so perhaps its sun implemenation of m4
    that make this error? I can try the GNU version...

    The -g binary is complete, so i'll just have to run it and make it fail so i get new
    core-files... (I didn't find a good way of append the -g option the building, so i
    just edited the old Makefile generated by Makefile.m4).

     
  • Fredrik Pettai

    Fredrik Pettai - 2004-12-06

    Logged In: YES
    user_id=370342

    So... here is some new core-files, and a binary compiled
    with -g.
    Hope this will help!

    Re,
    /P

     
  • Fredrik Pettai

    Fredrik Pettai - 2004-12-06

    new binary (compiled with -g)

     
  • Fredrik Pettai

    Fredrik Pettai - 2004-12-06

    new corefiles (by the new binary)

     
  • Anonymous

    Anonymous - 2004-12-07

    Logged In: YES
    user_id=1048957

    The patch is attached.

    The new cores both point to a line of code that can't
    possibly cause a segfault (comparisons of local variabls to
    constants or each other). There must be stack or bus
    problems causing it.

    Let me know how the patch goes. I'm about to release 0.2.4.
    This patch is present in that code, and the case we were
    able to reproduce before no longer fails after that patch is
    applied.

     
  • Anonymous

    Anonymous - 2004-12-08

    Logged In: YES
    user_id=1048957

    Try again to attach the patch.

     
  • Anonymous

    Anonymous - 2004-12-08

    Proposed patch

     
1 2 > >> (Page 1 of 2)

Log in to post a comment.