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

Some doc tests failures in src/api/context.rs #1987

Closed
eclipseo opened this issue Dec 21, 2019 · 4 comments
Closed

Some doc tests failures in src/api/context.rs #1987

eclipseo opened this issue Dec 21, 2019 · 4 comments

Comments

@eclipseo
Copy link
Contributor

eclipseo commented Dec 21, 2019

Rust 1.40 on x86_64 with all features enabled:

running 6 tests
test src/api/context.rs - api::context::Context<T>::new_frame (line 39) ... ok
test src/api/config.rs - api::config::Config::new_context (line 624) ... ok
test src/api/context.rs - api::context::Context<T>::receive_packet (line 184) ... FAILED
test src/api/context.rs - api::context::Context<T>::receive_packet (line 209) ... FAILED
test src/lib.rs - version (line 163) ... ok
test src/api/context.rs - api::context::Context<T>::send_frame (line 72) ... FAILED

failures:

---- src/api/context.rs - api::context::Context<T>::receive_packet (line 184) stdout ----
Test executable failed (terminated by signal).

---- src/api/context.rs - api::context::Context<T>::receive_packet (line 209) stdout ----
Test executable failed (terminated by signal).

---- src/api/context.rs - api::context::Context<T>::send_frame (line 72) stdout ----
Test executable failed (terminated by signal).


failures:
    src/api/context.rs - api::context::Context<T>::receive_packet (line 184)
    src/api/context.rs - api::context::Context<T>::receive_packet (line 209)
    src/api/context.rs - api::context::Context<T>::send_frame (line 72)

test result: FAILED. 3 passed; 3 failed; 0 ignored; 0 measured; 0 filtered out

Even if I ignore the tests, the process segfault:
process didn't exit successfully:/builddir/build/BUILD/rav1e-0.2.0/target/release/deps/rav1e-390ad111173cb1f6 --skip 'api::context::Context::receive_packet' --skip 'api::context::Context::send_frame' (signal: 11, SIGSEGV: invalid memory reference)

(lldb) bt
* thread #27, name = 'api::test::flus', stop reason = signal SIGSEGV: invalid address (fault address: 0x10)
    frame #0: 0x00007ffff778fe74 libpthread.so.0`__GI___pthread_mutex_lock + 4
    frame #1: 0x00005555557e8693 rav1e-76cb4f8afe1b5a60`ht_mutex_lock + 19
    frame #2: 0x00005555557e8731 rav1e-76cb4f8afe1b5a60`ht_registry_find_listener_container + 65
    frame #3: 0x00005555557e90c4 rav1e-76cb4f8afe1b5a60`ht_find_or_create_listener + 20
    frame #4: 0x00005555557e8d84 rav1e-76cb4f8afe1b5a60`ht_timeline_create + 84
    frame #5: 0x00005555557e85e8 rav1e-76cb4f8afe1b5a60`ht_global_timeline_get + 88
    frame #6: 0x00005555557e818a rav1e-76cb4f8afe1b5a60`rust_hawktracer_sys::internals::scoped_tracepoint::add_cached_mapping::hb3fff368fcee073f(name="send_frame") at scoped_tracepoint.rs:29:45
    frame #7: 0x0000555555785392 rav1e-76cb4f8afe1b5a60`rav1e::api::internal::ContextInner$LT$T$GT$::send_frame::he7b950c23772c786 + 82
    frame #8: 0x0000555555768075 rav1e-76cb4f8afe1b5a60`rav1e::api::test::flush_unlimited::h34163ce2d2b694eb + 421
    frame #9: 0x00005555557f40bf rav1e-76cb4f8afe1b5a60`_$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::hc4e9a5e51ecfbb50 + 63
    frame #10: 0x0000555555846f6a rav1e-76cb4f8afe1b5a60`__rust_maybe_catch_panic + 26
  * frame #11: 0x000055555580e8d5 rav1e-76cb4f8afe1b5a60`test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h7297dc3d4dfbd406 + 277
    frame #12: 0x00005555557e9975 rav1e-76cb4f8afe1b5a60`std::sys_common::backtrace::__rust_begin_short_backtrace::hedc93fd720d98d39 + 85
    frame #13: 0x00005555557edb05 rav1e-76cb4f8afe1b5a60`std::panicking::try::do_call::he38648d2de10e061 + 85
    frame #14: 0x0000555555846f6a rav1e-76cb4f8afe1b5a60`__rust_maybe_catch_panic + 26
    frame #15: 0x00005555557ee022 rav1e-76cb4f8afe1b5a60`core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::h297d3709f1fa9c84 + 194
    frame #16: 0x000055555583991f rav1e-76cb4f8afe1b5a60`_$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h119df384485e079d + 63
    frame #17: 0x0000555555846350 rav1e-76cb4f8afe1b5a60`std::sys::unix::thread::Thread::new::thread_start::ha7e8e0c43366c502 + 144
    frame #18: 0x00007ffff778d4e2 libpthread.so.0`start_thread + 226
    frame #19: 0x00007ffff76a0693 libc.so.6`__GI___clone + 67
@eclipseo
Copy link
Contributor Author

With default features, everything works fine:

running 6 tests
test src/api/config.rs - api::config::Config::new_context (line 624) ... ok^O$<2>
test src/api/context.rs - api::context::Context<T>::new_frame (line 39) ... ok^O$<2>
test src/api/context.rs - api::context::Context<T>::receive_packet (line 209) ... ok^O$<2>
test src/api/context.rs - api::context::Context<T>::send_frame (line 72) ... ok^O$<2>
test src/lib.rs - version (line 163) ... ok^O$<2>
test src/api/context.rs - api::context::Context<T>::receive_packet (line 184) ... ok^O$<2>

test result: ok^O$<2>. 6 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

@eclipseo
Copy link
Contributor Author

eclipseo commented Dec 22, 2019

Got more error info:

running 6 tests
test src/lib.rs - version (line 163) ... ok
test src/api/config.rs - api::config::Config::new_context (line 624) ... ok
test src/api/context.rs - api::context::Context<T>::new_frame (line 39) ... ok
test src/api/context.rs - api::context::Context<T>::send_frame (line 72) ... FAILED
test src/api/context.rs - api::context::Context<T>::receive_packet (line 209) ... FAILED
test src/api/context.rs - api::context::Context<T>::receive_packet (line 184) ... FAILED

failures:

---- src/api/context.rs - api::context::Context<T>::send_frame (line 72) stdout ----
Test executable failed (exit code 101).

stderr:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Custom { kind: InvalidInput, error: "Unsupported image format image/\"png\"" }', src/libcore/result.rs:1165:5
stack backtrace:
   0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
   1: core::fmt::write
   2: std::io::Write::write_fmt
   3: std::panicking::default_hook::{{closure}}
   4: std::panicking::default_hook
   5: std::panicking::rust_panic_with_hook
   6: std::panicking::continue_panic_fmt
   7: rust_begin_unwind
   8: core::panicking::panic_fmt
   9: core::result::unwrap_failed
  10: core::result::Result<T,E>::unwrap
  11: rav1e::api::internal::ContextInner<T>::compute_lookahead_motion_vectors
  12: rav1e::api::internal::ContextInner<T>::compute_frame_invariants
  13: rav1e::api::internal::ContextInner<T>::send_frame
  14: rav1e::api::context::Context<T>::send_frame
  15: rust_out::main
  16: std::rt::lang_start::{{closure}}
  17: std::panicking::try::do_call
  18: __rust_maybe_catch_panic
  19: std::rt::lang_start_internal
  20: std::rt::lang_start
  21: main
  22: __libc_start_main
  23: _start
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.


---- src/api/context.rs - api::context::Context<T>::receive_packet (line 209) stdout ----
Test executable failed (exit code 101).

stderr:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Custom { kind: InvalidInput, error: "Unsupported image format image/\"png\"" }', src/libcore/result.rs:1165:5
stack backtrace:
   0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
   1: core::fmt::write
   2: std::io::Write::write_fmt
   3: std::panicking::default_hook::{{closure}}
   4: std::panicking::default_hook
   5: std::panicking::rust_panic_with_hook
   6: std::panicking::continue_panic_fmt
   7: rust_begin_unwind
   8: core::panicking::panic_fmt
   9: core::result::unwrap_failed
  10: core::result::Result<T,E>::unwrap
  11: rav1e::api::internal::ContextInner<T>::compute_lookahead_motion_vectors
  12: rav1e::api::internal::ContextInner<T>::compute_frame_invariants
  13: rav1e::api::internal::ContextInner<T>::send_frame
  14: rav1e::api::context::Context<T>::send_frame
  15: rust_out::encode_frames
  16: rust_out::main
  17: std::rt::lang_start::{{closure}}
  18: std::panicking::try::do_call
  19: __rust_maybe_catch_panic
  20: std::rt::lang_start_internal
  21: std::rt::lang_start
  22: main
  23: __libc_start_main
  24: _start
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.


---- src/api/context.rs - api::context::Context<T>::receive_packet (line 184) stdout ----
Test executable failed (exit code 101).

stderr:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Custom { kind: InvalidInput, error: "Unsupported image format image/\"png\"" }', src/libcore/result.rs:1165:5
stack backtrace:
   0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
   1: core::fmt::write
   2: std::io::Write::write_fmt
   3: std::panicking::default_hook::{{closure}}
   4: std::panicking::default_hook
   5: std::panicking::rust_panic_with_hook
   6: std::panicking::continue_panic_fmt
   7: rust_begin_unwind
   8: core::panicking::panic_fmt
   9: core::result::unwrap_failed
  10: core::result::Result<T,E>::unwrap
  11: rav1e::api::internal::ContextInner<T>::compute_lookahead_motion_vectors
  12: rav1e::api::internal::ContextInner<T>::compute_frame_invariants
  13: rav1e::api::internal::ContextInner<T>::send_frame
  14: rav1e::api::context::Context<T>::send_frame
  15: rav1e::api::context::Context<T>::flush
  16: rust_out::main
  17: std::rt::lang_start::{{closure}}
  18: std::panicking::try::do_call
  19: __rust_maybe_catch_panic
  20: std::rt::lang_start_internal
  21: std::rt::lang_start
  22: main
  23: __libc_start_main
  24: _start
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.



failures:
    src/api/context.rs - api::context::Context<T>::receive_packet (line 184)
    src/api/context.rs - api::context::Context<T>::receive_packet (line 209)
    src/api/context.rs - api::context::Context<T>::send_frame (line 72)

test result: FAILED. 3 passed; 3 failed; 0 ignored; 0 measured; 0 filtered out

Disabling image and dump_lookahead_data fixes it.

@eclipseo
Copy link
Contributor Author

eclipseo commented Dec 22, 2019

It seems the image feature for PNG should be "png_codec" not "png":

[dependencies.image]
version = "0.22.1"
features = ["png_codec"]
optional = true
default-features = false

This solves the first issue, however only with tracing and rust_hawktracer disabled. With it enabled the process segfaults:

Process 323750 launched: '/home/bob/packaging/rust-rav1e/rav1e-0.2.0/target/release/deps/rav1e-9925c27b9dcd37c9' (x86_64)
warning: (x86_64) /lib64/libstdc++.so.6 unsupported DW_FORM values: 0x1f20 0x1f21
warning: (x86_64) /lib64/libdav1d.so.3 unsupported DW_FORM values: 0x1f20 0x1f21
warning: (x86_64) /lib64/libgcc_s.so.1 unsupported DW_FORM values: 0x1f20 0x1f21

running 366 tests
Process 323750 stopped
* thread #19, name = 'api::test::flus', stop reason = signal SIGSEGV: invalid address (fault address: 0x10)
    frame #0: 0x00007ffff778fe74 libpthread.so.0`__GI___pthread_mutex_lock + 4
libpthread.so.0`__GI___pthread_mutex_lock:
->  0x7ffff778fe74 <+4>:  movl   0x10(%rdi), %eax
    0x7ffff778fe77 <+7>:  movl   %eax, %edx
    0x7ffff778fe79 <+9>:  andl   $0x17f, %edx              ; imm = 0x17F 
    0x7ffff778fe7f <+15>: nop    
  thread #22, name = 'api::test::flus', stop reason = signal SIGSEGV: invalid address (fault address: 0x10)
    frame #0: 0x00007ffff778fe74 libpthread.so.0`__GI___pthread_mutex_lock + 4
libpthread.so.0`__GI___pthread_mutex_lock:
->  0x7ffff778fe74 <+4>:  movl   0x10(%rdi), %eax
    0x7ffff778fe77 <+7>:  movl   %eax, %edx
    0x7ffff778fe79 <+9>:  andl   $0x17f, %edx              ; imm = 0x17F 
    0x7ffff778fe7f <+15>: nop    
(lldb) bt
* thread #19, name = 'api::test::flus', stop reason = signal SIGSEGV: invalid address (fault address: 0x10)
  * frame #0: 0x00007ffff778fe74 libpthread.so.0`__GI___pthread_mutex_lock + 4
    frame #1: 0x00005555557f5ed3 rav1e-9925c27b9dcd37c9`ht_mutex_lock + 19
    frame #2: 0x00005555557f5f71 rav1e-9925c27b9dcd37c9`ht_registry_find_listener_container + 65
    frame #3: 0x00005555557f6904 rav1e-9925c27b9dcd37c9`ht_find_or_create_listener + 20
    frame #4: 0x00005555557f65c4 rav1e-9925c27b9dcd37c9`ht_timeline_create + 84
    frame #5: 0x00005555557f5e28 rav1e-9925c27b9dcd37c9`ht_global_timeline_get + 88
    frame #6: 0x00005555557f59ca rav1e-9925c27b9dcd37c9`rust_hawktracer_sys::internals::scoped_tracepoint::add_cached_mapping::hb3fff368fcee073f(name="send_frame") at scoped_tracepoint.rs:29:45
    frame #7: 0x0000555555786382 rav1e-9925c27b9dcd37c9`rav1e::api::internal::ContextInner$LT$T$GT$::send_frame::h479d2e63863cba85 + 82
    frame #8: 0x0000555555769065 rav1e-9925c27b9dcd37c9`rav1e::api::test::flush_unlimited::hed3bc26f97cde254 + 421
    frame #9: 0x00005555558018ff rav1e-9925c27b9dcd37c9`_$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::hc4e9a5e51ecfbb50 + 63
    frame #10: 0x000055555585492a rav1e-9925c27b9dcd37c9`__rust_maybe_catch_panic + 26
    frame #11: 0x000055555581c115 rav1e-9925c27b9dcd37c9`test::run_test::run_test_inner::_$u7b$$u7b$closure$u7d$$u7d$::h7297dc3d4dfbd406 + 277
    frame #12: 0x00005555557f71b5 rav1e-9925c27b9dcd37c9`std::sys_common::backtrace::__rust_begin_short_backtrace::hedc93fd720d98d39 + 85
    frame #13: 0x00005555557fb345 rav1e-9925c27b9dcd37c9`std::panicking::try::do_call::he38648d2de10e061 + 85
    frame #14: 0x000055555585492a rav1e-9925c27b9dcd37c9`__rust_maybe_catch_panic + 26
    frame #15: 0x00005555557fb862 rav1e-9925c27b9dcd37c9`core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::h297d3709f1fa9c84 + 194
    frame #16: 0x000055555584715f rav1e-9925c27b9dcd37c9`_$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::h119df384485e079d + 63
    frame #17: 0x0000555555853d10 rav1e-9925c27b9dcd37c9`std::sys::unix::thread::Thread::new::thread_start::ha7e8e0c43366c502 + 144
    frame #18: 0x00007ffff778d4e2 libpthread.so.0`start_thread + 226
    frame #19: 0x00007ffff76a0693 libc.so.6`__GI___clone + 67

@lu-zero
Copy link
Collaborator

lu-zero commented Dec 22, 2019

ht needs its setup, I guess the easiest is to disable it when we are testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants