-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
bugSomething isn't workingSomething isn't working
Description
I tried using this in my VM.
I used this example and got memory corruption.
extern crate bdwgc_alloc;
use bdwgc_alloc::Allocator;
use std::alloc::Layout;
#[global_allocator]
static GLOBAL_ALLOCATOR: Allocator = Allocator;
fn main() {
unsafe { Allocator::initialize() }
loop {
unsafe { std::alloc::alloc(Layout::from_size_align(2 ^ 8, 8).unwrap()) };
}
}Weird things started happening like printing string literals lead to stuff like
`�����`�����`p�`�`P�@�`0� �`��`����`����`����`����`p�`�`P�@�`0� �`��`����`p�`�`P�@�`0� �`��`����`����`����`����`p�`�`P�@�`0� �`��`����`����`����`����`p�`�`P�@�`0� �`��`����`����`����`����`p�`�`P�@�`0� �`��`����`����`����`����`p�`�`P�@�`0� �`��`����`����`����`����`p�`�`P�p�`p��p� q��q��q�@r��r�s�`s��s� t��t��t�@u��u�v�`v��v� w��w��w�@x��x�y�`y��y� z��z��z�@{��{�|�`|��|�@�`0� �`��`����`����`����`��thread 'main' panicked at 'failed printing to stdout: Bad address (os error 14)', library/std/src/io/stdio.rs:1019:9
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working