[solved] RSOD Troubleshooting steps beyond the obvious (for javascript error)?

Yes. I was able to duplicate the issue just by dragging shiraz plugin and the view template (attached below) onto tiddlywiki.com and opening the shiraz plugin for viewing.

SAFE_ $__core_ui_ViewTemplate_subtitle.json (754 Bytes)

I think trying to wikify the plugin when it is embedded inside of json is causing the problem. I think because some of the widget tags are not closed (list widget, let widget, etc) the whole rest of the large plugin tiddler is getting included as part of the widget and it is eating a lot of memory. When processed as individual tiddlers, the unclosed tags are automatically terminated at the end of the tiddler. Needs more investigation still.

Example of unclosed widgets in Shiraz

Also note, in this case all the plugins were disabled starting early in the troubleshooting process. So for one of the old plugins to be contributing to the problem, it would have to have had significant effects despite being offline.

I appreciate the lesson about running with a leaner and better-tested set of plugins, even if – or maybe precisely because – all the other plugin tiddlers were so many red herrings.

After more troubleshooting, I’ve found I can duplicate the “RangeError: Maximum call stack size exceeded” error (that’s the error in chrome…firefox is different) by pasting this filter into the advanced search of tiddlywiki.com:

[{$:/core}splitregexp[]count[]]

In @Springer’s wiki, the wikification of $:/plugins/kookma/shiraz effectively results in the following filter being evaluated: [{$:/plugins/kookma/shiraz}splitregexp[]]. I don’t know the exact reason why that happens, but I think it is reasonable to suggest that wikification of a plugin tiddler is a bad idea and should be avoided.

@Springer, IMO, your view template should only wikify the text of the tiddler if either the type is empty or the type is text/vnd.tiddlywiki. That should reduce the chance for surprises.

This line of code is where the crash happens.

Array.prototype.push.apply(result,title.split(regExp));

In @Springer’s case, title above is the 135KB contents of the Shiraz plugin. The call to split will split on every character, so there will be 135K arguments passed to push. That is too many and it causes the crash.

1 Like

Yes! A good practice, for any wordcount within a ViewTemplate, would be to surround it with a filter to ensure that it’s not trying to evaluate anything unmanageable.

I suspect that the potential for “maximum call stack size exceeded” errors is even more widespread than just the use-case @Springer encountered. For example, an RSOD can be triggered by this filter:

[[0]pad[124000]split[]]

and I’m sure there are lots of other filters that output very large lists that can result in RSOD errors.

Rather than chasing down each potential RSOD, I suggest that a generalized “throw-catch” wrapper should be added around the TWCore’s filter processing code, in order to protect against this error. I’m not sure what the “catch” handling should do in response, but at the very least it should prevent the RSOD from occurring

-e

1 Like

Strangely the viewtemplate work here: (see #14)

https://temporary-minified-kookma-plugins.tiddlyhost.com/#%24%3A%2Fplugins%2Fkookma%2Fshiraz

BUT in the same wiki entring [{$:/plugins/kookma/shiraz}splitregexp[]] in $:/AdvancedSearch makes browser (Edge/Chrome 110) freezes for a while but finally shows the result!

To my conclusion the issue is not related to minification by Uglify! nor related to Shiraz, but it is related to core as described by @btheado

I will just add I have used a lot of Toiases plugins and solutions over the years. He was one of the most productive creating extensions of tiddlywiki ever. Unfortunately, he has not being active of recent years. What I tend to do now is look at how Tobias did it and consider if there are new features than can help and build new equivalents when possible.

  • Tobias’s legacy is deep and has informed many of the subsequent improvements, his ideas live on in the core. As a result we may see some of these now cause problems.
1 Like