out of bound access when building TLegend
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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
- Ngôn ngữ chính
- C++
- Star
- 3.3k
- Fork
- 1.6k
- Merge trung bình
- 2 ngày 17 giờ
- Pull request đã merge (30 ngày)
- 188
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của root-project/root
-
thisroot.sh: wrong ROOTSYS in zsh when the shell's command line has a newlineCó thể đã có người làm @dpiparo đã nhận 4 ngày trước. Đang mởbug in:Build System
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
root-project/root#23746 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[tmva][sofie] Inputs of unsupported type (e.g. float16) give code that does not compile instead of an errorCó thể đã có người làm @lmoneta đã nhận 14 ngày trước. Đang mởAI-Assisted bug in:SOFIE
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
root-project/root#23655 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[RDataFrame] Code that transforms `#var` alias to `R_rdf_sizeof_var` does not respect string literalsCó thể đã có người làm @vepadulano đã nhận 1 ngày trước. Đang mởbug in:RDataFrame
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 71/100
root-project/root#23790 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
TDataMember::GetOffset interfers to TDataMember::GetOffsetCintCó thể đã có người làm @pcanal đã nhận 1 ngày trước. Đang mởbug in:Core Libraries
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
root-project/root#23777 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`TChain::GetEntries` internal caching ineffective?Có thể đã có người làm @pcanal đã nhận 7 ngày trước. Đang mởimprovement in:TTree
root-project/root#23738 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của root-project/root
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
foxglove/mcap#1907 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Documentation
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 72/100
qbittorrent/qBittorrent#25127 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
telegramdesktop/tdesktop#31505 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày