# HG changeset patch # User Lachlan Andrew # Date 1453045069 28800 # Node ID 622e34f6ede38c92a45c7659d3d595ae1bb0ce4a # Parent 0ebb8e26ebbc7f7c19ed97dd3f513a431bc3b3f4 Fix segfault with dbstatus (bug #44195) * debug.cc (bp_table::do_get_breakpoint_list): Copy bp_set to temporary variable and iterate over that since changes to a file may invalidate bp_set while code is running.. diff -r 0ebb8e26ebbc -r 622e34f6ede3 libinterp/corefcn/debug.cc --- a/libinterp/corefcn/debug.cc Sun Jan 17 07:22:55 2016 -0800 +++ b/libinterp/corefcn/debug.cc Sun Jan 17 07:37:49 2016 -0800 @@ -516,7 +516,10 @@ { fname_line_map retval; - for (bp_set_iterator it = bp_set.begin (); it != bp_set.end (); it++) + // make copy since changes may invalidate iters of bp_set. + std::set tmp_bp_set = bp_set; + + for (bp_set_iterator it = tmp_bp_set.begin (); it != tmp_bp_set.end (); it++) { if (fname_list.length () == 0 || do_find_bkpt_list (fname_list, *it) != "")