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

Crash when reading stdin from a file #4

Open
ntrippar opened this issue Oct 24, 2022 · 4 comments
Open

Crash when reading stdin from a file #4

ntrippar opened this issue Oct 24, 2022 · 4 comments

Comments

@ntrippar
Copy link

ntrippar commented Oct 24, 2022

Hello, first of all I want to know the status of this project and if currently are working on this.

Also testing it I found that when running any file that reads from a file and check data directly for example source_0_original_1b_rs makes the process crash

This is SymCC running with the QSYM backend
Reading program input until EOF (use Ctrl+D in a terminal)...
What's your name?
fatal runtime error: Rust cannot catch foreign exceptions
(core dumped) /home/ubuntu/belcarra_source/examples/source_0_original_1b_rs/target_cargo_on/debug/belcarra

this seems that is because some kind of a null ptr but I don't have much of experience with this project to try right now to fix it.

I'm using the 1.63.0 tag.

@ntrippar
Copy link
Author

doing some simple test this could be that if read directly from stdin, the code is MMAP'ing and seems that maybe symcc is not tracking that. beause if I read the data doing a String::from_utf8_lossy(&buf[0 .. root_len]) starts working

@ntrippar
Copy link
Author

also this only crash on binaries without optimization, if we use the following profile for dev it works without crashing.

[profile.dev]
opt-level = 3
overflow-checks = true

@tuong
Copy link
Collaborator

tuong commented Oct 26, 2022

Hi, yes this project is still in active development.

This fatal error has been known to happen since version 1.48.0 (more or less non-deterministically in past versions). However at this point I have not yet investigated further, it seems to be also related to:
rust-lang/rust#70212

At least, for the versions 1.46.0 and 1.47.0, I have not noticed the problem happening so far: so the SYMRUSTC_SKIP_FAIL=yes flag has been left on for some of the recent respective versions here:
https://github.com/sfu-rsl/symrustc/blob/1.48.0/.github/workflows/build.yml

Thanks for the tips on from_utf8_lossy and your profile example, I was not aware of that.

@ntrippar
Copy link
Author

ntrippar commented Oct 26, 2022

on the from_utf8_lossy disregard, that is because other stuff for sure, maybe some optimizations this does in the back. so with the dev profile started working. but testing on bigger example code kind of don't find new branches, I suppose this is maybe because rust tries to optimize and use SIMD / AVX that for sure is not supported by this. maybe we can use something like simd_emulation. also would be nice to have some more documentation around the aflplusplus implementation here. I tried with some example binary running the solver but didn't get any more coverage of it. (edited, i just looked that you patched the SSE) weird. maybe I'm running something wrong.

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

No branches or pull requests

2 participants