MathJax icon indicating copy to clipboard operation
MathJax copied to clipboard

[v4] expression visually rendering ok but SRE crashing

Open pkra opened this issue 4 months ago • 3 comments

The following expressions crashes SRE, e.g., on mathjax.org#demo

\begin{align*}\mathcal{R}^\alpha f (r, \omega )&=\sum _{k=0}^\infty \frac{1}{2\pi i} \int _{C} r^{-z} \mathcal{H}_{4,4}^{2,2} (k, \alpha ; z)\mathcal{M} {\mathbb{P}_k f}(z, \omega )\,\mathrm{d}z\\
 &=\sum _{k=0}^\infty \int _0^\infty \underbrace{ \frac{1}{2\pi i} \int _{C} r^{-z} \mathcal{H}_{4,4}^{2,2} (k, \alpha ; z)s^{z} \,\mathrm{d}z }_{\coloneq K_k^{\alpha }(r, s)}\mathbb{P}_k f \frac{\,\mathrm{d}s}{s}\\
 &=\sum _{k=0}^\infty \int _0^\infty K_k^\alpha (r,s)\mathbb{P}_k f(s, \omega )\frac{\,\mathrm{d}s}{s}, 
\end{align*}

I could reduce this test cases to

\begin{align*}\mathcal{R}^\alpha f (r, \omega )&=\sum _{k=0}^\infty \frac{1}{2\pi i} \int _{C} r^{-z} \mathcal{H}_{4,4}^{2,2} (k, \alpha ; z)\mathcal{M} {\mathbb{P}_k f}(z, \omega )
\end{align*}

Removing the last ) no longer threw the errors.

The error in the console is

TypeError: can't access property 0, t.parent.annotation.depth is undefined

Accordingly, no speech is generated.

Activating subtitles will also hang the explorer with "null" being displayed (and the subtitle can no longer be dismissed).

pkra avatar Aug 20 '25 11:08 pkra

I've reduced the sample expression a bit further to

 \int _{C} {\mathbb{P}f}\mathcal{M} 

There is some issue in the visitor that does the depth computation.

zorkow avatar Aug 20 '25 11:08 zorkow

The issue is due to MathJax now using clearspeak as default, which for some reason insists that f,g,h should be treated as functions. So SRE does some rejigging on the semantic tree, which leads to an orphaned parent element without depth annotation. If you try that expression with mathspeak it works fine.

zorkow avatar Aug 20 '25 14:08 zorkow

If you try that expression with mathspeak it works fine.

But I was in fact using mathspeak. EDIT: I'll follow up on the SRE tracker.

pkra avatar Aug 20 '25 15:08 pkra