-
Notifications
You must be signed in to change notification settings - Fork 20
MemoryMap fails on ARM #4
Comments
@geraldstanje It seems that the libc isn't dividing the offset by 4096 before calling mmap2. Try specifying 0x40000 as the offset (just a divide by 0x1000). |
ok. and the 0x30 in the unsafe part? |
strace for the c app: http://ideone.com/jiKlfK when i look at mmap2 in the c version of the app... i can see that 0x40000000 is correct!? |
No, the 0x30 is fine. |
did you see both strace logs? |
i checked the addresses written to for both in C and rust: the address i write to in C is: 0xb6e3f030
the address i write to in rust is: 0xb5c00030
when you look at both strace logs (offset: 0x40000000, offset: 0x40000) ... mmap2 maps in both cases to address 0xb5c00000 ... why? |
does *mut T::offset() gives you the address plus the offset, or just the offset (the difference itself, regardless of the base pointer). You might want to check that. Also, as someone on IRC said, try using the libc's mmap (using the ffi, extern {}, etc) to see what happens. I cannot really say anything else at the moment… |
where do you see a function
output: 0xb5c00000 @cmr any idea to the latest infos? |
No, not within rst-mmap, within the standard lib, I'm talking about the one you use here : |
@navaati ... thats the output: output: 0xb5c00030
|
Hi,
I ported this c app (http://ideone.com/AbImAr) to rust but face an issue with MemoryMap.
The rust app is cross compiled on my ubuntu linux for the ARM:
Rust was built from source according to https://github.com/japaric/ruststrap/blob/master/1-how-to-cross-compile.md
The rust app is built using cargo:
The rust app crashes without any error and cuts off my ssh connection to the device...
what happens could be:
in best case the kernel crashes, in worst case a disk buffer is overwritten and face a silent filesystem corruption...
Here the code code of the rust app (which crashes when executing the unsafe part):
http://is.gd/PT0cwM
Gdb output:
why does it report "Cannot access memory"? Can i trust this info to be correct?
Strace for the rust app (to get the strace, the unsafe part of the code was disabled):
http://ideone.com/hNIYMw
The text was updated successfully, but these errors were encountered: