Menu

#155 NetBSD pthreads incompatible with nsd

closed-wont-fix
4
2004-09-13
2003-06-12
No

The native implementation of pthreads on NetBSD is
incompatible with AOLserver nsthreads library wrapper.
The pthread_key_create() on NetBSD pthreads
implementation assumes valid tls keys to start
with 0, while nsthreads wrapper assumes valid tls keys
to start with 1. This breaks the nsd process startup and
the server cores with error message:

Ns_Tls: invalid key: 0: should be between 1 and 100

Workaround, for the time being is s to use the
portable pthread library:
http://www.media.osaka-cu.ac.jp/~k-abe/PTL/

Thanks to Kulcsár Ferenc <crusader@netbsd.hu>
for reporting this and providing access to NetBSD
machine for debugging.

Discussion

  • Dossy Shiobara

    Dossy Shiobara - 2004-07-01

    Logged In: YES
    user_id=21885

    Has this been fixed in NetBSD's pthreads implementation yet?

    This actually sounds like a bug somewhere else in AOLserver
    that's only showing up under certain circumstances.
    The "key" should start from 1 which shouldn't have anything
    to do with pthread_key_create() but rather Ns_TlsAlloc().

    When the "Ns_Tls: invalid key: 0: ..." error happens, that
    means Ns_TlsSet() or Ns_TlsGet() was handed a keyPtr
    containing 0 instead of 1 .. NS_THREAD_MAXTLS.

     
  • Zoran Vasiljevic

    Logged In: YES
    user_id=95086

    I have no idea. I can ping the guy who reported it.
    BTW, I was debugging the problem then and it was
    really the difference in pthread_key_create() stuff
    that exposed the problem.
    Keep this open until we get some response from Ferenc.
    I do not have NetBSD system here so it is difficult for me
    to repproduce or investigate the issue.

     
  • Ian A. Harding

    Ian A. Harding - 2004-09-02

    Logged In: YES
    user_id=734837

    I have been successfully using AOLServer 4.0.7 on
    NetBSD2.0_BETA for a while. NetBSD 2 is the first version
    to include "native" threads, based on the mit-pthread
    package. In previous versions, you had to "choose" your
    thread library. I had chosen PTL so I can't swear this
    isn't a problem with mit-pthread under NetBSD 1.6.2, but I
    doubt it.

    I had the same error message under NetBSD2.0_BETA when the
    hostname could not be resolved, but that was a few patch
    versions ago. It seems to be fixed now. Now I get

    Starting nsd.
    [02/Sep/2004:06:39:33][6604.3214934016][-main-] Error: dns:
    gethostbyname failed: temporary error - try again
    [02/Sep/2004:06:39:33][6604.3214934016][-main-] Fatal: could
    not resolve workstation.tpchd.org via dns

    in that case, but usually, my name resolves.

    I have build a pkgsrc package for NetBSD 2.0 which is
    available at pkgsrc-wip.sf.net. Once 2.0 is released, I
    would like to see this package become part of the main
    pkgsrc tree.
    -----------------
    bash-2.05b# uname -a
    NetBSD workstation.tpchd.org 2.0_BETA NetBSD 2.0_BETA
    (iharding) #0: Thu May 13 14:25:35 UTC 2004
    iharding@:/usr/src/sys/arch/i386/compile/iharding
    i386bash-2.05b# /usr/pkg/etc/rc.d/nsd start
    Starting nsd.
    bash-2.05b# [02/Sep/2004:06:47:25][2353.3214934016][-main-]
    Warning: config.tcl: nsssl not loaded -- key/cert files do
    not exist.
    [02/Sep/2004:06:47:25][2353.3214934016][-main-] Notice:
    encoding: loaded: iso8859-1
    bash-2.05b# ps -aux | grep nsd
    nsadmin 2353 0.4 0.5 3132 2816 ?? Ssa 6:47AM 0:00.07
    /usr/pkg/bin/nsd -t /usr/pk
    root 7315 0.0 0.1 88 432 p2 R+ 6:47AM 0:00.00 grep nsd
    bash-2.05b# pkg_info | grep aol
    aolserver-4.0.7 America Online's open source web server

     
  • Dossy Shiobara

    Dossy Shiobara - 2004-09-13
    • status: open --> closed-wont-fix
     
  • Dossy Shiobara

    Dossy Shiobara - 2004-09-13

    Logged In: YES
    user_id=21885

    I'm closing this ticket with resolution "Won't Fix" as it
    appears to me that this is an issue with NetBSD's support
    for POSIX threads, not with AOLserver code itself.

    Ian has verified that AOLserver 4.0.7 works as designed on
    NetBSD 2.0 using mit-pthread, as well as NetBSD 1.6.2 using PTL.

    Thanks.

     

Log in to post a comment.

MongoDB Logo MongoDB