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

Built-in rm2fb client corrupts the server state #88

Closed
LoganDark opened this issue Jan 11, 2022 · 3 comments · Fixed by #89
Closed

Built-in rm2fb client corrupts the server state #88

LoganDark opened this issue Jan 11, 2022 · 3 comments · Fixed by #89
Milestone

Comments

@LoganDark
Copy link
Contributor

LoganDark commented Jan 11, 2022

Somehow libremarkable's rm2fb client implementation is causing the server to stop working after executing the application once. The server no longer understands messages from either libremarkable apps OR the official rm2fb client - it is completely defunct. These log messages occur when the server becomes corrupteed:

reMarkable env[18332]: Error, unknown message type
reMarkable env[18332]: Error recv msgbuf: Invalid argument
reMarkable env[18332]: Error, unknown message type
reMarkable env[18332]: Error recv msgbuf: Invalid argument
reMarkable env[18332]: Error, unknown message type
reMarkable env[18332]: Error recv msgbuf: Invalid argument
reMarkable env[18332]: Error, unknown message type
reMarkable env[18332]: Error recv msgbuf: Invalid argument
reMarkable env[18332]: Error, unknown message type
reMarkable env[18332]: Error recv msgbuf: Invalid argument

Restarting rm2fb allows it to work again.

Forcing libremarkable to use /dev/fb0 and running it under LD_PRELOAD=/opt/rm2fb/librm2fb_client.so.1.0.1 does not exhibit the issue. The application can be run any number of times without affecting the server. The issue only occurs when libremarkable is allowed to use its built-in client.

Codex version 2.11.0.442
reMarkable 2 model RM110
rm2fb server invocation: /usr/bin/env LD_PRELOAD=/opt/rm2fb/librm2fb_server.so.1.0.1 /usr/bin/xochitl

@LoganDark
Copy link
Contributor Author

This Rust file exhibits the issue:

use libremarkable::device::CURRENT_DEVICE;
use libremarkable::framebuffer::core::Framebuffer;
use libremarkable::framebuffer::FramebufferBase;

fn main() {
	Framebuffer::from_path(CURRENT_DEVICE.get_framebuffer_path());
}

Binary: corrupt.zip

@bkirwi
Copy link
Collaborator

bkirwi commented Jan 11, 2022

...which is wild, since of course many apps include that code. Perhaps a bug introduced very recently, something triggered by unusual use of the framebuffer, or some environmental thing?

I can try and repro, but maybe not for a couple days depending.

@LinusCDE
Copy link
Collaborator

Good catch. Seems to be an issue with the built-in client. Found some weird crashing of the rm2fb stuff (including other apps wanting to use it) when testing the newest plato release with it. I disabled it by default there, but didn't have the time yet, to investigate further. Will do so now i guess.

Full discord message with some rationale why I didn't create this issue 2 days ago. Around that message might also be more context regarding finding / investigating this bug.

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