Skip to content

[Exp PyROOT] Port to experimental the new teardown introduced in old PyROOT#4753

Merged
etejedor merged 2 commits intoroot-project:masterfrom
etejedor:pyteardown_exp
Jan 13, 2020
Merged

[Exp PyROOT] Port to experimental the new teardown introduced in old PyROOT#4753
etejedor merged 2 commits intoroot-project:masterfrom
etejedor:pyteardown_exp

Conversation

@etejedor
Copy link
Copy Markdown
Contributor

Port to PyROOT experimental the new teardown that was introduced in old PyROOT by:

#4687

@etejedor etejedor self-assigned this Jan 10, 2020
@phsft-bot
Copy link
Copy Markdown

Starting build on ROOT-performance-centos7-multicore/default, ROOT-fedora27/noimt, ROOT-fedora29/python3, ROOT-fedora30/cxx14, ROOT-ubuntu16/nortcxxmod, ROOT-ubuntu18.04-i386/cxx14, mac1014/cxx17, windows10/cxx14
How to customize builds

They were previously introduced in old PyROOT by 7e47c42.
In the previous implementation, a new C++ object was created for
the item being set and later registered together with the
Python proxy of the original item, but the original C++ object
was never destructed since the proxy was made non-owner.

This fix assigns the new C++ object to the proxy and registers
the new pair in the memory regulator, but it also unregisters the
old pair and deletes the old C++ object.
@phsft-bot
Copy link
Copy Markdown

Starting build on ROOT-performance-centos7-multicore/default, ROOT-fedora27/noimt, ROOT-fedora29/python3, ROOT-fedora30/cxx14, ROOT-ubuntu16/nortcxxmod, ROOT-ubuntu18.04-i386/cxx14, mac1014/cxx17, windows10/cxx14
How to customize builds

@etejedor
Copy link
Copy Markdown
Contributor Author

@phsft-bot build with-flags -Dpyroot_experimental=ON

@phsft-bot
Copy link
Copy Markdown

Starting build on ROOT-performance-centos7-multicore/default, ROOT-fedora27/noimt, ROOT-fedora29/python3, ROOT-fedora30/cxx14, ROOT-ubuntu16/nortcxxmod, ROOT-ubuntu18.04-i386/cxx14, mac1014/cxx17, windows10/cxx14
How to customize builds

@etejedor
Copy link
Copy Markdown
Contributor Author

@phsft-bot build with flags -Dpyroot_experimental=ON

@phsft-bot
Copy link
Copy Markdown

Starting build on ROOT-performance-centos7-multicore/default, ROOT-fedora27/noimt, ROOT-fedora29/python3, ROOT-fedora30/cxx14, ROOT-ubuntu16/nortcxxmod, ROOT-ubuntu18.04-i386/cxx14, mac1014/cxx17, windows10/cxx14 with flags -Dpyroot_experimental=ON
How to customize builds

@phsft-bot
Copy link
Copy Markdown

Build failed on mac1014/cxx17.
See console output.

Errors:

  • FAILED: bindings/pyroot_experimental/cppyy/CPyCppyy/CMakeFiles/cppyy.dir/src/CallContext.cxx.o
  • /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:534:5: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
  • /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:553:5: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
  • /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:575:5: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
  • /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:593:5: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
  • /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/stringobject.h:173:5: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
  • /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/stringobject.h:174:5: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
  • /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/stringobject.h:175:5: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
  • FAILED: bindings/pyroot_experimental/cppyy/CPyCppyy/CMakeFiles/cppyy.dir/src/CPPClassMethod.cxx.o
  • /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:534:5: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]

And 62 more

@phsft-bot
Copy link
Copy Markdown

Build failed on ROOT-fedora30/cxx14.
See console output.

Warnings:

  • /build/workspace/root-pullrequests-build/root/bindings/pyroot_experimental/pythonizations/src/PyROOTModule.cxx:87:57: warning: cast between incompatible function types from ‘PyObject* ()()’ {aka ‘_object ()()’} to ‘PyCFunction’ {aka ‘_object ()(_object, _object*)’} [-Wcast-function-type]

@phsft-bot
Copy link
Copy Markdown

Build failed on ROOT-fedora29/python3.
See console output.

Warnings:

  • /mnt/build/workspace/root-pullrequests-build/root/bindings/pyroot_experimental/pythonizations/src/PyROOTModule.cxx:87:57: warning: cast between incompatible function types from ‘PyObject* ()()’ {aka ‘_object ()()’} to ‘PyCFunction’ {aka ‘_object ()(_object, _object*)’} [-Wcast-function-type]

@phsft-bot
Copy link
Copy Markdown

Build failed on ROOT-ubuntu18.04-i386/cxx14.
See console output.

Errors:

  • /home/sftnight/build/workspace/root-pullrequests-build/root/bindings/pyroot_experimental/pythonizations/src/TTreePyz.cxx:93:61: error: invalid conversion from ‘long int*’ to ‘dims_t {aka int*}’ [-fpermissive]

Warnings:

  • /home/sftnight/build/workspace/root-pullrequests-build/root/bindings/pyroot_experimental/cppyy/CPyCppyy/src/Converters.cxx:547:88: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 3 has type ‘Py_ssize_t {aka int}’ [-Wformat=]
  • /home/sftnight/build/workspace/root-pullrequests-build/root/bindings/pyroot_experimental/cppyy/CPyCppyy/src/Converters.cxx:547:88: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 3 has type ‘Py_ssize_t {aka int}’ [-Wformat=]
  • /home/sftnight/build/workspace/root-pullrequests-build/root/bindings/pyroot_experimental/cppyy/CPyCppyy/src/CPPMethod.cxx:548:80: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘Py_ssize_t {aka int}’ [-Wformat=]
  • /home/sftnight/build/workspace/root-pullrequests-build/root/bindings/pyroot_experimental/cppyy/CPyCppyy/src/CPPMethod.cxx:548:80: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 3 has type ‘Py_ssize_t {aka int}’ [-Wformat=]
  • /home/sftnight/build/workspace/root-pullrequests-build/root/bindings/pyroot_experimental/cppyy/CPyCppyy/src/CPPMethod.cxx:552:72: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘Py_ssize_t {aka int}’ [-Wformat=]
  • /home/sftnight/build/workspace/root-pullrequests-build/root/bindings/pyroot_experimental/cppyy/CPyCppyy/src/CPPMethod.cxx:552:72: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 3 has type ‘Py_ssize_t {aka int}’ [-Wformat=]
  • /home/sftnight/build/workspace/root-pullrequests-build/root/bindings/pyroot_experimental/pythonizations/src/CppCallablePyz.cxx:290:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  • /home/sftnight/build/workspace/root-pullrequests-build/root/bindings/pyroot_experimental/pythonizations/src/RVecPyz.cxx:52:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

@phsft-bot
Copy link
Copy Markdown

Build failed on windows10/cxx14.
See console output.

@etejedor etejedor merged commit a8631ec into root-project:master Jan 13, 2020
etejedor added a commit to etejedor/root that referenced this pull request Jan 13, 2020
etejedor added a commit to etejedor/root that referenced this pull request Jan 13, 2020
etejedor added a commit to etejedor/root that referenced this pull request Jan 13, 2020
etejedor added a commit to etejedor/root that referenced this pull request Jan 13, 2020
etejedor added a commit that referenced this pull request Jan 13, 2020
etejedor added a commit that referenced this pull request Jan 13, 2020
etejedor added a commit that referenced this pull request Jan 13, 2020
rahulgrit pushed a commit to cburgard/root that referenced this pull request Mar 10, 2020
rahulgrit pushed a commit to cburgard/root that referenced this pull request Mar 10, 2020
rahulgrit pushed a commit to cburgard/root that referenced this pull request Mar 10, 2020
rahulgrit pushed a commit to cburgard/root that referenced this pull request Mar 10, 2020
guitargeek added a commit to guitargeek/root that referenced this pull request Oct 14, 2024
The old PyROOT (pre 2019) had a slightly different `atexit` handler than
the new one. The hard shutdown mode is different: `ClearProxiedObjects()`
is called before the final `gROOT->EndOfProcessCleanups()`.

I had the impresstion that this is redundant, and indeed the old PyROOT
didn't do it. This commit suggests to only call `ClearProxiedObjects()`
in soft shutdown mode, in an attempt to avoid the frequent crashes seen
at the end of PyROOT tutorials, especially on Ubuntu 24.10.

See also the original PRs where this functionality was introduced:

  * root-project#4687
  * root-project#4753
guitargeek added a commit to guitargeek/root that referenced this pull request Oct 14, 2024
The old PyROOT (pre 2019) had a slightly different `atexit` handler than
the new one. The hard shutdown mode is different: `ClearProxiedObjects()`
is called before the final `gROOT->EndOfProcessCleanups()`.

I had the impresstion that this is redundant, and indeed the old PyROOT
didn't do it. This commit suggests to only call `ClearProxiedObjects()`
in soft shutdown mode, in an attempt to avoid the frequent crashes seen
at the end of PyROOT tutorials, especially on Ubuntu 24.10.

See also the original PRs where this functionality was introduced:

  * root-project#4687
  * root-project#4753
guitargeek added a commit to guitargeek/root that referenced this pull request Oct 14, 2024
The old PyROOT (pre 2019) had a slightly different `atexit` handler than
the new one. The hard shutdown mode is different: `ClearProxiedObjects()`
is called before the final `gROOT->EndOfProcessCleanups()`.

I had the impresstion that this is redundant, and indeed the old PyROOT
didn't do it. This commit suggests to only call `ClearProxiedObjects()`
in soft shutdown mode, in an attempt to avoid the frequent crashes seen
at the end of PyROOT tutorials, especially on Ubuntu 24.10.

See also the original PRs where this functionality was introduced:

  * root-project#4687
  * root-project#4753
guitargeek added a commit to guitargeek/root that referenced this pull request Oct 14, 2024
The old PyROOT (pre 2019) had a slightly different `atexit` handler than
the new one. The hard shutdown mode is different: `ClearProxiedObjects()`
is called before the final `gROOT->EndOfProcessCleanups()`.

I had the impresstion that this is redundant, and indeed the old PyROOT
didn't do it. This commit suggests to only call `ClearProxiedObjects()`
in soft shutdown mode, in an attempt to avoid the frequent crashes seen
at the end of PyROOT tutorials, especially on Ubuntu 24.10.

See also the original PRs where this functionality was introduced:

  * root-project#4687
  * root-project#4753
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