• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7700 for generic doc work for TWiki-6.0.2. Use View topic Item7703 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

When using RcsLite, we have been getting the following messages flooding the Apache error log.

The first we are getting is as follows:

[Fri Sep 29 17:24:07 2006] [error] [client] [Fri Sep 29 17:24:07 2006] view: Deep recursion on subroutine "TWiki::Store::RcsLite::_patchN" at /home/twiki2/lib/TWiki/Store/RcsLite.pm line

We are also getting this message, though not as often as the one above:

[Fri Sep 29 18:05:23 2006] [error] [client] [Fri Sep 29 18:05:23 2006] view: splice() offset past end of array at /home/twiki2/lib/TWiki/Store/RcsLite.pm line 579.
[Fri Sep 29 18:05:23 2006] [error] [client] [Fri Sep 29 18:05:23 2006] view: splice() offset past end of array at /home/twiki2/lib/TWiki/Store/RcsLite.pm line 584.

This is an upgrade from Cairo to Dakar which has been running for about 2 weeks now. The revision control is working as expected from an end users point of view, we are just concerned about the size of our Apache error log (5 gb!).


Can you give a testcase please? Obviously our existing testcases all pass, otherwise this would have been spotted before... Thanks.


I have been keeping an eye on the Apache error log and the TWiki log files this morning and it seems to happen when there are 3 or 4+ saves/cmd actions being logged.

However, At one point this morning I got the same deep recursion message ~92 times all at once. This time it referred a topic, as shown:

[Mon Oct 09 11:53:13 2006] [error] [client] [Mon Oct  9 11:53:13 2006] rdiff: Deep recursion on subroutine "TWiki::Store::RcsLite::_patchN" at /home/twiki2/lib/TWiki/Store/RcsLite.pm line 626., referer: http://wiki.emea.arm.com/Softsys/SymmetricMultiProcessing

Looking at this topic there is nothing special about it. It has been revised 115 times over its life, the last one being this morning at 08:39, which is a good 3 hours before the message above was printed in the log file.

As I was writing this, another batch of errors came through my log file. This time it was the following:

[Mon Oct 09 12:01:03 2006] [error] [client] [Mon Oct  9 12:01:03 2006] view: splice() offset past end of array at /home/twiki2/lib/TWiki/Store/RcsLite.pm line 579.
[Mon Oct 09 12:01:03 2006] [error] [client] [Mon Oct  9 12:01:03 2006] view: splice() offset past end of array at /home/twiki2/lib/TWiki/Store/RcsLite.pm line 584.

This totalled ~118 lines, and did not give a referrer, though did have two line numbers (which I have copied both in). At this time in the TWiki log files there were three saves and one cmd actions.

I guess you could try and recreate it by using RcsLite on a busy server for a while and see if you get similar messages from Apache. As I said this is an upgrade, and before we upgraded we was using RcsWrap. However we changed to RcsLite due to another issue (TWiki:Support.MultipleEditsWithinOneHour). I am yet to find any evidence to suggest that this is only occuring on pages from upgraded from Cairo and not new pages.

Thanks for your help.


The busyness or otherwise of the server is unlikely to have any effect on this.

RcsLite is very sensitive to the format of the ,v files, and it's possible that if you used an old version of RCS with Cairo, that it save files in a format that confuses RcsLite. Please try to nail this down to a specific topic, and if possible, attach the ,v file for the topic here. Thanks.


I have found a topic which creates this error and have attached it. If you try to look at revision 9, no error message is produced. For any previous revisions, the following error message is show:

[Wed Nov 01 14:48:22 2006] [error] [client] [Wed Nov  1 14:48:22 2006] view: splice() offset past end of array at /home/twiki2/lib/TWiki/Store/RcsLite.pm line 587., referer: http://wiki.emea.arm.com/Eng/ProteusVersoc?rev=9



It's pretty clear from your example that RcsLite is getting things badly wrong. There are several cases between rev 9 and rev 8 where a (add) instructions are followed by too few additional lines. I wonder if this has to do with line endings.

It might be possible to write a script to repair damaged histories. I can't see any obvious reason why it is getting it wrong, though. It really needs one of the authors of RcsLite to take a look.

In the interim my strong recommendation is to move to RcsWrap (which appears to be able to recover from this error). It should be data-compatible.


We would prefer to use RcsWrap, but it was not merging multiple edits within an hour (TWiki:Support.MultipleEditsWithinOneHour), which led to a few complaints. With RcsLite, everything seems fine to the user, just our error log is getting flooded. Therefore it will probably be best for us to continue using RcsLite until one of these issues are resolved.


Thank you for the testcase! It makes tracking bugs down so much easier when you have one.

Sadly everything is not fine for your users, as any old revision viewed with this bug will not appear correctly.

I have attached a fixed version of RcsLite.pm, which you should be able to use until a hotfix or upgrade is available.

I'm setting this "Waiting for Release" in the hope it cures all the problems you are seeing. If it doesn't please don't hesitate to re-open this report.


I'm afraid this has not entirely fixed the problem. I still notice these messages in the error log, though they are not as frequent. I am trying to find another test case, but the topics which seem to cause the error on the live wiki do not cause a problem on a clean wiki.

I shall keep looking for a test case which can be recreated and when I find one I will post it here.



Darn. Setting to "Waiting for feedback" pending your testcase.


Andrew wrote "We would prefer to use RcsWrap, but it was not merging multiple edits within an hour". Is there a bug item on this? Or is this a problem with RCS itself? If this is a TWiki bug and there is no bug item Andrew should raise a bug item for this also


I have not created a bug item for my RcsWrap problems as yet, as I thought they were something to do with the upgrade and was getting help from the topic in the Support web. However, I do not think anyone is watching the topic any more so I will create a new bug report based on the problems I and some others reported in the Support web topic.

Regarding this bug, I apologise for not providing any more updates. After some good log watching I have managed to find another test case which can be recreated. Its a WebStatistics topic, and I have attached it below.

The errors start appearing from rev 359 and below. You would probably have wanted something with a little less revisions to look through, so apologies for that as well, but this is the only one I could find today. They are defiantly much less frequent after the last fix.


There isn't any obvious problem with that topic; it's certainly not a repeat of the previous problem. I can't reproduce any problem doing the obvious things (viewing earlier revs and diffs). To debug, I need to know what the error message is, and how exactly to reproduce it. Thanks.


The error message is shown in the Apache error log and is as follows:

view: Deep recursion on subroutine "TWiki::Store::RcsLite::_patchN" at /var/www/twiki2/lib/TWiki/Store/RcsLite.pm line 647.

It shows when you look at revision 359 while using RcsLite. I have managed to recreate this on a clean TWiki 4 install.



Gotcha, thx, I can reproduce that on the leading-edge code. Now, WTF is going on? :-/


Hah! It's obvious, really. Perl treats 100 levels of recursion as a "potential error" and issues a warning. RcsLite uses recursion to generate revisions from previous revs. You have more that 100 revs, so you hit the trap. TWiki defines warnings as errors, so it goes tits-up. Bah.


Index: lib/TWiki/Store/RcsLite.pm
--- lib/TWiki/Store/RcsLite.pm  (revision 12071)
+++ lib/TWiki/Store/RcsLite.pm  (working copy)
@@ -637,17 +637,15 @@
 sub _patchN {
     my( $this, $text, $version, $target ) = @_;

-    my $deltaText = $this->{revs}[$version]->{text};
-    my $delta = _split( $deltaText );
-    _patch( $text, $delta );
-    #print STDERR "REV $version: '",join('\n',@$text),"'\n";
-    if( $version <= $target ) {
-        return join( "\n", @$text );
-    } else {
-        return $this->_patchN( $text, $version-1, $target );
+    while ($version >= $target) {
+        my $deltaText = $this->{revs}[$version--]->{text};
+        my $delta = _split( $deltaText );
+        _patch( $text, $delta );
+    return join( "\n", @$text );


Sorry to reopen this again but we have found another bug. This time the error message is as follows:

[Tue Nov 28 08:55:42 2006] [error] [client] [Tue Nov 28 08:55:42 2006] view: splice() offset past end of array at /var/www/twiki2/lib/TWiki/Store/RcsLite.pm line 582.
[Tue Nov 28 08:55:42 2006] [error] [client] [Tue Nov 28 08:55:42 2006] view: splice() offset past end of array at /var/www/twiki2/lib/TWiki/Store/RcsLite.pm line 604.

Have attached another test case (DevsysPRMTemplate) and been able to recreate it on a clean install. The messages appear in the Apache error log when you view rev 16. There is also a line of text in red at the top of the page when viewing this revision that states there is a probable error in the revision of the topic and asks us to edit and re save the topic, though that didn't stop the errors.

These errors were appearing in the log before the fixes you have made so far, so it is not anything new.

Thanks again,


It looks very much like that is a repeat of the same problem, unless there is something I am missing. The message is wishful thinking. I thought it would repair the topic, but on review, it takes more than that :-(.

It would be possible to write a script to repair topics, I guess, but given that the cause of this error is cured, I'm not inclined to do so. So I'm going to correct the message and leave it at that. I have opened a new bug Item3212 at a lower priority in the hope that someone will have the time to write a testcase and fix it.

BTW I scrubbed those attachments off the server, as they seemed to me to contain information that would be useful to one of your competitors.


4.1.0 released


Summary RcsLite deep recursion on subroutine errors
ReportedBy TWiki:Main.AndrewJones86
Codebase 4.0.4, 4.0.5
SVN Range

AppliesTo Engine

Priority Urgent
CurrentState Closed

Checkins 11865 12080
TargetRelease minor
Topic attachments
I Attachment History Action Size Date Who Comment
Texttxt DevsysPRMTemplate.txt r1 manage 28.3 K 2006-11-29 - 11:56 UnknownUser 'splice() offset past end of array' errors, rev 16
Texttxt DevsysPRMTemplate.txt,v.txt r1 manage 292.0 K 2006-11-29 - 11:57 UnknownUser ,v file 'splice() offset...'
Unknown file formattxt% DevsysPRMTemplate.txt,v.txt%   manage 0.1 K 1970-01-01 - 00:00 UnknownUser  
Texttxt ProteusVersoc.txt r1 manage 6.9 K 2006-10-31 - 22:53 UnknownUser  
Texttxt ProteusVersoc.txt,v.txt r1 manage 14.1 K 2006-10-31 - 22:47 UnknownUser  
Perl source code filepm RcsLite.pm r1 manage 22.4 K 2006-11-01 - 15:57 CrawfordCurrie Fixed version with changes from rev 11865
Texttxt WebStatistics.txt r1 manage 6.3 K 2006-11-27 - 17:21 UnknownUser Shows Deep recursion on subroutine erros from rev 359
Texttxt WebStatistics.txt,v.txt r1 manage 289.5 K 2006-11-27 - 17:23 UnknownUser  
Edit | Attach | Watch | Print version | History: r25 < r24 < r23 < r22 < r21 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r25 - 2007-01-16 - KennethLavrsen
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback