bugGNU Octave - Bugs: bug #41843, dbclear all

 
 

bug #41843: dbclear all

Submitted by:  Felipe G. Nievinski <fgnievinski>
Submitted on:  Wed 12 Mar 2014 04:53:19 AM UTC  
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  Closed
Release:  3.8.1 Operating System:  Any

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

( Jump to the original submission)

Mon 02 Nov 2015 04:16:42 AM UTC, comment #6: 

I checked in your patch on the stable branch under your name here (http://hg.savannah.gnu.org/hgweb/octave/rev/78b3e9868b67).  Thanks, this was an annoying segfault that I had not gotten around to fixing.  Closing report.

Rik <rik5>
Project Administrator
Sat 31 Oct 2015 05:49:10 AM UTC, comment #5: 

Has this been fixed?

The patches below seem to fix the problem, although I may be overlooking something.  It seems that bp_table::do_remove_all_breakpoints_in_file_1 remove all breakpoints from a file removes those in the subfunctions too, and so the repeated calls are unnecessary.

I found a related problem when two breakpoints were set for the same line, one relative to the main function and one relative to the sub-function.  Should I open another bug report?  It is fixed by the big patch at https://savannah.gnu.org/patch/?8784, but if there is to be a 4.0.1 in November, it may be better to write a separate patch to fix only that issue.  What do you think?

(file #35340)

Lachlan Andrew <lachlan>
Sun 30 Mar 2014 12:51:41 AM UTC, comment #4: 

Quick glance shows that this is a problem when one of the m-files has subfunctions.  The following works:

octave:1> dbstop ls
ans =  50
octave:2> dbstop bitcmp
ans =  41
octave:3> dbstatus
breakpoint in bitcmp at line 41.
breakpoint in ls at line 50.
octave:4> dbclear all

Rik <rik5>
Project Administrator
Sun 30 Mar 2014 12:15:39 AM UTC, comment #3: 

Something must have changed.  When I coded it back in January it worked just fine.

Rik <rik5>
Project Administrator
Sat 29 Mar 2014 11:02:52 PM UTC, comment #2: 

I see that it recognizes the "all" keyword, but it segfaults for me.

octave:1> dbstop ls;
octave:2> dbstop edit;
octave:3> dbstatus
breakpoint in edit at line 128.
breakpoint in ls at line 50.
octave:4> dbclear all
panic: Segmentation fault -- stopping myself...
attempting to save variables to 'octave-workspace'...
save to 'octave-workspace' complete
Segmentation fault

Stack trace:

#0  0x00007ffff7556a2d in std::_Rb_tree<std::string, std::string, std::_Identity<std::string>, std::less<std::string>, std::allocator<std::string> >::find (this=this@entry=0xb6d260, __k=...)
    at /usr/include/c++/4.8/bits/stl_tree.h:1792
#1  0x00007ffff7553347 in find (__x=..., this=<optimized out>) at /usr/include/c++/4.8/bits/stl_set.h:663
#2  bp_table::do_remove_all_breakpoints_in_file_1 (this=this@entry=0xb6d260, fcn=<optimized out>, fname=...) at ../../libinterp/corefcn/debug.cc:491
#3  0x00007ffff75534af in bp_table::do_remove_all_breakpoints_in_file (this=0xb6d260, fname=..., silent=silent@entry=false) at ../../libinterp/corefcn/debug.cc:523
#4  0x00007ffff755384a in remove_all_breakpoints_in_file (silent=false, fname=...) at ../../libinterp/corefcn/debug.h:81
#5  bp_table::do_remove_all_breakpoints (this=0xb6d260) at ../../libinterp/corefcn/debug.cc:545
#6  0x00007ffff7553f85 in remove_all_breakpoints () at ../../libinterp/corefcn/debug.h:88
#7  Fdbclear (args=...) at ../../libinterp/corefcn/debug.cc:730

Mike Miller <mtmiller>
Project Administrator
Sat 29 Mar 2014 06:40:49 PM UTC, comment #1: 

I just noticed this bug report.  I added 'dbclear all' as a feature back in January of this year.  It's on the development branch.  Closing this Feature Request.

Rik <rik5>
Project Administrator
Wed 12 Mar 2014 04:53:19 AM UTC, original submission:  

it'd remove all breakpoints in all files previously set with dbstop.

in octave scripting language, I'd do this as:

+verbose+
function dbclear (varargin)
  if strcmpi (varargin, {'all'}),  dbclear_all ();  return;  endif
  # ...
endfunction

function dbclear_all ()
  db = dbstatus ();
  for i=1:numel(db)
    [~, fn] = fileparts (db(i).file);
    dbclear (fn);
    #dbclear (db(i).file);  # WRONG!
  endfor
endfunction
-verbose-

Felipe G. Nievinski <fgnievinski>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #35340:  bug_41843.patch added by lachlan (2KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by lachlan (Updated the item)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by mtmiller (Updated the item)
  • -email is unavailable- added by fgnievinski (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follow 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-11-02 rik5 Severity1 - Wish => 3 - Normal
        Item GroupFeature Request => Segfault, Bus Error, etc.
        StatusConfirmed => Fixed
        Open/ClosedOpen => Closed
    2015-10-31 lachlan Attached File- => Added bug_41843.patch, #35340
    2014-03-29 mtmiller StatusFixed => Confirmed
    2014-03-29 rik5 StatusNone => Fixed
    2014-03-27 mtmiller CategoryNone => Octave Function
        Severity3 - Normal => 1 - Wish

    Back to the top


    Powered by Savane 3.5