-
Notifications
You must be signed in to change notification settings - Fork 27
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
Segfault inside Vec::index_mut call #20
Comments
Thanks a lot for this great report :)
Yes, this is a problem which is due to the fact that we would have to re-implement the elision for the
At the moment the assembly output is quite similar to the -O0 of LLVM, except for the fact that HolyJit does not yet use the ModRm addressing modes. You should be (almost) able to compare the assembly produced by HolyJit with the result of:
|
Looking at the generated code, it seems that the problem is that instead of giving the Range argument by reference, we give it by value to the 0x7f2fef121dc6 mov (%rsi),%rdi
0x7f2fef121dc9 movabs $0xfffffffffffffd68,%rsi
0x7f2fef121dd3 add %rbp,%rsi
0x7f2fef121dd6 mov (%rsi),%rax
0x7f2fef121dd9 mov 0x8(%rsi),%rcx
0x7f2fef121ddd mov %rax,%rsi
0x7f2fef121de0 mov %rdx,%rax
0x7f2fef121de3 mov %rcx,%rdx
0x7f2fef121de6 callq *%rax The problem is likely located here: Lines 1083 to 1093 in e4ed3be
|
I came across this while trying to implement input/output for brainfuck.
I looked at the crash for a bit in rr, it seems that something is calling index_mut without setting registers properly.
rsi = 0x0
, which causes a null derefIn short:
So this is definitely crashing on indexing the
mem
variable.Here's code that triggers this crash: [Note: I use boxed traits, because the
jit!()
macro doesn't accept generic functions]The text was updated successfully, but these errors were encountered: