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

fix: don't assume Uproot is in global scope in TPython::Eval #927

Merged

Conversation

jpivarski
Copy link
Member

No description provided.

@jpivarski jpivarski linked an issue Aug 7, 2023 that may be closed by this pull request
@jpivarski
Copy link
Member Author

Let me know, @mramospe and @franciscosili, if this PR fixes the issue in your context. As you can see above, I wasn't able to reproduce it.

@agoose77
Copy link
Collaborator

agoose77 commented Aug 7, 2023

I can't reproduce with your test, but this one works for me

# BSD 3-Clause License; see https://github.com/scikit-hep/uproot5/blob/main/LICENSE


import ROOT


def test_import():
    h = ROOT.TProfile3D()
    __import__("uproot").from_pyroot(h)

@jpivarski
Copy link
Member Author

I verified that TProfile3D raises a segfault in main (whereas TH1F does not), but it's fixed in this PR. I wonder what's special about TProfile3D—maybe there's a new class version for it? Or maybe we don't have predefined streamers for it?

This module defines the behaviors of ``TH3`` and its subclasses (not including
``TProfile3D``).

Well, this does verify that there's a segfault without the fix and no segfault with the fix, so I'll ask @ioanaif to review this PR and merge it if everything's good. (I'm not planning on making any more changes.)

@jpivarski jpivarski requested a review from ioanaif August 7, 2023 16:57
Copy link
Collaborator

@ioanaif ioanaif left a comment

Choose a reason for hiding this comment

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

LGTM!

@jpivarski jpivarski merged commit 6b3b6f1 into main Aug 8, 2023
15 checks passed
@jpivarski jpivarski deleted the jpivarski/dont-assume-uproot-in-global-scope-in-TPython-Eval branch August 8, 2023 14:04
@mramospe
Copy link

Let me know, @mramospe and @franciscosili, if this PR fixes the issue in your context. As you can see above, I wasn't able to reproduce it.

Works for me now. Thanks a lot!

@jpivarski
Copy link
Member Author

The test for this now breaks; see issue #1237.

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.

Class-dependent segmentation violation when converting PyROOT objects
4 participants