Skip to content
This repository

test_port in run-pass/binops.rs causes valgrind warnings from shape_glue #2724

Closed
msullivan opened this Issue June 25, 2012 · 5 comments

2 participants

Michael Sullivan Tim Chevalier
Michael Sullivan
Collaborator

On my system, it produces:

==25913== Thread 3:
==25913== Conditional jump or move depends on uninitialised value(s)
==25913==    at 0x5876323: shape::cmp::walk_res2(shape::rust_fn const*, unsigned char const*) (rust_shape.cpp:220)
==25913==    by 0x587A181: shape::ctxt<shape::data<shape::cmp, shape::ptr_pair> >::walk() (rust_shape.h:954)
==25913==    by 0x587A674: shape::data<shape::cmp, shape::ptr_pair>::walk_box_contents1() (rust_shape.cpp:188)
==25913==    by 0x587A6E4: shape::ctxt<shape::data<shape::cmp, shape::ptr_pair> >::walk_box0() (rust_shape.cpp:282)
==25913==    by 0x587A1EC: shape::ctxt<shape::data<shape::cmp, shape::ptr_pair> >::walk() (rust_shape.h:306)
==25913==    by 0x5876F30: shape::cmp::walk_variant2(shape::tag_info&, unsigned long, std::pair<unsigned char const*, unsigned char const*>) (rust_shape.cpp:371)
==25913==    by 0x5876FB7: shape::cmp::walk_tag2(shape::tag_info&, shape::data_pair<unsigned long> const&) (rust_shape.h:1010)
==25913==    by 0x5879B88: shape::data<shape::cmp, shape::ptr_pair>::walk_tag1(shape::tag_info&) (rust_shape.h:1124)
==25913==    by 0x5879CA9: shape::ctxt<shape::data<shape::cmp, shape::ptr_pair> >::walk_tag0() (rust_shape.h:415)
==25913==    by 0x587A034: shape::ctxt<shape::data<shape::cmp, shape::ptr_pair> >::walk() (rust_shape.h:305)
==25913==    by 0x5876DC8: shape_cmp_type (rust_shape.cpp:494)
==25913==    by 0x588056C: ??? (in /home/sully/src/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib/librustrt.so)
==25913== 
==25913== Conditional jump or move depends on uninitialised value(s)
==25913==    at 0x5876330: shape::cmp::walk_res2(shape::rust_fn const*, unsigned char const*) (rust_shape.cpp:209)
==25913==    by 0x587A181: shape::ctxt<shape::data<shape::cmp, shape::ptr_pair> >::walk() (rust_shape.h:954)
==25913==    by 0x587A674: shape::data<shape::cmp, shape::ptr_pair>::walk_box_contents1() (rust_shape.cpp:188)
==25913==    by 0x587A6E4: shape::ctxt<shape::data<shape::cmp, shape::ptr_pair> >::walk_box0() (rust_shape.cpp:282)
==25913==    by 0x587A1EC: shape::ctxt<shape::data<shape::cmp, shape::ptr_pair> >::walk() (rust_shape.h:306)
==25913==    by 0x5876F30: shape::cmp::walk_variant2(shape::tag_info&, unsigned long, std::pair<unsigned char const*, unsigned char const*>) (rust_shape.cpp:371)
==25913==    by 0x5876FB7: shape::cmp::walk_tag2(shape::tag_info&, shape::data_pair<unsigned long> const&) (rust_shape.h:1010)
==25913==    by 0x5879B88: shape::data<shape::cmp, shape::ptr_pair>::walk_tag1(shape::tag_info&) (rust_shape.h:1124)
==25913==    by 0x5879CA9: shape::ctxt<shape::data<shape::cmp, shape::ptr_pair> >::walk_tag0() (rust_shape.h:415)
==25913==    by 0x587A034: shape::ctxt<shape::data<shape::cmp, shape::ptr_pair> >::walk() (rust_shape.h:305)
==25913==    by 0x5876DC8: shape_cmp_type (rust_shape.cpp:494)
==25913==    by 0x588056C: ??? (in /home/sully/src/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib/librustrt.so)
==25913== 

I am commenting out the call to the test_class function and putting in a FIXME that points to this bug.

Michael Sullivan
Collaborator

Oops. It was actually the test_port function causing the problems.

Tim Chevalier
Collaborator

I think I've narrowed down the problem to the code in trans that handles class constructors, which created an 8-bit field within a 64-bit struct field and left three uninitialized bytes (plus, my dodgy shape code for resources wasn't properly skipping over that field (the "drop field"), and was comparing it instead of the actual pointer to the object). Working on a fix.

For future reference, the --track-origins=yes flag to valgrind will actually pinpoint where the uninitialized value was created. Wish I'd known that before I wasted hours barking up the wrong tree :-D

Tim Chevalier
Collaborator

I've been working on this, but right now the cycle collector is crashing and I'm not sure I'm getting accurate information from gdb about where. Going to put it aside for a bit, but if someone who knows the RTS better wants to help...

Tim Chevalier
Collaborator

Since both shape glue and classes as we know them are supposedly going away, I'm calling this "postponed".

Tim Chevalier catamorphism closed this September 10, 2012
Tim Chevalier
Collaborator

I guess this is no longer relevant since comparison ops are now trait-based. binops.rs no longer has a test_port function. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.