public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "amab8901 at protonmail dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug gdb/29735] New: Can't have multiple breakpoints - crash otherwise
Date: Mon, 31 Oct 2022 13:25:05 +0000	[thread overview]
Message-ID: <bug-29735-4717@http.sourceware.org/bugzilla/> (raw)

https://sourceware.org/bugzilla/show_bug.cgi?id=29735

            Bug ID: 29735
           Summary: Can't have multiple breakpoints - crash otherwise
           Product: gdb
           Version: 12.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: amab8901 at protonmail dot com
  Target Milestone: ---

I wrote the following code:

```
use fst::{Set};
use fst::automaton::Levenshtein;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let keys = vec!["hej"];
    let set = Set::from_iter(keys)?;

    let lev = Levenshtein::new("foo", 1)?;

    println!("{:#?}", set);
    println!("{:#?}", lev);
    Ok(())
}
```

This code crashes when attempting to run this line:
```
let lev = Levenshtein::new("foo", 1)?;
```

Here is the `Cargo.toml`:
```
[package]
name = "playground"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at
https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
fst = { version = "0.4.7", features = ["levenshtein"] }
```
How to reproduce:
1. `cargo new playground`
2. enter project's root directory
3. `cargo add fst --features=levenshtein`
4. `nvim .` (note: I have NerdTree extension in my Neovim)
5. Navigate into `main.rs` file via NerdTree
6. Replace the `main.rs` content with:
```
use fst::{Set};
use fst::automaton::Levenshtein;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let keys = vec!["hej"];
    let set = Set::from_iter(keys)?;

    let lev = Levenshtein::new("foo", 1)?;

    println!("{:#?}", set);
    println!("{:#?}", lev);
    Ok(())
```
7. `:w` in neovim
8. `:! cargo build` in neovim (note that bash is in project's root folder while
neovim is simultaneously in `main.rs` at this point)
9. Open another terminal in project's root folder
10. In the new terminal, run `gdb target/debug/playground` (alternatively:
`rust-gdb target/debug/playground`)
11. In gdb, run the following commands, one line at a time (note that I have
[GDB Dashboard](https://github.com/cyrus-and/gdb-dashboard) implemented into my
GDB):
```
list
b 8 
b 10
list
b 11
b 12
r
c
```
It crashes as soon as you enter `c`. The following specified what "crash" means
and shows the output that I see:

```
Breakpoint 2, playground::main () at src/main.rs:10
10          println!("{:#?}", set);
../../gdb/gdbtypes.h:1064: internal-error: field: Assertion `idx >= 0 && idx <
num_fields ()' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
----- Backtrace -----
0x5654d0133b6b ???
0x5654d0471d44 ???
0x5654d0534ce3 ???
0x5654d00b3ea1 ???
0x5654d0483e23 ???
0x5654d03b74bc ???
0x5654d047f0db ???
0x5654d0484935 ???
0x5654d0485b6b ???
0x5654d03b70ab ???
0x5654d047f0db ???
0x5654d03b6cd0 ???
0x5654d03b70ef ???
0x5654d047f0db ???
0x5654d036ed08 ???
0x7f96c5548418 ???
0x7f96c54f9c9f ???
0x7f96c54f4b83 ???
0x7f96c5529420 ???
0x7f96c54e4b33 ???
0x5654d03632a6 ???
0x5654d022a526 ???
0x5654d047f164 ???
0x5654d03b6cd0 ???
0x5654d03b70ef ???
0x5654d047f0db ???
0x5654d03b6cd0 ???
0x5654d03b70ef ???
0x5654d047f0db ???
0x5654d036ed08 ???
0x7f96c5548418 ???
0x7f96c54f9c9f ???
0x7f96c54f4b83 ???
0x7f96c5500bb8 ???
0x7f96c54efd75 ???
0x7f96c5500bb8 ???
0x7f96c54efd75 ???
0x7f96c5500bb8 ???
0x7f96c54f48de ???
0x7f96c5500bb8 ???
0x7f96c54f48de ???
0x7f96c5500bb8 ???
0x7f96c54f01a9 ???
0x7f96c550be45 ???
0x7f96c54f0eb5 ???
0x7f96c54ee9bf ???
0x7f96c550bf6c ???
0x7f96c5500357 ???
0x7f96c559dcc0 ???
0x5654d05b11ba ???
0x5654d03617f2 ???
0x5654d02bc432 ???
0x5654d02b3f52 ???
0x5654d0535955 ???
0x5654d0535d06 ???
0x5654d02f3d24 ???
0x5654d009fc04 ???
0x7f96c4c3a28f ???
0x7f96c4c3a349 ???
0x5654d00a61e4 ???
0xffffffffffffffff ???
---------------------
../../gdb/gdbtypes.h:1064: internal-error: field: Assertion `idx >= 0 && idx <
num_fields ()' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) 

```

-- 
You are receiving this mail because:
You are on the CC list for the bug.

             reply	other threads:[~2022-10-31 13:25 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-31 13:25 amab8901 at protonmail dot com [this message]
2022-10-31 20:21 ` [Bug rust/29735] " tromey at sourceware dot org
2022-11-01  3:37 ` amab8901 at protonmail dot com
2022-11-01 13:38 ` tromey at sourceware dot org
2022-11-01 14:27 ` amab8901 at protonmail dot com
2022-11-02 19:47 ` tromey at sourceware dot org
2023-03-08  0:28 ` tromey at sourceware dot org
2023-10-28 18:34 ` tpzker at thepuzzlemaker dot info
2023-10-28 18:51 ` tpzker at thepuzzlemaker dot info
2023-10-28 18:55 ` tpzker at thepuzzlemaker dot info
2023-10-28 20:46 ` tromey at sourceware dot org
2023-10-28 20:48 ` tromey at sourceware dot org
2023-10-28 20:56 ` tpzker at thepuzzlemaker dot info
2023-10-28 20:57 ` tpzker at thepuzzlemaker dot info
2023-10-28 21:08 ` tpzker at thepuzzlemaker dot info
2023-10-29 10:06 ` sam at gentoo dot org
2023-11-24 16:30 ` tromey at sourceware dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-29735-4717@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).