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

Assertion failed: (total_read == rv_get_reg(rv, rv_reg_a2)), function syscall_read #214

Closed
jserv opened this issue Sep 10, 2023 · 2 comments · Fixed by #257
Closed

Assertion failed: (total_read == rv_get_reg(rv, rv_reg_a2)), function syscall_read #214

jserv opened this issue Sep 10, 2023 · 2 comments · Fixed by #257
Assignees

Comments

@jserv
Copy link
Contributor

jserv commented Sep 10, 2023

After commit 56766c0, Doom fails to launch:

V_Init: allocate screens.
M_LoadDefaults: Load system defaults.
Assertion failed: (total_read == rv_get_reg(rv, rv_reg_a2)), function syscall_read, file syscall.c, line 290.
/bin/sh: line 1: 12197 Abort trap: 6           ../build/rv32emu doom.elf
make: *** [doom] Error 134

Tested on both Ubuntu Linux 20.04 (Intel Xeon E5-2650) and macOS 14.1 (Apple M1).

@visitorckw
Copy link
Collaborator

I didn't encounter the assertion failure described in the issue during my tests. However, I did encounter the same error when running 'readelf,' as well as when launching 'Quake' and selecting single-player mode to enter the game, I observed the same assertion error.

@visitorckw
Copy link
Collaborator

Upon investigation, I discovered that this issue arises due to the incorrect assumption that the number of bytes read will always be equal to the number of bytes requested. This can occur, for example, because there are fewer bytes available at that moment (perhaps due to being close to the end-of-file) or because an error occurred during the read operation. Therefore, it is necessary to handle these scenarios.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants