This repository has been archived by the owner on May 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 33
Panic on remove() #13
Comments
Actually - I can reproduce it with a pretty small example. This is using 0.4 from crates.io use treebitmap::IpLookupTable;
use std::error::Error;
use std::net::Ipv4Addr;
const ADDR: Ipv4Addr = Ipv4Addr::new(49, 255, 11, 17);
fn main() -> Result<(), Box<dyn Error>> {
let mut table = IpLookupTable::new();
table.insert( Ipv4Addr::new(49, 255, 11, 16), 28, ());
table.insert( ADDR, 32, ());
println!("exact_match: {:?}", table.exact_match(ADDR, 32));
println!("longest_match: {:?}", table.longest_match(ADDR));
let v = table.remove(ADDR, 32);
println!("removed: {:?}", v);
Ok(())
} |
Looks like a bug with overlapping subnets. |
jiegec
added a commit
to jiegec/treebitmap
that referenced
this issue
Jun 29, 2019
jiegec
added a commit
to jiegec/treebitmap
that referenced
this issue
Jun 29, 2019
JakubOnderka
pushed a commit
to JakubOnderka/treebitmap
that referenced
this issue
Feb 21, 2020
JakubOnderka
pushed a commit
to JakubOnderka/treebitmap
that referenced
this issue
Feb 21, 2020
JakubOnderka
added a commit
to JakubOnderka/treebitmap
that referenced
this issue
Feb 21, 2020
JakubOnderka
added a commit
to JakubOnderka/treebitmap
that referenced
this issue
Feb 22, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm getting an occasional panic using this library on calling
IpLookupTable.remove()
. Panic location is below:The Rust binary in question is processing a couple hundred full BGP feeds but the list of prefixes which trigger the panic is suspiciously small...
49.255.11.17/32
is by far the most frequent culprit. It doesn't seem to happen every time and I have yet to be able to reliably reproduce it in a simple example. All the prefixes that trigger the crashes are /32 IPv4 prefixes.I added some debug logging and something looks odd. I started logging whenever I insert that prefix so I know it's been seen. Immediately before the panic I dump the table to a file and the prefix exists, however if I try to lookup the prefix using either
exact_match()
orlongest_match()
I get aNone
back..I realise this is probably tricky to troubleshoot without a reliable reproduction, but any tips on where I can start looking? I tried a build with this line changed to an
assert!()
but it still gets past that, so something seems to be happening inremove_child()
The text was updated successfully, but these errors were encountered: