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

Crash in glue_take #11285

Closed
kvark opened this issue Jan 3, 2014 · 4 comments
Closed

Crash in glue_take #11285

kvark opened this issue Jan 3, 2014 · 4 comments
Labels
I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.

Comments

@kvark
Copy link
Contributor

kvark commented Jan 3, 2014

Rust pre-0.9, ff578b7

Stack trace:

0x000000000040b69d in _$SP$u32::glue_take::ha9528aac1c857124aO ()
(gdb) bt
#0  0x000000000040b69d in _$SP$u32::glue_take::ha9528aac1c857124aO ()
#1  0x000000000043052a in battle..field..Limb::glue_take::h5e862c1d6a396a51ai ()
#2  0x000000000047cf21 in battle::field::Field::add_member_cells::h935ad8c60ad79045Qqao::v0.1 ()
#3  0x000000000047ef00 in battle::field::Field::add_member::hb5749aaf06ee2155Qqat::v0.1 ()
#4  0x0000000000496f34 in battle::main::Character::spawn::h82e7505c73a0d5dd4Oa6::v0.1 ()
#5  0x000000000040e640 in battle::main::Scene::reset::hd626571ec021c730rjax::v0.1 ()
#6  0x000000000040e56e in logic::Logic::reset::h81282f80bcbe4f5bJXaw::v0.1 ()
#7  0x000000000043ba0e in main::Game::create::hb678078392e73f06vka2::v0.1 ()
#8  0x000000000044cafa in main::main::anon::expr_fn::aU ()
#9  0x00007ffff6a70cc7 in start::hae390795887db9d1aP::v0.1 ()
   from /mnt/code/claymore/claymore-game/build/../lib/libglfw-b34bcc5c-0.1.so
#10 0x00000000004498cc in main::main::he53ab76229e9c10cal::v0.1 ()
#11 0x00007ffff741d2a8 in task::__extensions__::build_start_wrapper::anon::anon::expr_fn::aT ()
   from /mnt/code/claymore/claymore-game/build/../../../../../usr/local/lib/rustc/x86_64-unknown-linux-gnu/lib/libgreen-3b3a1962-0.9-pre.so
#12 0x00007ffff7765bb8 in rt::task::__extensions__::run::anon::expr_fn::az ()
   from /mnt/code/claymore/claymore-game/build/../../../../../usr/local/lib/rustc/x86_64-unknown-linux-gnu/lib/libstd-04ff901e-0.9-pre.so
#13 0x00007ffff776d06c in rust_try ()
   from /mnt/code/claymore/claymore-game/build/../../../../../usr/local/lib/rustc/x86_64-unknown-linux-gnu/lib/libstd-04ff901e-0.9-pre.so
#14 0x00007ffff776595d in rt::task::Task::run::hbc187b1d40f6340eoDav::v0.9.pre ()
   from /mnt/code/claymore/claymore-game/build/../../../../../usr/local/lib/rustc/x86_64-unknown-linux-gnu/lib/libstd-04ff901e-0.9-pre.so
#15 0x00007ffff741cccc in task::__extensions__::build_start_wrapper::anon::expr_fn::aC ()
   from /mnt/code/claymore/claymore-game/build/../../../../../usr/local/lib/rustc/x86_64-unknown-linux-gnu/lib/libgreen-3b3a1962-0.9-pre.so
#16 0x0000000000000000 in ?? ()

, Where Limb is defined as:

#[deriving(Clone)]
pub struct Limb {
    key     : LimbKey,
    health  : Health,
    node    : @mut engine::space::Node,
}

pub type MemberKey  = int;
pub type MemberLimb = (grid::Location,Limb);

, and the top-level function is:

    fn add_member_cells( &mut self, m_key: MemberKey, m_limbs: &[MemberLimb], grid: &grid::TopologyGrid )   {
        for &(pos,limb) in m_limbs.iter()   {
            grid.get_index(pos).map(|index| {
                match self.cells[index] {
                    CellEmpty   => self.cells[index] = CellPart( m_key,~[limb] ),
                    CellPart(mkey,ref mut limbs) if mkey==m_key => limbs.push(limb),
                    _   => assert!({let (ref kind,_) = limb.key; !kind.is_vital() }),
                };
            });
        }
    }

A self-contained test case is not available yet.

@kvark
Copy link
Contributor Author

kvark commented Jan 3, 2014

Happens whenever I try to destructurize m_limbs[i] second part (of type Limb). E.g. the following code works:

for i in range(0,m_limbs.len()) {
    let (pos,_) = m_limbs[i];
    //let (pos,limb) = m_limbs[i]; //crashes
    //let (pos, ref limb) = m_limbs[i]; //crashes

@steveklabnik
Copy link
Member

Is this issue still relevant? Without a self-contained case, I'm not sure we can figure this out.

@kvark
Copy link
Contributor Author

kvark commented Aug 12, 2014

Let's close this as "unable to reproduce", since that code base needs some effort to come online with the current rust, and I don't have time for it.

@kvark kvark closed this as completed Aug 12, 2014
@luqmana
Copy link
Member

luqmana commented Aug 13, 2014

I don't think this would resurface anyways since glue_take is gone.

matthiaskrgr pushed a commit to matthiaskrgr/rust that referenced this issue Mar 21, 2024
[`cast_lossless`]: Suggest type alias instead of the aliased type

Fixes rust-lang#11285

Still an issue with the "from" side, i.e., `I8::from(1) as I64` shows as `i8 to I64`, but this should be ok. Not possible to reliably fix currently anyway.

changelog: [`cast_lossless`]: Suggest type alias instead of the aliased type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
Projects
None yet
Development

No branches or pull requests

3 participants