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

Use NonNull in ReleasePool and add bench_dict #274

Merged
merged 3 commits into from
Nov 15, 2018

Conversation

kngwyu
Copy link
Member

@kngwyu kngwyu commented Nov 14, 2018

1st step to #271

Copy link
Member

@konstin konstin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test should use new(...).unwrap() instead of new_unchecked(...), otherwise 👍

@kngwyu
Copy link
Member Author

kngwyu commented Nov 15, 2018

@konstin
Travis fails with

running 5 tests
test binary_arithmetic ... ok
test inplace_operations ... FAILED
test rich_comparisons ... ok
test rich_comparisons_python_3_type_error ... ok
test unary_arithmetic ... ok
failures:
---- inplace_operations stdout ----
thread 'inplace_operations' panicked at 'attempt to subtract with overflow', tests/test_arithmetics.rs:76:9
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::_print
             at libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at libstd/sys_common/backtrace.rs:59
             at libstd/panicking.rs:211
   3: std::panicking::default_hook
             at libstd/panicking.rs:221
   4: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:476
   5: std::panicking::continue_panic_fmt
             at libstd/panicking.rs:390
   6: rust_begin_unwind
             at libstd/panicking.rs:325
   7: core::panicking::panic_fmt
             at libcore/panicking.rs:77
   8: core::panicking::panic
             at libcore/panicking.rs:52
   9: <test_arithmetics::InPlaceOperations as pyo3::class::number::PyNumberProtocol<'p>>::__isub__
             at tests/test_arithmetics.rs:76
  10: <T as pyo3::class::number::PyNumberISubProtocolImpl>::nb_inplace_subtract::wrap
             at ./src/class/macros.rs:153
  11: PyNumber_InPlaceSubtract
             at Objects/abstract.c:1054
             at Objects/abstract.c:1068
             at Objects/abstract.c:1087
  12: _PyEval_EvalFrameDefault
             at Python/ceval.c:1491
  13: _PyEval_EvalCodeWithName
             at Python/ceval.c:3971
  14: PyEval_EvalCodeEx
             at Python/ceval.c:4000
  15: PyEval_EvalCode
             at Python/ceval.c:522
  16: PyRun_StringFlags
             at Python/pythonrun.c:1035
             at Python/pythonrun.c:959
  17: pyo3::python::Python::run_code
             at src/python.rs:197
  18: pyo3::python::Python::run
             at src/python.rs:168
  19: test_arithmetics::inplace_operations::{{closure}}
             at tests/test_arithmetics.rs:118
  20: test_arithmetics::inplace_operations
             at tests/test_arithmetics.rs:122
  21: test_arithmetics::inplace_operations::{{closure}}
             at tests/test_arithmetics.rs:112
  22: core::ops::function::FnOnce::call_once
             at /rustc/6f93e93af6f823948cc13d2938957757c6486d88/src/libcore/ops/function.rs:238
  23: <F as alloc::boxed::FnBox<A>>::call_box
             at libtest/lib.rs:1471
             at /rustc/6f93e93af6f823948cc13d2938957757c6486d88/src/libcore/ops/function.rs:238
             at /rustc/6f93e93af6f823948cc13d2938957757c6486d88/src/liballoc/boxed.rs:673
  24: __rust_maybe_catch_panic
             at libpanic_unwind/lib.rs:102

But I can't reproduce this failure in my local machine.
Do you have any idea?

@konstin
Copy link
Member

konstin commented Nov 15, 2018

I broke the build because I didn't realize that (self.ptr as *mut u8) isn't the same as self.ptr when applying an offset. Should hopefully be fixed now.

@konstin konstin merged commit d618ca4 into PyO3:master Nov 15, 2018
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

Successfully merging this pull request may close these issues.

2 participants