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

Debug assertion failure "cannot seek vector iterator after end" in RTensor.hxx #13325

Closed
1 task done
bellenot opened this issue Jul 26, 2023 · 1 comment
Closed
1 task done
Assignees
Labels

Comments

@bellenot
Copy link
Member

Check duplicate issues.

  • Checked for duplicates

Description

This code in RTensor.hxx:

      shape.insert(shape.end() + 1 + idx, 1);

generates a debug assertion failure "cannot seek vector iterator after end".
As explained in the standard: end() returns an iterator to the element following the last element of the vector. This element acts as a placeholder; attempting to access it results in undefined behavior.

Reproducer

Compile ROOT in Debug mode on Windows with the /RTC1 compiler flag and run the TMVA tests/tutorials

ROOT version

master (6.29/01)

Installation method

built from source

Operating system

Windows

Additional context

No response

@bellenot
Copy link
Member Author

@moneta maybe simply shape.push_back(1); instead of shape.insert(shape.end() + 1 + idx, 1); would do it?

@bellenot bellenot closed this as completed Aug 7, 2023
@bellenot bellenot added this to Issues in Fixed in 6.30/00 via automation Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Development

No branches or pull requests

2 participants