-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[RF] RooUniform in RooArgList in RooProdPdf: segmentation violation during fit #8052
Comments
Accidentally it was sent during the writing of this bug, so I had to edit that afterwards, sorry. I tried to search for the bug, but didn't do that extensively, because there might be a host of variants of this bug (I searched only for this title). I have to say that even if you oblige users to define all variables separately (which would be strange), this is a bit inconsistent with the fact that RooArgList can be defined inside the constructor of RooProdPdf. |
At first sight, Assigning to @guitargeek so that he can take a look. |
Hmm that's not good that you get a crash like this. The thing is that the A possible solution would be to have a mechanism that detects which arguments need to be owned and which not, but I think that would be too convoluted and not really necessary. However, we can easily change it such that you get a nice exception with useful information text if the RooArgSet/List constructor detects that one argument is a temporary. Does that sound like an acceptable solution to you? |
"RooArgList created with the constructor where you pass multiple elements are non-owning collections" - it looks like a not very good behaviour. Why can't it be consistent between all constructors? "It is also possible to have an owning RooArgList/Set, but in this case it would own all the elements" - maybe it would be better than to completely prohibit owning? I think it may be used more often than a mixture of owned/not-owned elements. However, it would still require some code. I would also add about RooArgList, that it would be great to handle an arbitrary number of elements. Is it possible? I have 10 pdfs, and I have to add the last one after the RooArgList constructor using the add method (because the constructor supports at maximum 9 args). Anyway if you can detect this issue and raise an exception, this would be a good solution. Thanks! |
Hi! It is consistent for all constructors. By default, the RooAbsCollections are always non-owning. You can think of them as To make them not too different from STL containers, I think it's good to not implement some mixed ownership model. I also don't think it would be worth it to try to infer if it's a fully-owning collection or a non-owning collection on the fly, because also this will cause further divergence from the behavior of the underlying I think it would be best if we are more restrictive here, and make it such that the code doesn't even compile when you try to initialize a RooArgList/Set from a temporary. I opened a PR where this is implemented. And yes, it is possible to construct them with an arbitrary number of elements! |
I see. Great speed! No, when I tried to initialize RooArgList with 10 pdfs, the compiler complained that it can't find a constructor for that. See the code. These constructors are hard-coded for specific numbers of elements. |
Sorry, I missed that you are using ROOT 6.22. Right, the templated constructor for an arbitrary number of elements only got introduced with ROOT 6.24. |
Wonderful news, thanks, I will update. |
Hi @guitargeek, It appears this issue is closed, but wasn't yet added to a project. Please add upcoming versions that will include the fix, or 'not applicable' otherwise. Sincerely, |
Describe the bug
When I use RooUniform inside RooProdPdf, this leads to SIGSEGV during execution.
This code raises:
However, when I write RooUniform definition outside of that RooArgList, everything works fine:
Expected behavior
Should be the same for variables defined inside and outside the constructor.
To Reproduce
Setup
Additional context
Unfortunately (I don't know whether it must be considered a bug) the output about the error appears only when I comment out a lot of code. Usually it only writes
Here is the output when I manage to get that:
The text was updated successfully, but these errors were encountered: