bugGNU Octave - Bugs: bug #46530, String input returns on any kind...

 
 

bug #46530: String input returns on any kind of function A(I): index out of bounds triggered.

Submitted by:  andrefou <andreff92>
Submitted on:  Wed 25 Nov 2015 01:56:58 PM UTC  
 
Category: Configuration and Build SystemSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Segfault, Bus Error, etc.
Status: InvalidAssigned to: None
Originator Name: Andre FOpen/Closed: Closed
Release: 4.0.0Operating System: GNU/Linux

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 Jump to the original submission)

Tue 01 Dec 2015 02:40:15 PM UTC, comment #13:

indeed it works,
but when i want to use this function recursively or any other it will not be enough.
I made another mistake with the result name
function1=function1('/home/andrefougeront/clone/search-workers/image-processing/algo/set_of_images/compression_niv10-100/compresse10/01a10.jpg')

It may be the issue, I know it is quite a mess i m really sorry, I ll ask you next time with a clearer issue and well printed

I apologize, thank you

andrefou <andreff92>
Tue 01 Dec 2015 02:28:55 PM UTC, comment #12:

do a clear
and then your function1 will work at least once.
where are you making the variable function1?

Anonymous
Tue 01 Dec 2015 02:20:15 PM UTC, comment #11:

I made a mystake on the whos command

>> whos

Variables in the current scope:

Attr Name Size Bytes Class
==== ==== ==== ===== =====
ans 1x1 8 double
function1 1x1 8 double

Total is 2 elements using 16 bytes

andrefou <andreff92>
Tue 01 Dec 2015 02:18:41 PM UTC, comment #10:

here is the result and the whos command

> result1=function1('/home/andrefougeront/clone/search-workers/image-processing/algo/set_of_images/compression_niv10-100/compresse10/01a10.jpg')

res = 1
result1 = 1

>> result1=function1('/home/andrefougeront/clone/search-workers/image-processing/algo/set_of_images/compression_niv10-100/compresse10/01a10.jpg')

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

>> whos

Variables in the current scope:

Attr Name Size Bytes Class
==== ==== ==== ===== =====
ans 1x1 8 double
babu 1x1 8 double

Total is 2 elements using 16 bytes

And here is the function script

function res=function1(img)

res=1
endfunction

andrefou <andreff92>
Tue 01 Dec 2015 01:53:40 PM UTC, comment #9:

Hello!
The change of the function script deleted the bug for a while but it came back today! I guess it was not the real issue and may still have an issue on string inputs randomly on any function

taking back my error example I could add other error message alike:

>> result1=function1('/home/andrefougeront/clone/search-workers/image-processing/algo/set_of_images/compression_niv10-100/compresse10/01a10.jpg')

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

>> result1=function1('xyzù')

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

>> result1=function1('xzù')

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

>> result1=function1('xyzùy')

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

>> result1=function1('aaaaaabcdnaxv')

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

Please let me know if you have any other idea, I'm pretty sure should not come from the function script.

andrefou <andreff92>
Mon 30 Nov 2015 03:52:42 PM UTC, comment #8:

Yes it was the case, i gave the same name to a variable in my script, now it finally works well! Thank you very much!

Best regards,
Andre Fougeront

andrefou <andreff92>
Mon 30 Nov 2015 03:25:13 PM UTC, comment #7:

When this error occurs, type "which function1" or "whos". Do you have a variable named function1? If I define both a function and a variable named function1, I get the same errors as you report here. This is the most common cause of this type of error, because Octave indexing and function calling use the same operator.

Mike Miller <mtmiller>
Project Administrator
Mon 30 Nov 2015 03:16:32 PM UTC, comment #6:

To retake my example, with a resut named result1 and a function named function1. Whatever the content of the function if the input is a string it will give an error depending on the string, The first call of the function since the opening of octave will not trigger it and after the second time the bug will be triggered that way:

Hello,

finally the endfunction word at the end of the file was not enough to prevent the bug.

>> result1=function1('a')

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

>> result1=function1('aa')

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

>> result1=function1('aaaaaa')

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

>> result1=function1('aaaaaab')

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

>> result1=function1('aaaaaabc')

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

>> result1=function1('aaaaaabcb')

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

It will not depend on the number of characters but on the number of different type of characters, it is quite weird.

andrefou <andreff92>
Thu 26 Nov 2015 03:30:55 PM UTC, comment #5:

Closing as invalid for now. Please feel free to open a new bug report if this or other problems arise.

Mike Miller <mtmiller>
Project Administrator
Thu 26 Nov 2015 03:18:45 PM UTC, comment #4:

I think but i am not sure, I use the world function as an example I could have call it function1, but I forgot to put endfunction at the end of my script and I don t have any issue for now so I hope it is resolved! Maybe it was just the loading of functions that were not completely closed and prevent the function to load recursively. Indeed it may be a code issue and not an octave bug, I apologize.

andrefou <andreff92>
Wed 25 Nov 2015 03:19:09 PM UTC, comment #3:

Is the entire problem you are reporting now resolved?

Mike Miller <mtmiller>
Project Administrator
Wed 25 Nov 2015 02:52:12 PM UTC, comment #2:

Thank you very much, indeed i didnt knew the endfunction word was necessary :),

Best regards,
Andre Fougeront

andrefou <andreff92>
Wed 25 Nov 2015 02:34:32 PM UTC, comment #1:

This is not a bug. You are using the word function wrong.
Function is a reserved word and is used as follows:

The way you are using it will not work.

Doug Stewart <dastew>
Wed 25 Nov 2015 01:56:58 PM UTC, original submission:

Hello,
My issue is linked with my function call system, I am facing a bug that prevent me to use some function more than once before relaunching octave.

This bug do not depends on the function script, any function simple or not will trigger this bug if the input is a String (it wouldn t if it is an integer).

As an example starting at the second call of the function:
result=function('a String')
the function returns A(I): index out of bounds; value %% out of bound %%
And this value will change with the String size.

Moreover, I can also avoid the error by changing the name of the function and function file by for example call the function function1 and then
result=functionAnOtherName('a String')
would possibly work perfectly if I call it multiple time in a row.

So it is like my build is related to the issue and randomly create errors on some functions that take string in input(it could be some random function with random names).

Giving the script of any function will not help because I try on multiple kind of function clearly different (sometimes really simple like taking an input, don t use it, and returning result=1)

Like the system fail to get the input string or something like that.

I reinstalled octave multiple time and it didn t change anything.
Any idea on what part of octave on an ubuntu system could be related to this kind of bug?
Thank you,
Andre F

andrefou <andreff92>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by dastew (Posted a comment)
  • -unavailable- added by andreff92 (Submitted the item)
  • -unavailable- added by andreff92 (Andre F bug report on octave)
  •  

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

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 26 Nov 2015 03:30:55 PM UTCmtmillerStatusNeed Info=>Invalid
      Open/ClosedOpen=>Closed
    Wed 25 Nov 2015 03:19:09 PM UTCmtmillerStatusNone=>Need Info
    Wed 25 Nov 2015 01:56:58 PM UTCandreff92Carbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1