public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug rust/30660] New: segfault on invalid char while printing array
@ 2023-07-21 6:15 shivanib134 at gmail dot com
2023-07-21 13:24 ` [Bug rust/30660] " tromey at sourceware dot org
0 siblings, 1 reply; 2+ messages in thread
From: shivanib134 at gmail dot com @ 2023-07-21 6:15 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=30660
Bug ID: 30660
Summary: segfault on invalid char while printing array
Product: gdb
Version: 12.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: rust
Assignee: unassigned at sourceware dot org
Reporter: shivanib134 at gmail dot com
Target Milestone: ---
Hello!
Recently, while debugging an array slice which was passed by C to Rust
function, I tried to print the array and the result was:
(gdb) p cur_i
$1 = &[u8] {
data_ptr: 0x621000035d00,
length: 2896
}
but then, I wanted to see the first 10 bytes in the data_ptr and didn't
remember the syntax, so, I did
(gdb) p *cur_i.data_ptr@[10]
while this is very incorrect, I was hoping for errors to lead me to the correct
syntax. But, this resulted in the following error:
(gdb) p *cur_i.data_ptr@[10]
Fatal signal: Segmentation fault
----- Backtrace -----
0x555d903a0077 ???
0x555d904a2859 ???
0x555d904a2a22 ???
0x7f0dea04251f ???
./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0x555d9036c863 ???
0x555d9049c827 ???
0x555d905bf79f ???
0x555d905bfcef ???
0x555d903d5654 ???
0x555d906cb394 ???
0x555d904a39a4 ???
0x555d904a3d43 ???
0x555d904a44c6 ???
0x7f0deb47de0d ???
0x555d904a2a95 ???
0x555d904a4374 ???
0x555d904a268b ???
0x555d90854815 ???
0x555d90854caa ???
0x555d9056036c ???
0x555d90562054 ???
0x555d902f815f ???
0x7f0dea029d8f __libc_start_call_main
../sysdeps/nptl/libc_start_call_main.h:58
0x7f0dea029e3f __libc_start_main_impl
../csu/libc-start.c:392
0x555d902fdbf4 ???
0xffffffffffffffff ???
---------------------
A fatal error internal to GDB has been detected, further
debugging is not possible. GDB will now terminate.
This is a bug, please report it. For instructions, see:
<https://www.gnu.org/software/gdb/bugs/>.
Segmentation fault (core dumped)
Please note that when I tried the same syntax on an array in C, I got the
error:
(gdb) p *input@[10]
A syntax error in expression, near `[10]'.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug rust/30660] segfault on invalid char while printing array
2023-07-21 6:15 [Bug rust/30660] New: segfault on invalid char while printing array shivanib134 at gmail dot com
@ 2023-07-21 13:24 ` tromey at sourceware dot org
0 siblings, 0 replies; 2+ messages in thread
From: tromey at sourceware dot org @ 2023-07-21 13:24 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=30660
Tom Tromey <tromey at sourceware dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
CC| |tromey at sourceware dot org
Resolution|--- |DUPLICATE
--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
I looked into this and it turns out to be a dup, fixed in 14.1.
*** This bug has been marked as a duplicate of bug 30410 ***
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-07-21 13:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-21 6:15 [Bug rust/30660] New: segfault on invalid char while printing array shivanib134 at gmail dot com
2023-07-21 13:24 ` [Bug rust/30660] " tromey at sourceware dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).