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

Inconsistent behaviour on failed jitting (transaction rollback issue?) #16577

Open
1 task
bendavid opened this issue Oct 2, 2024 · 1 comment
Open
1 task
Assignees
Labels

Comments

@bendavid
Copy link
Contributor

bendavid commented Oct 2, 2024

Check duplicate issues.

  • Checked for duplicates

Description

Following up on an issue which was buried in #12449 (comment)

In current nightlies this test case behaves slightly differently, but still not correctly. It fails with sensible error messages on the first attempt, but then "succeeds" on the second attempt. I would expect it to fail with the same errors again if the state were really fully rolled back.

Reproducer

test.h

template <typename T>
class Helper {

public:

  Helper() {}

  std::size_t operator() () const {
    const std::size_t res = 0;
    res = T{0, 0}.size();
    return res;
  }

};

template <typename H>
std::size_t call_helper(const H &helper) {
  return helper();
}

testdeclare.py

import ROOT

ret = ROOT.gInterpreter.Declare('#include "test.h"')
print("header include ret", ret)

print("creating helper")
helper = ROOT.Helper[ROOT.std.vector["double"]]()

bad_template = "template std::size_t call_helper<Helper<std::vector<double>>>(const Helper<std::vector<double>>&);"

for i in range(2):
    print(f"declare attempt {i}")
    ret = ROOT.gInterpreter.Declare(bad_template)
    print("ret", ret)

output:

header include ret True
creating helper
declare attempt 0
In file included from input_line_34:1:
./test.h:10:9: error: cannot assign to variable 'res' with const-qualified type 'const std::size_t' (aka 'const unsigned long')
    res = T{0, 0}.size();
    ~~~ ^
./test.h:18:10: note: in instantiation of member function 'Helper<std::vector<double, std::allocator<double> > >::operator()' requested here
  return helper();
         ^
./test.h:9:23: note: variable 'res' declared const here
    const std::size_t res = 0;
    ~~~~~~~~~~~~~~~~~~^~~~~~~
ret False
declare attempt 1
ret True

ROOT version

   ------------------------------------------------------------------
  | Welcome to ROOT 6.33.01                        https://root.cern |
  | (c) 1995-2024, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for linuxx8664gcc on Oct 02 2024, 00:22:18                 |
  | From heads/master@v6-31-01-3406-g2dc2e0f126                      |
  | With g++ (GCC) 14.2.0                                            |
  | Try '.help'/'.?', '.demo', '.license', '.credits', '.quit'/'.q'  |
   ------------------------------------------------------------------

Installation method

lcg nightlies

Operating system

Linux (alma 9)

Additional context

No response

@bendavid bendavid added the bug label Oct 2, 2024
@bendavid
Copy link
Contributor Author

bendavid commented Oct 2, 2024

@jalopezg-git from the previous discussion this is possibly also related to #13565

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants