out of bound access when building TLegend
Los mantenedores suelen responder en 1 día
Evaluación
Este issue todavía no se ha evaluado.
Descripción
Check duplicate issues.
- Checked for duplicates
Description
A simple plotting example of a histogram produces
/usr/include/c++/16/bits/stl_bvector.h:1158: constexpr std::vector<bool, _Alloc>::reference std::vector<bool, _Alloc>::operator[](size_type) [with _Alloc = std::allocator<bool>; reference = std::vector<bool>::reference; size_type = long unsigned int]: Assertion '__n < this->size()' failed.
In a debug build with GCC 16. See reproducer below.
The issue stems from https://github.com/root-project/root/blob/94606761150e817bf1c91c76fc1083deecfdcf33/graf2d/gpad/src/TPad.cxx#L3171 which allows accessing the one-after-last element of the vector.
Reproducer
#include <gtest/gtest.h>
#include <TCanvas.h>
#include <TH1D.h>
TEST(TH2D, DrawWithBuildLegend)
{
TH1D h1{"h1", "h1", 10, 0, 1};
auto nFills{10};
for (auto i = 0; i < nFills; i++) {
h1.Fill(0.45);
}
// Set a range on the Y axis lower cannot contain the maximum value: this triggered a bug in TPad::FillCollideGridTH1
// which would access the vector to find empty spaces for the legend out of bounds.
h1.GetYaxis()->SetRangeUser(0, 8);
TCanvas c;
h1.Draw();
// Need to check that BuildLegend can work also when the Y axis does not contain the maximum value
c.BuildLegend();
}
int main(int argc, char **argv)
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
ROOT version
Any
Installation method
From source
Operating system
Linux
Additional context
No response
- Lenguaje dominante
- C++
- Estrellas
- 3.3k
- Forks
- 1.6k
- Merge medio
- 2 d 17 h
- PR fusionados (30 d)
- 188
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de root-project/root
-
thisroot.sh: wrong ROOTSYS in zsh when the shell's command line has a newlinePosiblemente ocupada @dpiparo la tomó hace 5 días. Abiertobug in:Build System
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
root-project/root#23746 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
[tmva][sofie] Inputs of unsupported type (e.g. float16) give code that does not compile instead of an errorPosiblemente ocupada @lmoneta la tomó hace 15 días. AbiertoAI-Assisted bug in:SOFIE
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
root-project/root#23655 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
[RDataFrame] Code that transforms `#var` alias to `R_rdf_sizeof_var` does not respect string literalsPosiblemente ocupada @vepadulano la tomó hace 2 días. Abiertobug in:RDataFrame
Dificultad 3/5 1-2 días Aptitud para principiantes 71/100
root-project/root#23790 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
TDataMember::GetOffset interfers to TDataMember::GetOffsetCintPosiblemente ocupada @pcanal la tomó hace 2 días. Abiertobug in:Core Libraries
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
root-project/root#23777 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
`TChain::GetEntries` internal caching ineffective?Posiblemente ocupada @pcanal la tomó hace 7 días. Abiertoimprovement in:TTree
root-project/root#23738 · 6 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de root-project/root
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
OpenSpace/OpenSpace#4353 · 1 comentario ·
Los mantenedores suelen responder en 5 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
macOS: a double-click on a notarized altairsim is refused, and the docs give only the offline casePosiblemente ocupada @anhaoXie la tomó hoy. Abiertodocumentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
mutationpp/Mutationpp#337 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
bulletphysics/bullet3#4819 ·