Octave debug info randomly displayed

  • Thread starter jlefevre76
  • Start date
  • Tags
    Octave
In summary, the Octave console displayed a message and all of the debug commands, but didn't throw an error.
  • #1
jlefevre76
121
6
Okay, I'm not sure if one of the Octave settings got messed up or something, but all of a sudden, in the middle of my run, the Octave console displays a message and all of the debug commands, but doesn't throw an error:

'debug' is a function from the file C:\[path to debug.m]

-- Function file: debug ()
Summary of debugging commands. For more information on each command and available options use 'help CMD'.

The debugging commands available in Octave are

'dbstop'
Add a breakpoint.
'dbclear'
Remove a breakpoint.
'dbstatus'
List all breakpoints.
...And it goes on to list all the debugging functions with brief descriptions, etc...It does not enter debug mode.

Anybody know how to suppress this, or what might be causing it? As I remember, my code was working perfectly, but on one run it just starting doing this, and I can't remember what I changed or how I caused it. In any case, my code goes through thousands of iterations, and this is going to keep the code from being able to be completed. Again, no error or warning is officially identified, the display is exactly as described.

Any help is appreciated.

-Jeremy LeFevre
 
Physics news on Phys.org
  • #3
Yes, but it doesn't say there's a warning, error, or anything else that would require it to enter debug mode, it just starts randomly (as far as I can tell) spitting out information on debug mode.

As for having created a breakpoint, that could be the case, but since Octave does not come with a GUI (at least I am not using one), I have no way of determining where it would be (if I inadvertently created one).

So, I have no idea what is causing it or why it is giving output on debug mode, and not indicating a warning, interruption, error, or problem of some kind.
 
  • #4
You have to determine at what line the debug kicks in if it is indeed program dependent. Also if you have the source you could search for dbstop or any of the other names used in the link I gave you earlier. It could be that some option or function argument has turned it on as a feature of the library code you're using...
 
  • #6
That's just it, I have tried it with debug mode on and off (and nothing changed at all). Maybe I haven't described what is happening well enough. It displays the said text, then continues to execute the program. The problem becomes the fact that displaying so much text without clearing causes Octave to crash after only a few iterations (I assume). When I say crash, I mean crash, as it Octave closes itself. No stopping of the program, this weird text displays information about debug mode (which hadn't been activated in the first place), does not stop the code from executing, and then Octave crashes, I can only guess why. So, in other words, it never even enters debug mode, it just displays the said text and continues to execute until it crashes! I cannot see anything in the code that would be causing it to crash (like a divide by zero, a growing array, or anything weird like that). I can only figure that displaying so much unnecessary text it is somehow causing it to crash, but I don't know this for certain.

By the way, it is calling a function, named wedgeRT.m, a code I wrote. There is no reference to debugging anything in the code, not that I'm aware of (and I wrote it, so you'd think I would remember if I had :P ). Thanks for the ideas though.
 
  • #7
Okay so maybe there is a referencing error. In C code for example, if you forgot to place a null byte at the end of a string and then printed that string it would keep printing forever until it found a null byte.

Since this is showing the text of the debug help then perhaps its a similar kind of situation. If so these kinds of problems are very hard to debug.

One trick might be to try running in debug mode and then see if debug detects something and causes it to stop.

Another trick is to add print statements to it so you can see how far it got before the error occurs and then keep refininf the prints to isolate the offending line if that's the case. This trick doesn't always work if something earlier in your code has corrupted somethings.

Are you sure you haven't exceeded your array indexes? Are you sure you have enough memory on your system and haven't exhausted it during your program run? Do you have enough disk space for caching if Octave is using caching?

The printing of the debug help and then the crash is indicative of a bad pointer somewhere and so the print statements may help you isolate it.

Last trick is to selectively comment out parts of your code to see if the error still exists. As an example, commenting out a for loop or code inside it...
 
  • #9
If your code isn't too large, you could consider switching to Julia. Its syntax is very similar to MATLAB and Octave and it has better support and is more performant than either one. THe synatx is similar but not the same and there may be a learning curve to go thru to get your program to work.

http://docs.julialang.org/en/release-0.3/manual/noteworthy-differences/

http://docs.julialang.org/en/release-0.3/

There are some good tutorials on it on Youtube by Dave Sanders and by the original developers.
 
  • #10
Ok, thanks. That gives me a few ideas of some things I can try (some of them I already have without success).

LOLZ! I just found it...

So, one of the times I was using debug mode to fix my code, I must have accidentally types the word 'debug' at the end of one of the lines. It looked something like this:

some assignment or function line;debug

Result was, a short tutorial on how to use the debug function printed in my code for no reason and confused me thoroughly...

As a side note, come to think of it, when it first started doing that, I think I was debugging some kind of an overflow of an array or something like that. I think something was gobbling up the memory and causing the crash, so the crash is probably not related to the text after all.
 
  • #11
Great catch!

In post #4, I suggested searching your code for debug keywords which might have found it sooner.

Also one other trick, is usually when a working program that you have made recent changes too fails then it's a good idea to review those areas for odd things and always try to remember what you changed.

At work, I added a shell script to vim to always save the file I'm editing and then on exit it deletes the original if no changes were made. This allows me to use vim -d old.file new.file to see side by side differences in vim.

It's helped me a lot during a debugging session where I may be messing with many parts of the code to be able to compare it to the original.
 
  • #12
Anyway if you get the chance check out Julia. It may ruboff on you and convince you to drop Octave.
 
  • #13
Yes, indeed you mentioned it to me that I should search for that...and, thinking that there was no way I could have possibly written anything like that in my code, I ignored your sage advice. I have never heard of Julia, but I might check it out sometime. I guess for the time being, I will finish up with Octave the project I having going right now. In the long run a lot of people have told me I should change to Python. I kind of wanted to refresh my skills in C. Of course, what language I learn will probably depend most likely on where I end up job-wise, and what my boss says to learn. It could be a while until that happens.
 
  • #14
There's an interesting website that covers both and uses the IPython/IJulia workbench for both Julia nd Python development. The Dave Sanders videos on Youtube utilize it for teaching. The website is:

http://quant-econ.net/python_or_julia.html

With respect to Julia it interoperates well with Python and with Fortran and there's some work to allow it to work with Java and Matlab but they aren't as complete.

There's also the Pyzo.org website that has collected the various scientific python packages together as a one-stop shop for numerical computing in python.
 
Last edited by a moderator:

1. What does "Octave debug info randomly displayed" mean?

"Octave debug info randomly displayed" refers to the occurrence of debug information being displayed at seemingly random times during the execution of an Octave program. This information is typically used to aid in troubleshooting and identifying errors in the program.

2. Why is "Octave debug info randomly displayed" happening?

There can be several reasons for "Octave debug info randomly displayed" to occur. It could be due to a bug in the program, incorrect code, or a problem with the Octave environment or settings.

3. How can I turn off "Octave debug info randomly displayed"?

To turn off "Octave debug info randomly displayed", you can set the debug level to zero using the "debug_on_error" function. You can also use the "dbstop" command to stop debugging at a specific line in the code.

4. Can "Octave debug info randomly displayed" slow down my program's execution?

Yes, "Octave debug info randomly displayed" can slow down the execution of your program. This is because the debug information is being printed to the screen, which takes up processing time. It is recommended to turn off debugging when trying to optimize the performance of your program.

5. How can I use "Octave debug info randomly displayed" to troubleshoot my code?

You can use "Octave debug info randomly displayed" to identify errors in your code and understand the flow of your program. The debug information can provide insight into the values of variables at different points in the code and help pinpoint where an error may be occurring. You can also use the "dbstop" command to pause the execution of your program and inspect the values of variables at that specific point in the code.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
  • Programming and Computer Science
Replies
11
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • Programming and Computer Science
Replies
32
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • Programming and Computer Science
Replies
4
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
276
Replies
6
Views
6K
  • Programming and Computer Science
Replies
1
Views
945
  • Programming and Computer Science
Replies
1
Views
9K
Back
Top