Forum OpenACS Development: ANNOUNCE: NaviServer 4.99.14 available

I am pleased to announce the availability of NaviServer 4.99.14 (see [1] and [2]). NaviServer 4.99.14 was tested with OpenACS 5.9.0 and the newest version on the oacs-5-9 branch. See below for the changes between NaviServer 4.99.13 and 4.99.14.

all the best
-gustaf neumann

NaviServer 4.99.14, released 2016-11-18

 86 files changed, 2655 insertions(+), 1451 deletions(-)

New Features:

  * Added statistics for "trace times": i.e. the time spent in a
    connection thread after the main request was executed, for running
    post filters, server traces (e.g. writing access.log) and
    cleanups.  The statistic results are included in [ns_server

  * Improved compatibility with FreeBSD and OminOS (Solaris).
  * Added module "revproxy" for implementing a reverse proxy based
    on ns_connchan (working as well for proxying WebSockets).

Performance Improvements:

  * Added new config flag "concurrentinterpcreate" to "ns/parameters"
    to allow optionally concurrent creations of Tcl interpreters.
    Concurrent creations of Tcl interpreters were a problem with Tcl
    8.5, but seems to work with Tcl 8.6. Per default, this feature is
    turned off.
  * Don't update interp in "ns_ictl cleanup", when no defer callbacks
    were executed.

Bug Fixes:

  * ns_connchan improvements:
    - Handle potential race condition between ns_connchan and socket
      callbacks during shutdown
    - Make sure, channel is writable before we are writing to it
    - Add support for partial write operations ("ns_connchan write"
      and "ns_connchan open")
    - Provide more detailed error messages
    - Allow callback changes without invoking socket-shutdown

  * Make sure, the tests are running with expected locale and
    encoding (fixed a problem on FreeBSD)
  * Fix bug #77 (potential crash during ns_mktemp, strdup()
    vs. ns_strdup(), introduced in 4.99.13, reported by
    Patrick Heissenberger)

  * Collect statistics before traces are run (i.e. before
    access.log is written); this fixes a bug reported by
    David Osborne.
  * In HTTP client requests, don't start urls with "//" under certain
  * Keep internally convention, that stored request lines do not end
    with crlf to avoid unneeded tests
  * Don't "roll away" log file from stderr, when nsd was started with
    "-c" or "-f" flags
  * Don't complain about uncorking, when user has already closed the

  * Make windows variant of ns_mkstemp() more compatible with unix/mac
    (remove _O_TEMPORARY flag)
  * Use datatype "int" for parameters passed with Ns_ObjvBool (rather
    than bool, which causes invalid values on gcc 4.8.4 (Ubuntu

  * Fix several bugs in keylist

Documentation improvements:

  * doc/src/naviserver/
    - Added documentation for "ns_connchan open"
    - Clarified format in which timeouts can be specified
    - document new flags

  * doc/src/manual/
   - Added documentation of "ns/parameter" option "concurrentinterpcreate"
  * doc/src/manual/
   - Added section with sample configuration for systemd

  * doc/src/naviserver/
    - Improved function, explain deprecation state of c-library function,

  * General overhaul of the contrib/example scripts
    contrib/examples/index.adp, contrib/examples/upload.tcl,

  * Various small documentation improvements.
  * Improved sample config files.

Tcl API Changes:
  * ns_connchan:
    Added flag "-version" to "ns_connchan open" to specify
    HTTP version (default 1.0)

Configuration Changes:
  * Improved output of "make help"
  * Don't throw error message, when doing an install from a bitbucket
    checkout and no documentation was generated locally.

Command Line Changes:
  * improve usefulness of "nsd -c": in case the environment variable
    NAVISERVER is not set, and bin/init.tcl is not found under the
    running binary, fall-back to the configured install directory as

Code Changes:
 * Extended regression test
 * Keylists:
   - Added new testset for keylists
   - fixed several bugs
   - use naviserver memory management
   - prefer Tcl_Objs over string based interface
 * Improved source code documentation

 * Turn ns_tmpnam into a proc and get rid of call to deprecated C
   library function tmpnam()

 * Added preprocessor variable NS_NAVISERVER to point to the
   configured install directory (can be used as last resort to find
   configuration data when started e.g. with "nsd -c").

 * C-Code cleanup:
   * Improved type cleanness on gcc 4.8.4 (Ubuntu) and
     under gcc7.
   * Aligned function prototype with definition
     (Ns_DbInterpretSqlFile(), Ns_ThreadCreate(),
     Ns_ThreadStackSize(), caused complaints under Solaris)
   * Introduce macros for IPv6 support under Solaris, since
     it does not define s6_addr16 members)

   * don't use implementation defined NULL as last argument of
     variadic function Ns_ConfigGetPath(), Ns_DStringVarAppend(),
     Ns_HomePath(), Ns_MakePath(), Ns_TclEvalCallback()

   * Reduced number of return statement before end of function.
   * Reduced number of gotos.
   * Reduced variable scopes.

   * revproxy:
     New Tcl module based on ns_connchan to implement
     a reverse proxy (works as well with tuneling WebSockets).
   * nsexample, nsphp:
     Aligned function definitions with ns.h to improve
     cleanness of compilation
Posted by Russell Sorensen on
I know this isn't the right place to report a bug, but anyone using naviserver 4.99.13, or 4.99.14 with OpenACS might experience the issue I had. The symptom is in trying to install packages, OpenACS fails and naviserver exits with:

Fatal: alloc: invalid block:

I tracked it down to a small change in ns_mktemp. Here's the diff in nsd/tclfile.c:

< char *buffer = strdup(templateString);

char *buffer = ns_strdup(templateString);

I'll post a bug report with the naviserver developers.

Posted by Gustaf Neumann on
Russel, you are reporting a duplicate of issue #77 [1], which was fixed in 4.99.14.