-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[v638] Backport of recent Python and RooFit fixes #20691
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
Merged
Merged
+26
−105
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The `setattr` function requires three arguments, not two. Forgetting the `gbl` variable for which the attribute should be set resulted in pretty nonsensical code, which tried to set attributes of string literals. Maybe this was the result of the nighly failure on Fedora 42, where no ROOT/cppyy was in the stack trace at all. The `_PyErr_SetString` clearly told us that the crash happens in the formatting of the error message of some of the expected exceptions. So the call to `setattr` that is invalid for two reasons (wrong number of args, trying to set attribute of immutable string literal) is my best guess. ```txt 381/3712 Test root-project#1851: roottest-python-basic-datatype ....................................................................***Failed 7.54 sec Info in <TUnixSystem::ACLiC>: creating shared library /github/home/ROOT-CI/build/roottest/python/basic/./DataTypes_C.so -- TEST COMMAND -- cd /github/home/ROOT-CI/build/roottest/python/basic /usr/sbin/timeout -s USR2 270s /py-venv/ROOT-CI/bin/python3.13 /github/home/ROOT-CI/src/roottest/python/basic/PyROOT_datatypetest.py --fixcling -- BEGIN TEST OUTPUT -- ============================= test session starts ============================== platform linux -- Python 3.13.9, pytest-9.0.2, pluggy-1.6.0 rootdir: /github/home/ROOT-CI/src configfile: pyproject.toml plugins: anyio-4.12.0 collected 24 items ../../../../src/roottest/python/basic/PyROOT_datatypetest.py ........... [ 45%] ....... *** Break *** segmentation violation Generating stack trace... 0x00007f1e372498b7 in _PyErr_SetString + 0x47 from /lib64/libpython3.13.so.1.0 0x00007f1e370c06da in <unknown> from /lib64/libpython3.13.so.1.0 0x00007f1e371d37ff in _PyEval_EvalFrameDefault + 0x441f from /lib64/libpython3.13.so.1.0 0x00007f1e372bf359 in <unknown> from /lib64/libpython3.13.so.1.0 0x00007f1e37320c37 in <unknown> from /lib64/libpython3.13.so.1.0 0x00007f1e371d41b5 in _PyEval_EvalFrameDefault + 0x4dd5 from /lib64/libpython3.13.so.1.0 0x00007f1e372a88c4 in <unknown> from /lib64/libpython3.13.so.1.0 0x00007f1e372f9b49 in <unknown> from /lib64/libpython3.13.so.1.0 0x00007f1e371bdcbc in _PyObject_MakeTpCall + 0x2ac from /lib64/libpython3.13.so.1.0 0x00007f1e371d955a in _PyEval_EvalFrameDefault + 0xa17a from /lib64/libpython3.13.so.1.0 0x00007f1e372a88c4 in <unknown> from /lib64/libpython3.13.so.1.0 0x00007f1e372f9b49 in <unknown> from /lib64/libpython3.13.so.1.0 0x00007f1e371bdcbc in _PyObject_MakeTpCall + 0x2ac from /lib64/libpython3.13.so.1.0 0x00007f1e371d955a in _PyEval_EvalFrameDefault + 0xa17a from /lib64/libpython3.13.so.1.0 0x00007f1e372a88c4 in <unknown> from /lib64/libpython3.13.so.1.0 0x00007f1e372f9b49 in <unknown> from /lib64/libpython3.13.so.1.0 0x00007f1e371bdcbc in _PyObject_MakeTpCall + 0x2ac from /lib64/libpython3.13.so.1.0 0x00007f1e371d955a in _PyEval_EvalFrameDefault + 0xa17a from /lib64/libpython3.13.so.1.0 0x00007f1e372aa82f in PyEval_EvalCode + 0x9f from /lib64/libpython3.13.so.1.0 0x00007f1e372e9dec in <unknown> from /lib64/libpython3.13.so.1.0 0x00007f1e372e6f05 in <unknown> from /lib64/libpython3.13.so.1.0 0x00007f1e372e3587 in <unknown> from /lib64/libpython3.13.so.1.0 0x00007f1e372e31ff in <unknown> from /lib64/libpython3.13.so.1.0 0x00007f1e372e3021 in <unknown> from /lib64/libpython3.13.so.1.0 0x00007f1e372e13e7 in Py_RunMain + 0x3f7 from /lib64/libpython3.13.so.1.0 0x00007f1e3729820b in Py_BytesMain + 0x3b from /lib64/libpython3.13.so.1.0 0x00007f1e36e90575 in <unknown> from /lib64/libc.so.6 0x00007f1e36e90628 in __libc_start_main at :? from /lib64/libc.so.6 0x0000564c4b8a23d5 in _start + 0x25 from /py-venv/ROOT-CI/bin/python3.13 *** Break *** segmentation violation Generating stack trace... 0x00007f1e372498b7 in _PyErr_SetString + 0x47 from /lib64/libpython3.13.so.1.0 0x00007f1e370c06da in <unknown> from /lib64/libpython3.13.so.1.0 0x00007f1e371d37ff in _PyEval_EvalFrameDefault + 0x441f from /lib64/libpython3.13.so.1.0 0x00007f1e372bf359 in <unknown> from /lib64/libpython3.13.so.1.0 0x00007f1e37320c37 in <unknown> from /lib64/libpython3.13.so.1.0 0x00007f1e371d41b5 in _PyEval_EvalFrameDefault + 0x4dd5 from /lib64/libpython3.13.so.1.0 0x00007f1e372a88c4 in <unknown> from /lib64/libpython3.13.so.1.0 0x00007f1e372f9b49 in <unknown> from /lib64/libpython3.13.so.1.0 0x00007f1e371bdcbc in _PyObject_MakeTpCall + 0x2ac from /lib64/libpython3.13.so.1.0 0x00007f1e371d955a in _PyEval_EvalFrameDefault + 0xa17a from /lib64/libpython3.13.so.1.0 0x00007f1e372a88c4 in <unknown> from /lib64/libpython3.13.so.1.0 0x00007f1e372f9b49 in <unknown> from /lib64/libpython3.13.so.1.0 0x00007f1e371bdcbc in _PyObject_MakeTpCall + 0x2ac from /lib64/libpython3.13.so.1.0 0x00007f1e371d955a in _PyEval_EvalFrameDefault + 0xa17a from /lib64/libpython3.13.so.1.0 0x00007f1e372a88c4 in <unknown> from /lib64/libpython3.13.so.1.0 0x00007f1e372f9b49 in <unknown> from /lib64/libpython3.13.so.1.0 0x00007f1e371bdcbc in _PyObject_MakeTpCall + 0x2ac from /lib64/libpython3.13.so.1.0 0x00007f1e371d955a in _PyEval_EvalFrameDefault + 0xa17a from /lib64/libpython3.13.so.1.0 0x00007f1e372aa82f in PyEval_EvalCode + 0x9f from /lib64/libpython3.13.so.1.0 0x00007f1e372e9dec in <unknown> from /lib64/libpython3.13.so.1.0 0x00007f1e372e6f05 in <unknown> from /lib64/libpython3.13.so.1.0 0x00007f1e372e3587 in <unknown> from /lib64/libpython3.13.so.1.0 0x00007f1e372e31ff in <unknown> from /lib64/libpython3.13.so.1.0 0x00007f1e372e3021 in <unknown> from /lib64/libpython3.13.so.1.0 0x00007f1e372e13e7 in Py_RunMain + 0x3f7 from /lib64/libpython3.13.so.1.0 0x00007f1e3729820b in Py_BytesMain + 0x3b from /lib64/libpython3.13.so.1.0 0x00007f1e36e90575 in <unknown> from /lib64/libc.so.6 0x00007f1e36e90628 in __libc_start_main at :? from /lib64/libc.so.6 0x0000564c4b8a23d5 in _start + 0x25 from /py-venv/ROOT-CI/bin/python3.13 -- END TEST OUTPUT -- CMake Error at /github/home/ROOT-CI/build/RootTestDriver.cmake:186 (message): got exit code 129 but expected 0 ``` (cherry picked from commit e677a75)
This doesn't help the user, and also confuses the CI when testing, because tutorials can apparently succeed even if they do nothing. (cherry picked from commit 8617e8b)
This is not needed for ROOT, because the CPyCppyy API headers are installed with the other ROOT headers anyway, and ROOT knows where to find them already. (cherry picked from commit 251de0f)
Just like for other pdfs that are strictly zero for negative observable values, the integral for xMin < zero should still evaluate correctly (compare for example with the RooLandau). Addresses this forum report: https://root-forum.cern.ch/t/roofit-pdfs-with-different-domain-in-the-same-model-e-g-gauss-lognormal/64505/3 Little demo that it works now: ```c++ RooRealVar x("x", "x", 0.0, 10.0); RooRealVar mu("mu", "mu", 1.0); RooRealVar sigma("sigma", "sigma", 0.5); RooLognormal logn("logn", "lognormal pdf", x, mu, sigma); double a = -1.0; double b = 5.0; x.setRange("intRange", -1.0, 5.0); RooAbsReal* integral = logn.createIntegral(x, RooFit::NormSet(x), RooFit::Range("intRange")); double result = integral->getVal(); std::cout << "Integral of Lognormal from " << a << " to " << b << " = " << result << std::endl; ``` (cherry picked from commit 7ffaf51)
Test Results 20 files 20 suites 3d 9h 20m 5s ⏱️ Results for commit 34372594. ♻️ This comment has been updated with latest results. |
d9503af
into
root-project:v6-38-00-patches
26 of 28 checks passed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport recent fixes