Tags:
create new tag
, view all tags

Bug: RcsLite generates lots of unitialized value errors

I just installed the latest TWiki on my machine and it seems to be working just fine. However when I looked at the Apache error log file I saw lots & lots of error messages being reported. Mostly Use of uninitialized value in concatenation (.) or string, all occurring in RcsLite.pm (e.g. at the beginning of _write, in the call to join in _patchN & elsewhere). Looking further I noticed several apparent problems:

  1. The new routine does not initialize values for many of the fields.
  2. The addRevision routine has a call to _trace passing it the (newly added?) calling parameter date, but the routines that call addRevision do not provide a value for date.
  3. the TWiki debug.txt file is full of identical messages giving the version of Diff.pm

Initializing the various fields in new & commenting out the call to _trace & writeDebug seem to fix everything---at least no more unitialized value error messages. Patch given below.

Test case

Configure a TWiki to use RcsLite and create a new page or any other activity that exercises RCS and then look at the Apache error log file.

Patch


*** twiki/lib/TWiki/Store/RcsLite.pm.old    Fri May 28 23:51:35 2004
--- twiki/lib/TWiki/Store/RcsLite.pm  Thu Dec 30 15:43:51 2004
***************
*** 50,56 ****
  use FileHandle;
  use TWiki;

! TWiki::writeDebug("Diff version $Algorithm::Diff::VERSION\n");

  my $DIFF_DEBUG = 0;
  my $DIFFEND_DEBUG = 0;
--- 50,56 ----
  use FileHandle;
  use TWiki;

! #TWiki::writeDebug("Diff version $Algorithm::Diff::VERSION\n");

  my $DIFF_DEBUG = 0;
  my $DIFFEND_DEBUG = 0;
***************
*** 72,77 ****
--- 72,83 ----
     bless( $self, $class );
     $self->_init();
     $self->{head} = 0;
+    $self->{access} = "";
+    $self->{comment} = "";
+    $self->{symbols} = "";
+    $self->{description} = "";
+    $self->{delta} = ();
+    $self->{log} = ();
     return $self;
  }

***************
*** 579,585 ****
  sub addRevision
  {
      my( $self, $text, $log, $author, $date ) = @_;
!     _trace( "::addRevision date=\"$date\"" );
      $self->_ensureProcessed();

      $self->_save( $self->file(), \$text );
--- 585,591 ----
  sub addRevision
  {
      my( $self, $text, $log, $author, $date ) = @_;
! #   _trace( "::addRevision date=\"$date\"" );
      $self->_ensureProcessed();

      $self->_save( $self->file(), \$text );


Environment

TWiki version: TWikiRelease02Sep2004
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: Solaris 10
Web server: Apache 2.0.5
Perl version: 5.8?
Client OS: Mac OS X
Web Browser: Firefox 1.0

-- RonGoldman - 31 Dec 2004

Follow up

Fix record

Topic revision: r1 - 31 Dec 2004 - 03:12:56 - RonGoldman
 
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback