Skip to content

lean_dojo.interaction.dojo.DojoCrashError: Unexpected EOF #201

@njuyxw

Description

@njuyxw

Description
I have found some tactics that cause the dojo environment to crash, reporting the following error: lean_dojo.interaction.dojo.DojoCrashError: Unexpected EOF

Detailed Steps to Reproduce the Behavior
Test sample: "MiniF2F/Test.lean","mathd_numbertheory_237"
Test tactic: "congr 1"

Test Code:
‘’‘
from lean_dojo import *
import lean_dojo
repo = LeanGitRepo(
"https://github.com/wzj423/lean-dojo-mew",
"1ef4e4cac9dd370b7be6d648ce135a06aa6fce5f",
)
th=Theorem(repo,"MiniF2F/Test.lean","mathd_numbertheory_237")
dojo, state_0 = Dojo(th,additional_imports=["Mathlib.Tactic"]).enter()
action="congr 1"
state_1 = dojo.run_tac(state_0, action)
print(state_1)
’‘’

Error Report:
2024-08-25 12:52:09.445 | DEBUG | lean_dojo.interaction.dojo:_submit_request:379 - {"sid": 0, "cmd": "congr 1"}
Traceback (most recent call last):
File "home/conda/envs/lean/lib/python3.9/site-packages/lean_dojo/interaction/dojo.py", line 418, in _read_next_line
index = self.proc.expect(["\n", f"{_REPL_PROMPT}.?\n"])
File "home/conda/envs/lean/lib/python3.9/site-packages/pexpect/spawnbase.py", line 354, in expect
return self.expect_list(compiled_pattern_list,
File "home/conda/envs/lean/lib/python3.9/site-packages/pexpect/spawnbase.py", line 383, in expect_list
return exp.expect_loop(timeout)
File "home/conda/envs/lean/lib/python3.9/site-packages/pexpect/expect.py", line 179, in expect_loop
return self.eof(e)
File "home/conda/envs/lean/lib/python3.9/site-packages/pexpect/expect.py", line 122, in eof
raise exc
pexpect.exceptions.EOF: End Of File (EOF). Exception style platform.
<pexpect.pty_spawn.spawn object at 0x7fc3b7c4feb0>
command: /home/.elan/bin/lake
args: [b'/home/.elan/bin/lake', b'env', b'lean', b'--threads=1', b'--memory=32768', b'MiniF2F/Test3kldb649.lean']
buffer (last 100 chars): ''
before (last 100 chars): ''
after: <class 'pexpect.exceptions.EOF'>
match: None
match_index: None
exitstatus: 1
flag_eof: True
pid: 990853
child_fd: 7
closed: False
timeout: 600
delimiter: <class 'pexpect.exceptions.EOF'>
logfile: None
logfile_read: None
logfile_send: None
maxread: 1
ignorecase: False
searchwindowsize: None
delaybeforesend: 0.05
delayafterclose: 0.1
delayafterterminate: 0.1
searcher: searcher_re:
0: re.compile('\n')
1: re.compile('REPL>.
?\n')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File home/conda/envs/lean/lib/python3.9/site-packages/lean_dojo/interaction/dojo.py", line 382, in _submit_request
res, msg = self._read_next_line()
File "home/conda/envs/lean/lib/python3.9/site-packages/lean_dojo/interaction/dojo.py", line 429, in _read_next_line
raise EOFError
EOFError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "home/codes/leanRL/rerankATP/try.py", line 9, in
state_1 = dojo.run_tac(state_0, action)
File "home/conda/envs/lean/lib/python3.9/site-packages/lean_dojo/interaction/dojo.py", line 332, in run_tac
res = self._submit_request(req)
File "home/conda/envs/lean/lib/python3.9/site-packages/lean_dojo/interaction/dojo.py", line 384, in _submit_request
raise DojoCrashError("Unexpected EOF")
lean_dojo.interaction.dojo.DojoCrashError: Unexpected EOF

I explored the cause of DojoCrashError and found that:
lean reported a 'maximum recursion depth error' and instructed me to set the option maxRecDepth . However, I do not know how to increase the recursive depth of Lean in Dojo. The issue arises with many tactics generated by LLMs. When such errors occur, Dojo throws a CrashError, causing the BFS search to be interrupted. This limitation affects the overall performance of some LLMs. I hope you can help me with this.

Platform Information
Leandojo version: 2.1.2 [Different versions of leandojo have the same problem]
python version: 3.9.19
lean version: 4.7.0
lake version: 5.0.0-6fce8f7
elan version: 3.1.1 (71ddc6633 2024-02-22)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions