#26 sid-milter broken on NetBSD (4.0)

v0.2.14
closed-fixed
5
2008-06-07
2008-05-22
No

I compiles fine, but then I run sid-filter, It crashes with this error:

netbsd# ktruss sid-filter -d nordu.net -D -h -l -p inet:9999@localhost -r 5 -T 30 -u smmsp -f

---8<--- Cut lots of output ---8<---

4499 1 sid-filter open("/etc/resolv.conf", 0, 0x1b6) = 5
4499 1 sid-filter __fstat30(0x5, 0xbfbee3b8) = 0
4499 1 sid-filter read(0x5, 0x8064000, 0x2000) = 92
"nameserver 193.10.xxx.xx\nnameserver 193.10.xxx.xx\n"
4499 1 sid-filter read(0x5, 0x8064000, 0x2000) = 0
""
4499 1 sid-filter close(0x5) = 0
4499 1 sid-filter write(0x2, 0xbbbe64c0, 0x33) = 51
"_res is not supported for multi-threaded programs.\n"
4499 1 sid-filter __sigprocmask14(0x3, 0xbbbe8be0, 0) = 0
4499 1 sid-filter getpid() = 4499, 9968
4499 1 sid-filter kill(0x1193, 0x6) = 0
4499 1 sid-filter SIGABRT SIG_DFL

Discussion

  • Fredrik Pettai

    Fredrik Pettai - 2008-05-22

    Logged In: YES
    user_id=370342
    Originator: YES

    Now looking in ./sid-milter-0.2.14/libar/Makefile.m4, I see this:

    dnl If your operating system vendor changed the public-but-not-really
    dnl "_res" structure to something different than the de facto standard,
    dnl enable the next line. OpenBSD 3.7 and NetBSD 3.0 needs this, and there
    dnl may be others.
    dnl APPENDDEF(`confENVDEF', `-DNONSTANDARD_RES_STRUCTURE')

    However, this option doesn't do anything better or worse, enabled or disabled.

     
  • Anonymous - 2008-05-22
    • labels: --> 645296
    • assigned_to: nobody --> sm-msk
    • milestone: --> 624035
     
  • Anonymous - 2008-05-22

    Logged In: YES
    user_id=1048957
    Originator: NO

    Annoying.

    v1.0.0 of sid-milter, which I hope to have out soon, has a reworked libar which handles this properly.

    If you're eager to get it working, get the libar from the latest dkim-milter package and define AR_RES_MANUAL during the build of libar. This is a reworking of what you cited below to work around limitations of _res in a more complete way than the version that shipped with 0.2.14.

     
  • Fredrik Pettai

    Fredrik Pettai - 2008-05-22
    • assigned_to: sm-msk --> nobody
    • labels: 645296 -->
    • milestone: 624035 -->
     
  • Fredrik Pettai

    Fredrik Pettai - 2008-05-22

    Logged In: YES
    user_id=370342
    Originator: YES

    I got some digging help from the NetBSD source-code:

    The error message is coming from ${NETBSDSRCDIR}/lib/libpthread/res_state.c.

    "Then reading the code, this happens then something is referencing to the global symbol _res, which earlier was there as a defined interface for tweaking the resolver behavior. This was unfortunate, because this made it "harder" to keep the ABI then you want to extend the interface."

    Further tracks is found and cut:ed from /usr/include/resolv.h:

    /*
    * Source and Binary compatibility; _res will not work properly
    * with multi-threaded programs.
    */
    extern struct __res_state *__res_state(void);
    #define _res (*__res_state())

    HTH

     
  • Fredrik Pettai

    Fredrik Pettai - 2008-05-22

    Logged In: YES
    user_id=370342
    Originator: YES

    Thx,
    Ok, I'll try that and see if I get it up and running...

     
  • Fredrik Pettai

    Fredrik Pettai - 2008-05-26

    Logged In: YES
    user_id=370342
    Originator: YES

    Yes, It works fine. It has been running over the weekend now...

    One question though:

    libar in dkim-milter (pkgsrc/wip NetBSD) does not seem to use build option AR_RES_MANUAL:

    build output ...

    Making all in:
    /usr/pkgsrc/wip/dkim-milter/work/dkim-milter-2.5.4/libar
    Configuration: pfx=, os=NetBSD, rel=4.0_BETA2, rbase=4, rroot=4.0_BETA2, arch=i386, sfx=, variant=optimized
    Using M4=/usr/pkg/bin/gm4
    Creating /usr/pkgsrc/wip/dkim-milter/work/dkim-milter-2.5.4/obj.NetBSD.4.0_BETA2.i386/libar using /usr/pkgsrc/wip/dkim-milter/work/dkim-milter-2.5.4/devtools/OS/NetBSD
    Including /usr/pkgsrc/wip/dkim-milter/work/dkim-milter-2.5.4/devtools/Site/site.config.m4
    Making dependencies in /usr/pkgsrc/wip/dkim-milter/work/dkim-milter-2.5.4/obj.NetBSD.4.0_BETA2.i386/libar
    cp /dev/null sm_os.h
    cc -M -I. -I../../include -I/usr/include -I/usr/include -DNETISO ar.c manual.c >> Makefile
    Making in /usr/pkgsrc/wip/dkim-milter/work/dkim-milter-2.5.4/obj.NetBSD.4.0_BETA2.i386/libar
    cc -O -I. -I../../include -I/usr/include -I/usr/include -DNETISO -DXP_MT -I/usr/include -I/usr/pkg/include -c ar.c
    cc -O -I. -I../../include -I/usr/include -I/usr/include -DNETISO -DXP_MT -I/usr/include -I/usr/pkg/include -c manual.c
    ar crv libar.a ar.o manual.o
    a - ar.o
    a - manual.o
    ranlib libar.a
    groff -Tascii -man ar.3 > ar.0 || cp ar.0.dist ar.0

    So I just tried to use it as "vanilla" under sid-milter as well, and that worked fine.

     
  • Anonymous - 2008-05-27
    • assigned_to: nobody --> sm-msk
    • labels: --> Functionality
    • milestone: --> v0.2.14
     
  • Anonymous - 2008-05-27

    Logged In: YES
    user_id=1048957
    Originator: NO

    I suppose there's some operation on _res which triggers the crash on NetBSD 4.0 which the old libar did but the new libar doesn't do, so AR_RES_MANUAL isn't required there.

    I think it's safer to define it in any case.

    I'll leave this bug open until 1.0.0 is formally released. Betas begin today.

     
  • Anonymous - 2008-06-07

    Logged In: YES
    user_id=1048957
    Originator: NO

    v1.0.0 released, containing a new libar which avoids this issue.

     
  • Anonymous - 2008-06-07
    • status: open --> closed-fixed
     

Log in to post a comment.