Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Infinite recursion in blocks text parser #752

Open
1 task done
sam0jones0 opened this issue Feb 8, 2025 · 1 comment · May be fixed by #753
Open
1 task done

[BUG] Infinite recursion in blocks text parser #752

sam0jones0 opened this issue Feb 8, 2025 · 1 comment · May be fixed by #753
Labels
type: bug Something isn't working

Comments

@sam0jones0
Copy link

sam0jones0 commented Feb 8, 2025

Environment

GitHub v2-dev branch

Description

The blocks text parser is experiencing infinite recursion when processing certain code blocks. I think the regex patterns are causing catastrophic backtracking in the code block parsing logic.

Note this first started appearing after I imported a PDF and asked Google Flash 2.0 to extract the text.

Steps to reproduce:

Device and browser

Firefox 135.0 (64-bit). Windows 10

Screenshots and more

InternalError: too much recursion

parseBlocksFromText@http://localhost:3000/_next/static/chunks/src_modules_blocks_47ff4c._.js:4087:44
useAutoBlocksMemoSemiStable.useMemo@http://localhost:3000/_next/static/chunks/src_modules_blocks_47ff4c._.js:4233:197
mountMemo@http://localhost:3000/_next/static/chunks/node_modules_react-dom_cjs_react-dom_development_ab7e07.js:14033:29
useMemo@http://localhost:3000/_next/static/chunks/node_modules_react-dom_cjs_react-dom_development_ab7e07.js:14417:32
useMemo@http://localhost:3000/_next/static/chunks/node_modules_react_1cad9b._.js:1356:31
useAutoBlocksMemoSemiStable@http://localhost:3000/_next/static/chunks/src_modules_blocks_47ff4c._.js:4208:135
AutoBlocksRenderer@http://localhost:3000/_next/static/chunks/src_modules_blocks_47ff4c._.js:4416:201
renderWithHooks@http://localhost:3000/_next/static/chunks/node_modules_react-dom_cjs_react-dom_development_ab7e07.js:13260:37
mountIndeterminateComponent@http://localhost:3000/_next/static/chunks/node_modules_react-dom_cjs_react-dom_development_ab7e07.js:17136:25
beginWork@http://localhost:3000/_next/static/chunks/node_modules_react-dom_cjs_react-dom_development_ab7e07.js:18376:32
callCallback@http://localhost:3000/_next/static/chunks/node_modules_react-dom_cjs_react-dom_development_ab7e07.js:3802:30
invokeGuardedCallbackDev@http://localhost:3000/_next/static/chunks/node_modules_react-dom_cjs_react-dom_development_ab7e07.js:3840:30
invokeGuardedCallback@http://localhost:3000/_next/static/chunks/node_modules_react-dom_cjs_react-dom_development_ab7e07.js:3893:41
beginWork$1@http://localhost:3000/_next/static/chunks/node_modules_react-dom_cjs_react-dom_development_ab7e07.js:23119:42
performUnitOfWork@http://localhost:3000/_next/static/chunks/node_modules_react-dom_cjs_react-dom_development_ab7e07.js:22402:24
workLoopSync@http://localhost:3000/_next/static/chunks/node_modules_react-dom_cjs_react-dom_development_ab7e07.js:22331:34
renderRootSync@http://localhost:3000/_next/static/chunks/node_modules_react-dom_cjs_react-dom_development_ab7e07.js:22308:21
performConcurrentWorkOnRoot@http://localhost:3000/_next/static/chunks/node_modules_react-dom_cjs_react-dom_development_ab7e07.js:21732:84
workLoop@http://localhost:3000/_next/static/chunks/node_modules_4877a7._.js:267:56
flushWork@http://localhost:3000/_next/static/chunks/node_modules_4877a7._.js:246:28
performWorkUntilDeadline@http://localhost:3000/_next/static/chunks/node_modules_4877a7._.js:474:35
EventHandlerNonNull*[project]/node_modules/scheduler/cjs/scheduler.development.js [client] (ecmascript)/<@http://localhost:3000/_next/static/chunks/node_modules_4877a7._.js:510:13
[project]/node_modules/scheduler/cjs/scheduler.development.js [client] (ecmascript)@http://localhost:3000/_next/static/chunks/node_modules_4877a7._.js:559:7
instantiateModule/<@http://localhost:3000/_next/static/chunks/pages__app_6f7c11._.js:693:27
runModuleExecutionHooks@http://localhost:3000/_next/static/chunks/pages__app_6f7c11._.js:738:22
instantiateModule@http://localhost:3000/_next/static/chunks/pages__app_6f7c11._.js:691:32
getOrInstantiateModuleFromParent@http://localhost:3000/_next/static/chunks/pages__app_6f7c11._.js:624:12
commonJsRequire@http://localhost:3000/_next/static/chunks/pages__app_6f7c11._.js:157:52
[project]/node_modules/scheduler/index.js [client] (ecmascript)@http://localhost:3000/_next/static/chunks/node_modules_4877a7._.js:571:22
instantiateModule/<@http://localhost:3000/_next/static/chunks/pages__app_6f7c11._.js:693:27
runModuleExecutionHooks@http://localhost:3000/_next/static/chunks/pages__app_6f7c11._.js:738:22
instantiateModule@http://localhost:3000/_next/static/chunks/pages__app_6f7c11._.js:691:32
getOrInstantiateModuleFromParent@http://localhost:3000/_next/static/chunks/pages__app_6f7c11._.js:624:12
commonJsRequire@http://localhost:3000/_next/static/chunks/pages__app_6f7c11._.js:157:52
[project]/node_modules/react-dom/cjs/react-dom.development.js [client] (ecmascript)/<@http://localhost:3000/_next/static/chunks/node_modules_react-dom_cjs_react-dom_development_ab7e07.js:24:46
[project]/node_modules/react-dom/cjs/react-dom.development.js [client] (ecmascript)@http://localhost:3000/_next/static/chunks/node_modules_react-dom_cjs_react-dom_development_ab7e07.js:25080:7
instantiateModule/<@http://localhost:3000/_next/static/chunks/pages__app_6f7c11._.js:693:27
runModuleExecutionHooks@http://localhost:3000/_next/static/chunks/pages__app_6f7c11._.js:738:22
instantiateModule@http://localhost:3000/_next/static/chunks/pages__app_6f7c11._.js:691:32
getOrInstantiateModuleFromParent@http://localhost:3000/_next/static/chunks/pages__app_6f7c11._.js:624:12
commonJsRequire@http://localhost:3000/_next/static/chunks/pages__app_6f7c11._.js:157:52
[project]/node_modules/react-dom/index.js [client] (ecmascript)@http://localhost:3000/_next/static/chunks/node_modules_react-dom_f14d04._.js:35:22
instantiateModule/<@http://localhost:3000/_next/static/chunks/pages__app_6f7c11._.js:693:27
runModuleExecutionHooks@http://localhost:3000/_next/static/chunks/pages__app_6f7c11._.js:738:22
instantiateModule@http://localhost:3000/_next/static/chunks/pages__app_6f7c11._.js:691:32
getOrInstantiateModuleFromParent@http://localhost:3000/_next/static/chunks/pages__app_6f7c11._.js:624:12
commonJsRequire@http://localhost:3000/_next/static/chunks/pages__app_6f7c11._.js:157:52
[project]/node_modules/react-dom/client.js [client] (ecmascript)@http://localhost:3000/_next/static/chunks/node_modules_react-dom_f14d04._.js:44:30
instantiateModule/<@http://localhost:3000/_next/static/chunks/pages__app_6f7c11._.js:693:27
runModuleExecutionHooks@http://localhost:3000/_next/static/chunks/pages__app_6f7c11._.js:738:22
instantiateModule@http://localhost:3000/_next/static/chunks/pages__app_6f7c11._.js:691:32
getOrInstantiateModuleFromParent@http://localhost:3000/_next/static/chunks/pages__app_6f7c11._.js:624:12
commonJsRequire@http://localhost:3000/_next/static/chunks/pages__app_6f7c11._.js:157:52
[project]/node_modules/next/dist/client/index.js [client] (ecmascript)@http://localhost:3000/_next/static/chunks/node_modules_next_e2f0a6._.js:18647:58
instantiateModule/<@http://localhost:3000/_next/static/chunks/pages__app_6f7c11._.js:693:27
runModuleExecutionHooks@http://localhost:3000/_next/static/chunks/pages__app_6f7c11._.js:738:22
instantiateModule@http://localhost:3000/_next/static/chunks/pages__app_6f7c11._.js:691:32
getOrInstantiateModuleFromParent@http://localhost:3000/_next/static/chunks/pages__app_6f7c11._.js:624:12
commonJsRequire@http://localhost:3000/_next/static/chunks/pages__app_6f7c11._.js:157:52
[project]/node_modules/next/dist/client/next-dev-turbopack.js [client] (ecmascript)@http://localhost:3000/_next/static/chunks/node_modules_next_e2f0a6._.js:20343:32
instantiateModule/<@http://localhost:3000/_next/static/chunks/pages__app_6f7c11._.js:693:27
runModuleExecutionHooks@http://localhost:3000/_next/static/chunks/pages__app_6f7c11._.js:738:22
instantiateModule@http://localhost:3000/_next/static/chunks/pages__app_6f7c11._.js:691:32
getOrInstantiateRuntimeModule@http://localhost:3000/_next/static/chunks/pages__app_6f7c11._.js:602:12
registerChunk@http://localhost:3000/_next/static/chunks/pages__app_6f7c11._.js:1439:50
async*registerChunk@http://localhost:3000/_next/static/chunks/pages__app_6f7c11._.js:560:20@http://localhost:3000/_next/static/chunks/pages__app_6f7c11._.js:1647:18@http://localhost:3000/_next/static/chunks/pages__app_6f7c11._.js:1648:3

Willingness to Contribute

  • 🙋‍♂️ Yes, I would like to contribute a fix.
@sam0jones0 sam0jones0 added the type: bug Something isn't working label Feb 8, 2025
@enricoros
Copy link
Owner

@sam0jones0 confirm I see this issue, however may be unrelated to the parsing. For me it crashes on the tokenizer for some reason.

@enricoros enricoros reopened this Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants