mozilla/rust — Issue #1535: Crash in shape code during tag comparison
Author: brson
Created: 2012-01-16 05:03:04+00:00
State: open
Labels: bug, rt, segv, trans, unassigned

The second comparison crashes. Probably due to weird alignment.

```
tag modlist = [int];

fn main() {
let ml = modlist([]);
assert ml == modlist([]);
assert ml == modlist([]);
}
```

```
==27842== Thread 2:
==27842== Invalid read of size 8
==27842== at 0x50FA892: shape::ctxt >::walk_vec0() (rust_shape.h:964)
==27842== by 0x50FA084: shape::ctxt >::walk() (rust_shape.h:372)
==27842== by 0x50F6879: shape::cmp::walk_variant2(shape::tag_info&, unsigned long, std::pair) (rust_shape.cpp:423)
==27842== by 0x50F6914: shape::cmp::walk_tag2(shape::tag_info&, shape::data_pair const&) (rust_shape.h:955)
==27842== by 0x50F98E5: shape::data::walk_tag1(shape::tag_info&) (rust_shape.h:993)
==27842== by 0x50F9A8C: shape::ctxt >::walk_tag0() (rust_shape.h:468)
==27842== by 0x50F9F6C: shape::ctxt >::walk() (rust_shape.h:373)
==27842== by 0x50F6732: shape_cmp_type (rust_shape.cpp:542)
==27842== by 0x5101E48: ??? (in /home/brian/dev/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib/librustrt.so)
==27842== by 0x64A06AF: ???
==27842== by 0x64A5FEF: ???
==27842== by 0x533482F: ??? (in /home/brian/dev/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib/librustrt.so)
==27842== Address 0x100000000064ac1 is not stack'd, malloc'd or (recently) free'd
```