TFormula segfault since ROOT 6.16?

Hi everybody,

after switching to ROOT 6.16, I noticed a problem with TFormula. When passing an invalid formula, it segfaults root. In older versions, I got a message printed to the screen and I could continue working normally and was able to call IsValid (and other functions).

Can anyone reproduce this?

$ root
root [0] TFormula f_bad("f", "4x")
input_line_46:2:66: error: invalid suffix 'x' on integer constant
Double_t TFormula____id7894888978604609976(Double_t *x){ return 4x[0] ; }
                                                                 ^
input_line_47:2:66: error: invalid suffix 'x' on integer constant
Double_t TFormula____id7894888978604609976(Double_t *x){ return 4x[0] ; }
                                                                 ^
Error in <prepareMethod>: Can't compile function TFormula____id7894888978604609976 prototype with arguments Double_t*

 *** Break *** segmentation violation



===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================
#0  0x00007fcc936006c2 in __GI___waitpid (pid=26769, stat_loc=stat_loc
entry=0x7fffb8df97e8, options=options
entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:30
#1  0x00007fcc9356b067 in do_system (line=<optimized out>) at ../sysdeps/posix/system.c:149

(error omitted since either you see it as well or I need to double check I compiled correctly)

Is there any other easy way to check if a TFormula at least looks like a correct expression?

ROOT Version: 6.16/01, heads/v6-16-00-patches (v6-16-00-52-g82f285fc5c)
ROOT compiled with CXX14=on
Platform: Linux 4.15.0-45-generic x86_64 GNU/Linux
Compiler: g++-7.3.0


see https://sft.its.cern.ch/jira/browse/ROOT-9990

1 Like

Hi,

Thank you for submitting the JIRA item. This is a bug, I think introduced ini 6.16. We will fix as soon as possible

Lorenzo

I already added a fix + added a test case in patch attached to the jira ticket. By the way: for me it is easier to send a .patch file. But I could also supply this as a pull request (then again, to 6-16-patches or to master?) Is there any preference on your side?

Hi
Ah, I was too fast and missed your patch and I have submitted a PR

Submitting a PR is in general better, but a patch is also fine

Please note that my patch did also add a test case for this problem. And fixed a few logical errors in other TFormula test cases as well.

Hi

I will update the PR with your patch
Thank you for the contribution

Lorenzo

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.