Past The End iterator dereference in filter_iterator
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
Riproduci l’esempio dell’issue con GCC e ASAN, quindi esamina boost/iterator/filter_iterator.hpp per seguire la gestione dell’iteratore di fine. Il lavoro è completato quando il predicato sempre falso non dereferenzia più oltre l’intervallo e l’esempio termina senza un errore di ASAN.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
This simple test program segfaults on my GCC box with Boost 1.78
#include <boost/iterator/filter_iterator.hpp>
#include <iostream>
#include <array>
int main() {
struct False { bool operator()(unsigned char) const { return false; } };
std::array<char, 3> const s{'A','B','C'};
using FIt = boost::iterators::filter_iterator<False, const char*>;
for (FIt it(False{}, s.begin(), s.end()), end(s.end()); it != end; ++it) {
std::cout << static_cast<int>(*it) << " ";
};
}
See it live with ASAN: https://godbolt.org/z/8c9f1drGn
=================================================================
==1==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffc00329dc3 at pc 0x0000004fc947 bp 0x7ffc00329d90 sp 0x7ffc00329d88
READ of size 1 at 0x7ffc00329dc3 thread T0
#0 0x4fc946 in main /app/example.cpp:12:39
#1 0x7f90b8b920b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x240b2)
#2 0x41f34d in _start (/app/output.s+0x41f34d)
Address 0x7ffc00329dc3 is located in stack of thread T0 at offset 35 in frame
#0 0x4fc853 in main /app/example.cpp:5
This frame has 1 object(s):
[32, 35) 's' (line 8) <== Memory access at offset 35 overflows this variable
HINT: this may be a false positive if your program uses some custom stack unwind mechanism, swapcontext or vfork
(longjmp and C++ exceptions *are* supported)
SUMMARY: AddressSanitizer: stack-buffer-overflow /app/example.cpp:12:39 in main
Shadow bytes around the buggy address:
0x10000005d360: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x10000005d370: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x10000005d380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x10000005d390: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x10000005d3a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x10000005d3b0: 00 00 00 00 f1 f1 f1 f1[03]f3 f3 f3 00 00 00 00
0x10000005d3c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x10000005d3d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x10000005d3e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x10000005d3f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x10000005d400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
==1==ABORTING
- Lingua principale
- C++
- Stelle
- 23
- Fork
- 70
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di boostorg/iterator
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 58/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 45/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
Tutte le issue di boostorg/iterator
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
games-on-whales/wolf#509 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
-
bug-unconfirmed
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
NVIDIA/cuda-samples#453 ·