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

Memory error when running tests on Windows #20

Closed
Boddlnagg opened this issue Aug 5, 2017 · 2 comments · Fixed by #21
Closed

Memory error when running tests on Windows #20

Boddlnagg opened this issue Aug 5, 2017 · 2 comments · Fixed by #21
Labels
C-bug Category: Things not working as expected
Milestone

Comments

@Boddlnagg
Copy link

When I run the tests on Windows, the test runner crashes in test_insert_nonleaf_table with a read access violation. I tried to debug and got the following stack trace:

test_edit-e9fa5d7815bf14cc.exe!core::cell::Cell<intrusive_collections::linked_list::NodePtr>::get<intrusive_collections::linked_list::NodePtr>() Line 212
test_edit-e9fa5d7815bf14cc.exe!intrusive_collections::linked_list::NodePtr::next() Line 130
test_edit-e9fa5d7815bf14cc.exe!intrusive_collections::linked_list::LinkedList<toml_edit::document::intrusive::TableAdapter>::clear<toml_edit::document::intrusive::TableAdapter>() Line 728
test_edit-e9fa5d7815bf14cc.exe!intrusive_collections::linked_list::{{impl}}::drop<toml_edit::document::intrusive::TableAdapter>(intrusive_collections::linked_list::LinkedList<toml_edit::document::intrusive::TableAdapter> * self) Line 804
test_edit-e9fa5d7815bf14cc.exe!core::ptr::drop_in_place<intrusive_collections::linked_list::LinkedList<toml_edit::document::intrusive::TableAdapter>>(intrusive_collections::linked_list::LinkedList<toml_edit::document::intrusive::TableAdapter> *) Line 61
test_edit-e9fa5d7815bf14cc.exe!core::ptr::drop_in_place<toml_edit::document::DocumentInner>(toml_edit::document::DocumentInner *) Line 61
test_edit-e9fa5d7815bf14cc.exe!core::ptr::drop_in_place<alloc::boxed::Box<toml_edit::document::DocumentInner>>(toml_edit::document::DocumentInner * *) Line 61
test_edit-e9fa5d7815bf14cc.exe!core::ptr::drop_in_place<toml_edit::document::Document>(toml_edit::document::Document *) Line 61
test_edit-e9fa5d7815bf14cc.exe!test_edit::test_insert_nonleaf_table() Line 77

So it looks like the problem is probably coming from intrusive_collections::linked_list (i.e., not your fault, @ordian). Maybe the raw pointer in NodePtr is invalid ... but I didn't investigate further.

@ordian
Copy link
Member

ordian commented Aug 5, 2017

Thanks for the report!

Looks like the default drop impl for the document is incorrect, because rust does not specify drop order of fields. It is strange, that appveyor CI tests are passing. Are you using 32bit windows?

Probably resolving #19 would eliminate the need for unsafe code.

@ordian ordian added the C-bug Category: Things not working as expected label Aug 5, 2017
@ordian ordian added this to the publish 0.1 milestone Aug 5, 2017
@Boddlnagg
Copy link
Author

I'm using 64bit Windows ... I don't know why this doesn't happen on AppVeyor

bors bot added a commit that referenced this issue Aug 5, 2017
21: fix(document): enforce drop order on DocumentInner r=ordian

@Boddlnagg, can you check whether this patch fixes #20?
@bors bors bot closed this as completed in #21 Aug 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Things not working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants