octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #46852] error gripe appearing when it seemingl


From: Dan Sebald
Subject: [Octave-bug-tracker] [bug #46852] error gripe appearing when it seemingly shouldn't during length()
Date: Fri, 08 Jan 2016 20:56:08 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0 SeaMonkey/2.15

URL:
  <http://savannah.gnu.org/bugs/?46852>

                 Summary: error gripe appearing when it seemingly shouldn't
during length()
                 Project: GNU Octave
            Submitted by: sebald
            Submitted on: Fri 08 Jan 2016 08:56:07 PM GMT
                Category: Interpreter
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: Any

    _______________________________________________________

Details:

This isn't going to be a very good report because all I can do is describe
what I'm seeing.  It is difficult to set up the conditions and data in a
simple test script, and the behavior is rather odd and can be easily avoided. 
I see this is related to the gripe code and that has been worked on recently,
so I can only hope someone who's been working on that might have a guess.

I have this recursive function that steps through a structure doing an
assortment of things based upon class of the structure element.  If the class
of the element/field is a string, part of the computation is to use the length
of that string.  The syntax

x = s.(name);

to get that string.  In one circumstance where the structure has several
fields which are strings, a length(x) produces

error: writechars: A(I): index out of bounds; value 117 out of bound 1

It makes little sense that this should happen, and the string causing the
error after several have succeeded is only about 30 characters.  I don't
understand where 117 is coming from, or bound 1 for that matter.  If I shuffle
the manner in which the fields are constructed, e.g., move the one that is
failing to the first one added to the structure, the error goes away.

I see that the "index out of bounds" error message originates in

liboctave/util/lo-array-gripes.cc

from function gripe_index_out_of_range(), but the particular message only
appears to originate from two locations having to do with delete.  (Does
length() use delete somehow?)  I say this from looking at the latest code. 
Code from months ago has the above message within gripe_index_out_of_range(). 
But the recent code has a more indirect way of generating the error message
using "throw".

If you want me to look into this more, I can, but some hints of where to look
would help.  The Array.cc file is where much of this array length checking is
done, but why there should even be an error, I'm not sure.  Fixing by
rearranging the structure field assignment complicates things as well.





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?46852>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]