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

Binding a single-variant nullary tag does not work #1034

Closed
brson opened this issue Oct 12, 2011 · 1 comment
Closed

Binding a single-variant nullary tag does not work #1034

brson opened this issue Oct 12, 2011 · 1 comment

Comments

@brson
Copy link
Contributor

brson commented Oct 12, 2011

tag chan {
    chan_t;
}

fn wrapper3(i: chan) {
    log_err i;
}

fn main() {
    let wrapped = bind wrapper3(chan_t);                                                                                                                       
    wrapped();
}
==6782== Thread 5:
==6782== Use of uninitialised value of size 4
==6782==    at 0x6E9F24E: ??? (in /usr/lib32/libstdc++.so.6.0.14)
==6782==    by 0x6E9F383: std::ostreambuf_iterator<char, std::char_traits<char> > std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >:
:_M_insert_int<unsigned long>(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, unsigned long) const (in /usr/lib32/libstdc++.so.6
.0.14)
==6782==    by 0x6E9F6CC: std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >::do_put(std::ostreambuf_iterator<char, std::char_traits<
char> >, std::ios_base&, char, unsigned long) const (in /usr/lib32/libstdc++.so.6.0.14)
==6782==    by 0x6EAAF78: std::ostream& std::ostream::_M_insert<unsigned long>(unsigned long) (in /usr/lib32/libstdc++.so.6.0.14)
==6782==    by 0x4954932: shape::ctxt<shape::data<shape::log, shape::ptr> >::walk() (ostream:195)
==6782==    by 0x495331D: upcall_log_type (rust_shape.cpp:568)
==6782==    by 0x80488AD: wrapper3::_bbd77563ebb906ad (in /home/banderson/Dev/rust/build/test/run-pass/bind-generic-2.stage1)
==6782==    by 0x8048AE3: main::thunk7 (in /home/banderson/Dev/rust/build/test/run-pass/bind-generic-2.stage1)
==6782==    by 0x8048948: main::_39837a48639a8d6b (in /home/banderson/Dev/rust/build/test/run-pass/bind-generic-2.stage1)
==6782==    by 0x8048A37: _rust_main (in /home/banderson/Dev/rust/build/test/run-pass/bind-generic-2.stage1)
==6782==    by 0x8048D8B: _rust_main_wrap (in /home/banderson/Dev/rust/build/test/run-pass/bind-generic-2.stage1)
==6782==    by 0xDEADBEEE: ???
==6782==
==6782== Conditional jump or move depends on uninitialised value(s)
==6782==    at 0x6E9F257: ??? (in /usr/lib32/libstdc++.so.6.0.14)
==6782==    by 0x6E9F383: std::ostreambuf_iterator<char, std::char_traits<char> > std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >::_M_insert_int<unsigned long>(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, unsigned long) const (in /usr/lib32/libstdc++.so.6.0.14)
==6782==    by 0x6E9F6CC: std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >::do_put(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, unsigned long) const (in /usr/lib32/libstdc++.so.6.0.14)
==6782==    by 0x6EAAF78: std::ostream& std::ostream::_M_insert<unsigned long>(unsigned long) (in /usr/lib32/libstdc++.so.6.0.14)
==6782==    by 0x4954932: shape::ctxt<shape::data<shape::log, shape::ptr> >::walk() (ostream:195)
==6782==    by 0x495331D: upcall_log_type (rust_shape.cpp:568)
==6782==    by 0x80488AD: wrapper3::_bbd77563ebb906ad (in /home/banderson/Dev/rust/build/test/run-pass/bind-generic-2.stage1)
==6782==    by 0x8048AE3: main::thunk7 (in /home/banderson/Dev/rust/build/test/run-pass/bind-generic-2.stage1)
==6782==    by 0x8048948: main::_39837a48639a8d6b (in /home/banderson/Dev/rust/build/test/run-pass/bind-generic-2.stage1)
==6782==    by 0x8048A37: _rust_main (in /home/banderson/Dev/rust/build/test/run-pass/bind-generic-2.stage1)
==6782==    by 0x8048D8B: _rust_main_wrap (in /home/banderson/Dev/rust/build/test/run-pass/bind-generic-2.stage1)
==6782==    by 0xDEADBEEE: ???
==6782==
@brson
Copy link
Contributor Author

brson commented Oct 12, 2011

Interestingly, if you assign i to another variable then that variable can be used just fine.

celinval added a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
For debug purpose, kani-compiler can now generate json files that are
more human friendly.

By default this is disabled, since computers don't care about pretty
printing and it takes a lot of space.

Co-authored-by: Zyad Hassan <[email protected]>
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

2 participants