Repository: pytorch
Issue: UBSAN failure in test_simple_model (__main__.TestTensorBoardNumpy): runtime error: call to function pybind11::class_<caffe2::GradientWrapper>::dealloc(pybind11::detail::value_and_holder&) through pointer to incorrect function type 'void (*)(pybind11::detail::value_and_holder &)'
Labels: module: tests,triaged

```
Jul 23 16:50:24 test_simple_model (__main__.TestTensorBoardNumpy) ... /var/lib/jenkins/workspace/torch/../third_party/pybind11/include/pybind11/detail/class.h:327:17: runtime error: call to function pybind11::class_<caffe2::GradientWrapper>::dealloc(pybind11::detail::value_and_holder&) through pointer to incorrect function type 'void (*)(pybind11::detail::value_and_holder &)'
Jul 23 16:50:24 (/opt/conda/lib/python3.6/site-packages/caffe2/python/caffe2_pybind11_state.cpython-36m-x86_64-linux-gnu.so+0x3a99f0): note: pybind11::class_<caffe2::GradientWrapper>::dealloc(pybind11::detail::value_and_holder&) defined here
Jul 23 16:50:24     #0 0x7f5fcda660a9 in pybind11::detail::clear_instance(_object*) (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_python.so+0xf5a0a9)
Jul 23 16:50:24     #1 0x7f5fcda46928 in pybind11_object_dealloc (/opt/conda/lib/python3.6/site-packages/torch/lib/libtorch_python.so+0xf3a928)
Jul 23 16:50:24     #2 0x55da3270f531 in list_dealloc /tmp/build/80754af9/python_1546130271559/work/Objects/listobject.c:326
Jul 23 16:50:24     #3 0x55da327df477 in _PyEval_EvalFrameDefault /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:1308
Jul 23 16:50:24     #4 0x55da327afbfd in _PyEval_EvalCodeWithName /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:4166
Jul 23 16:50:24     #5 0x55da327b0770 in fast_function /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:4992
Jul 23 16:50:24     #6 0x55da327b6504 in call_function /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:4872
Jul 23 16:50:24     #7 0x55da327db389 in _PyEval_EvalFrameDefault /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:3335
Jul 23 16:50:24     #8 0x55da327b053a in _PyFunction_FastCall /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:4933
Jul 23 16:50:24     #9 0x55da327b053a in fast_function /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:4968
Jul 23 16:50:24     #10 0x55da327b6504 in call_function /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:4872
Jul 23 16:50:24     #11 0x55da327db389 in _PyEval_EvalFrameDefault /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:3335
Jul 23 16:50:24     #12 0x55da327afbfd in _PyEval_EvalCodeWithName /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:4166
Jul 23 16:50:24     #13 0x55da327b0770 in fast_function /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:4992
Jul 23 16:50:24     #14 0x55da327b6504 in call_function /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:4872
Jul 23 16:50:24     #15 0x55da327db389 in _PyEval_EvalFrameDefault /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:3335
Jul 23 16:50:24     #16 0x55da327b053a in _PyFunction_FastCall /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:4933
Jul 23 16:50:24     #17 0x55da327b053a in fast_function /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:4968
Jul 23 16:50:24     #18 0x55da327b6504 in call_function /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:4872
Jul 23 16:50:24     #19 0x55da327db389 in _PyEval_EvalFrameDefault /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:3335
Jul 23 16:50:24     #20 0x55da327af8e3 in _PyEval_EvalCodeWithName /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:4166
Jul 23 16:50:24     #21 0x55da327b0770 in fast_function /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:4992
Jul 23 16:50:24     #22 0x55da327b6504 in call_function /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:4872
Jul 23 16:50:24     #23 0x55da327db389 in _PyEval_EvalFrameDefault /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:3335
Jul 23 16:50:24     #24 0x55da327af8e3 in _PyEval_EvalCodeWithName /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:4166
Jul 23 16:50:24     #25 0x55da327b0e69 in _PyFunction_FastCallDict /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:5084
Jul 23 16:50:24     #26 0x55da3272fb0e in _PyObject_FastCallDict /tmp/build/80754af9/python_1546130271559/work/Objects/abstract.c:2310
Jul 23 16:50:24     #27 0x55da327346a2 in _PyObject_Call_Prepend /tmp/build/80754af9/python_1546130271559/work/Objects/abstract.c:2373
Jul 23 16:50:24     #28 0x55da3272f54d in PyObject_Call /tmp/build/80754af9/python_1546130271559/work/Objects/abstract.c:2261
Jul 23 16:50:24     #29 0x55da327dca6b in do_call_core /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:5120
Jul 23 16:50:24     #30 0x55da327dca6b in _PyEval_EvalFrameDefault /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:3404
Jul 23 16:50:24     #31 0x55da327af8e3 in _PyEval_EvalCodeWithName /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:4166
Jul 23 16:50:24     #32 0x55da327b0770 in fast_function /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:4992
Jul 23 16:50:24     #33 0x55da327b6504 in call_function /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:4872
Jul 23 16:50:24     #34 0x55da327dc146 in _PyEval_EvalFrameDefault /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:3351
Jul 23 16:50:24     #35 0x55da327b053a in _PyFunction_FastCall /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:4933
Jul 23 16:50:24     #36 0x55da327b053a in fast_function /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:4968
Jul 23 16:50:24     #37 0x55da327b6504 in call_function /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:4872
Jul 23 16:50:24     #38 0x55da327db389 in _PyEval_EvalFrameDefault /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:3335
Jul 23 16:50:24     #39 0x55da327af8e3 in _PyEval_EvalCodeWithName /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:4166
Jul 23 16:50:24     #40 0x55da327b0e69 in _PyFunction_FastCallDict /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:5084
Jul 23 16:50:24     #41 0x55da3272fb0e in _PyObject_FastCallDict /tmp/build/80754af9/python_1546130271559/work/Objects/abstract.c:2310
Jul 23 16:50:24     #42 0x55da327346a2 in _PyObject_Call_Prepend /tmp/build/80754af9/python_1546130271559/work/Objects/abstract.c:2373
Jul 23 16:50:24     #43 0x55da3272f54d in PyObject_Call /tmp/build/80754af9/python_1546130271559/work/Objects/abstract.c:2261
Jul 23 16:50:24     #44 0x55da327dca6b in do_call_core /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:5120
Jul 23 16:50:24     #45 0x55da327dca6b in _PyEval_EvalFrameDefault /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:3404
Jul 23 16:50:24     #46 0x55da327af8e3 in _PyEval_EvalCodeWithName /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:4166
Jul 23 16:50:24     #47 0x55da327b0c4b in _PyFunction_FastCallDict /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:5084
Jul 23 16:50:24     #48 0x55da3272fb0e in _PyObject_FastCallDict /tmp/build/80754af9/python_1546130271559/work/Objects/abstract.c:2310
Jul 23 16:50:24     #49 0x55da327346a2 in _PyObject_Call_Prepend /tmp/build/80754af9/python_1546130271559/work/Objects/abstract.c:2373
Jul 23 16:50:24     #50 0x55da3272f54d in PyObject_Call /tmp/build/80754af9/python_1546130271559/work/Objects/abstract.c:2261
Jul 23 16:50:24     #51 0x55da32789a90 in slot_tp_call /tmp/build/80754af9/python_1546130271559/work/Objects/typeobject.c:6207
Jul 23 16:50:24     #52 0x55da3272f92a in _PyObject_FastCallDict /tmp/build/80754af9/python_1546130271559/work/Objects/abstract.c:2331
Jul 23 16:50:24     #53 0x55da327b657d in call_function /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:4875
Jul 23 16:50:24     #54 0x55da327db389 in _PyEval_EvalFrameDefault /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:3335
Jul 23 16:50:24     #55 0x55da327af8e3 in _PyEval_EvalCodeWithName /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:4166
Jul 23 16:50:24     #56 0x55da327b0e69 in _PyFunction_FastCallDict /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:5084
Jul 23 16:50:24     #57 0x55da3272fb0e in _PyObject_FastCallDict /tmp/build/80754af9/python_1546130271559/work/Objects/abstract.c:2310
Jul 23 16:50:24     #58 0x55da327346a2 in _PyObject_Call_Prepend /tmp/build/80754af9/python_1546130271559/work/Objects/abstract.c:2373
Jul 23 16:50:24     #59 0x55da3272f54d in PyObject_Call /tmp/build/80754af9/python_1546130271559/work/Objects/abstract.c:2261
Jul 23 16:50:24     #60 0x55da327dca6b in do_call_core /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:5120
Jul 23 16:50:24     #61 0x55da327dca6b in _PyEval_EvalFrameDefault /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:3404
Jul 23 16:50:24     #62 0x55da327af8e3 in _PyEval_EvalCodeWithName /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:4166
Jul 23 16:50:24     #63 0x55da327b0c4b in _PyFunction_FastCallDict /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:5084
Jul 23 16:50:24     #64 0x55da3272fb0e in _PyObject_FastCallDict /tmp/build/80754af9/python_1546130271559/work/Objects/abstract.c:2310
Jul 23 16:50:24     #65 0x55da327346a2 in _PyObject_Call_Prepend /tmp/build/80754af9/python_1546130271559/work/Objects/abstract.c:2373
Jul 23 16:50:24     #66 0x55da3272f54d in PyObject_Call /tmp/build/80754af9/python_1546130271559/work/Objects/abstract.c:2261
Jul 23 16:50:24     #67 0x55da32789a90 in slot_tp_call /tmp/build/80754af9/python_1546130271559/work/Objects/typeobject.c:6207
Jul 23 16:50:24     #68 0x55da3272f92a in _PyObject_FastCallDict /tmp/build/80754af9/python_1546130271559/work/Objects/abstract.c:2331
Jul 23 16:50:24     #69 0x55da327b657d in call_function /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:4875
Jul 23 16:50:24     #70 0x55da327db389 in _PyEval_EvalFrameDefault /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:3335
Jul 23 16:50:24     #71 0x55da327af8e3 in _PyEval_EvalCodeWithName /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:4166
Jul 23 16:50:24     #72 0x55da327b0e69 in _PyFunction_FastCallDict /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:5084
Jul 23 16:50:24     #73 0x55da3272fb0e in _PyObject_FastCallDict /tmp/build/80754af9/python_1546130271559/work/Objects/abstract.c:2310
Jul 23 16:50:24     #74 0x55da327346a2 in _PyObject_Call_Prepend /tmp/build/80754af9/python_1546130271559/work/Objects/abstract.c:2373
Jul 23 16:50:24     #75 0x55da3272f54d in PyObject_Call /tmp/build/80754af9/python_1546130271559/work/Objects/abstract.c:2261
Jul 23 16:50:24     #76 0x55da327dca6b in do_call_core /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:5120
Jul 23 16:50:24     #77 0x55da327dca6b in _PyEval_EvalFrameDefault /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:3404
Jul 23 16:50:24     #78 0x55da327af8e3 in _PyEval_EvalCodeWithName /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:4166
Jul 23 16:50:24     #79 0x55da327b0c4b in _PyFunction_FastCallDict /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:5084
Jul 23 16:50:24     #80 0x55da3272fb0e in _PyObject_FastCallDict /tmp/build/80754af9/python_1546130271559/work/Objects/abstract.c:2310
Jul 23 16:50:24     #81 0x55da327346a2 in _PyObject_Call_Prepend /tmp/build/80754af9/python_1546130271559/work/Objects/abstract.c:2373
Jul 23 16:50:24     #82 0x55da3272f54d in PyObject_Call /tmp/build/80754af9/python_1546130271559/work/Objects/abstract.c:2261
Jul 23 16:50:24     #83 0x55da32789a90 in slot_tp_call /tmp/build/80754af9/python_1546130271559/work/Objects/typeobject.c:6207
Jul 23 16:50:24     #84 0x55da3272f92a in _PyObject_FastCallDict /tmp/build/80754af9/python_1546130271559/work/Objects/abstract.c:2331
Jul 23 16:50:24     #85 0x55da327b657d in call_function /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:4875
Jul 23 16:50:24     #86 0x55da327db389 in _PyEval_EvalFrameDefault /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:3335
Jul 23 16:50:24     #87 0x55da327b053a in _PyFunction_FastCall /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:4933
Jul 23 16:50:24     #88 0x55da327b053a in fast_function /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:4968
Jul 23 16:50:24     #89 0x55da327b6504 in call_function /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:4872
Jul 23 16:50:24     #90 0x55da327db389 in _PyEval_EvalFrameDefault /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:3335
Jul 23 16:50:24     #91 0x55da327b053a in _PyFunction_FastCall /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:4933
Jul 23 16:50:24     #92 0x55da327b053a in fast_function /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:4968
Jul 23 16:50:24     #93 0x55da327b6504 in call_function /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:4872
Jul 23 16:50:24     #94 0x55da327db389 in _PyEval_EvalFrameDefault /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:3335
Jul 23 16:50:24     #95 0x55da327afd70 in _PyEval_EvalCodeWithName /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:4166
Jul 23 16:50:24     #96 0x55da327b0e69 in _PyFunction_FastCallDict /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:5084
Jul 23 16:50:24     #97 0x55da3272fb0e in _PyObject_FastCallDict /tmp/build/80754af9/python_1546130271559/work/Objects/abstract.c:2310
Jul 23 16:50:24     #98 0x55da327346a2 in _PyObject_Call_Prepend /tmp/build/80754af9/python_1546130271559/work/Objects/abstract.c:2373
Jul 23 16:50:24     #99 0x55da3272f54d in PyObject_Call /tmp/build/80754af9/python_1546130271559/work/Objects/abstract.c:2261
Jul 23 16:50:24     #100 0x55da327890fa in slot_tp_init /tmp/build/80754af9/python_1546130271559/work/Objects/typeobject.c:6420
Jul 23 16:50:24     #101 0x55da327b6766 in type_call /tmp/build/80754af9/python_1546130271559/work/Objects/typeobject.c:915
Jul 23 16:50:24     #102 0x55da3272f92a in _PyObject_FastCallDict /tmp/build/80754af9/python_1546130271559/work/Objects/abstract.c:2331
Jul 23 16:50:24     #103 0x55da327b0a59 in _PyObject_FastCallKeywords /tmp/build/80754af9/python_1546130271559/work/Objects/abstract.c:2496
Jul 23 16:50:24     #104 0x55da327b657d in call_function /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:4875
Jul 23 16:50:24     #105 0x55da327dc146 in _PyEval_EvalFrameDefault /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:3351
Jul 23 16:50:24     #106 0x55da327afbfd in _PyEval_EvalCodeWithName /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:4166
Jul 23 16:50:24     #107 0x55da327b0770 in fast_function /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:4992
Jul 23 16:50:24     #108 0x55da327b6504 in call_function /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:4872
Jul 23 16:50:24     #109 0x55da327db389 in _PyEval_EvalFrameDefault /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:3335
Jul 23 16:50:24     #110 0x55da327b1288 in _PyEval_EvalCodeWithName /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:4166
Jul 23 16:50:24     #111 0x55da327b1288 in PyEval_EvalCodeEx /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:4187
Jul 23 16:50:24     #112 0x55da327b201b in PyEval_EvalCode /tmp/build/80754af9/python_1546130271559/work/Python/ceval.c:731
Jul 23 16:50:24     #113 0x55da328343c3 in run_mod /tmp/build/80754af9/python_1546130271559/work/Python/pythonrun.c:1025
Jul 23 16:50:24     #114 0x55da328347c0 in PyRun_FileExFlags /tmp/build/80754af9/python_1546130271559/work/Python/pythonrun.c:978
Jul 23 16:50:24     #115 0x55da328349c2 in PyRun_SimpleFileExFlags /tmp/build/80754af9/python_1546130271559/work/Python/pythonrun.c:419
Jul 23 16:50:24     #116 0x55da328384b2 in run_file /tmp/build/80754af9/python_1546130271559/work/Modules/main.c:340
Jul 23 16:50:24     #117 0x55da328384b2 in Py_Main /tmp/build/80754af9/python_1546130271559/work/Modules/main.c:811
Jul 23 16:50:24     #118 0x55da3270102d in main /tmp/build/80754af9/python_1546130271559/work/Programs/python.c:69
Jul 23 16:50:24     #119 0x7f5fe181c82f in __libc_start_main /build/glibc-LK5gWL/glibc-2.23/csu/../csu/libc-start.c:291
Jul 23 16:50:24     #120 0x55da327e1e0d in _start /home/rdonnelly/mc/conda-bld/compilers_linux-64_1534865402226/work/.build/src/glibc-2.12.2/csu/../sysdeps/x86_64/elf/start.S:103
Jul 23 16:50:24 
Jul 23 16:50:24 SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /var/lib/jenkins/workspace/torch/../third_party/pybind11/include/pybind11/detail/class.h:327:17 in 
```

full log: https://circleci.com/gh/pytorch/pytorch/2255328?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link