Skip to content

Conditional jump or move depends on uninitialized value in rustc #374

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

Closed
brson opened this issue May 14, 2011 · 1 comment
Closed

Conditional jump or move depends on uninitialized value in rustc #374

brson opened this issue May 14, 2011 · 1 comment

Comments

@brson
Copy link
Contributor

brson commented May 14, 2011

Running make stage2/std.o VALGRIND_COMPILE=1 on Linux reports the following:

==15459== Conditional jump or move depends on uninitialised value(s)
==15459==    at 0x80DA7CD: _rust_fn960_middle_ty_ty_to_str (in /home/brian/Dev/rust/build/stage1/rustc)
==15459==    by 0x8072DA6: _rust_fn730_middle_trans_make_scalar_cmp_glue (in /home/brian/Dev/rust/build/stage1/rustc)
==15459==    by 0x80709E0: _rust_fn728_middle_trans_make_cmp_glue (in /home/brian/Dev/rust/build/stage1/rustc)
==15459==    by 0x806C938: _rust_fn715_middle_trans_make_generic_glue (in /home/brian/Dev/rust/build/stage1/rustc)
==15459==    by 0x807CA3E: _rust_fn747_middle_trans_lazily_emit_tydesc_glue (in /home/brian/Dev/rust/build/stage1/rustc)
==15459==    by 0x807E196: _rust_fn751_middle_trans_call_cmp_glue (in /home/brian/Dev/rust/build/stage1/rustc)
==15459==    by 0x8072603: _rust_fn729_middle_trans_make_cmp_glue_inner (in /home/brian/Dev/rust/build/stage1/rustc)
==15459==    by 0x83651CE: _rust_thunk3515_middle_trans_make_cmp_glue (in /home/brian/Dev/rust/build/stage1/rustc)
==15459==    by 0x807584E: _rust_fn738_middle_trans_iter_structural_ty_full (in /home/brian/Dev/rust/build/stage1/rustc)
==15459==    by 0x807163C: _rust_fn728_middle_trans_make_cmp_glue (in /home/brian/Dev/rust/build/stage1/rustc)
==15459==    by 0x806C938: _rust_fn715_middle_trans_make_generic_glue (in /home/brian/Dev/rust/build/stage1/rustc)
==15459==    by 0x807CA3E: _rust_fn747_middle_trans_lazily_emit_tydesc_glue (in /home/brian/Dev/rust/build/stage1/rustc)

I believe this test case reproduces the issue although the error manifests in a different way (it reproduces something!):

use std;
import std::option;
import std::option::none;

tag sty {
    ty_nil;
}

type raw_t = rec(sty struct,
                 option::t[str] cname,
                 uint hash);

fn mk_raw_ty(sty st, &option::t[str] cname) -> raw_t {
  ret rec(struct=st,
          cname=cname,
          hash=0u);
}

fn main() {
  mk_raw_ty(ty_nil, none[str]);
}

On the test case valgrind reports:

==15590== Conditional jump or move depends on uninitialised value(s)
==15590==    at 0x80496C3: _rust_fn1_mk_raw_ty (in /home/brian/Dev/rust/build/test/run-pass/compare.stage1)
==15590==    by 0x8049743: _rust_fn2_main (in /home/brian/Dev/rust/build/test/run-pass/compare.stage1)
==15590==    by 0x804945E: rust_exit_task_glue (in /home/brian/Dev/rust/build/test/run-pass/compare.stage1)

It seems to be related to the alias parameter, but changing just about anything in the test case makes the bug go into hiding.

@brson
Copy link
Contributor Author

brson commented May 14, 2011

Checked in the test case as run-pass/alias-uninit-value.rs in ec30c71

@brson brson closed this as completed in d7d3871 May 22, 2011
Aaron1011 pushed a commit to Aaron1011/rust that referenced this issue Oct 26, 2020
ZuseZ4 pushed a commit to EnzymeAD/rust that referenced this issue Mar 7, 2023
antoyo added a commit to antoyo/rust that referenced this issue Nov 19, 2023
Do not emit .eh_frame section if using -Cpanic=abort
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant