Is there a way to show the faulty code line instead of the memory address when a runtime error occurs in VSCode? - visual-studio-code

See the Question in the title:
Runtime error 201 at $0000000100001D42 $0000000100001D42
Is there a way to show the faulty code line instead of the memory address?
Thanks for the Help

Normally, when a run-time error occurs, you are presented with a list of addresses that represent the call stack backtrace, i.e. the addresses of all procedures that were invoked when the run-time error occurred.
This list is not very informative, so there exists a unit that generates the file names and line numbers of the called procedures using the addresses of the stack backtrace. This unit is called lineinfo.
You can use this unit by giving the -gl option to the compiler. The unit will be automatically included. It is also possible to use the unit explicitly in your uses clause, but you must make sure that you compile your program with debug info.
When compiled with -gl, the following output is generated:
Runtime error 255 at 0x0040BDE5
0x0040BDE5 GENERATEERROR255, line 6 of testline.pp
0x0040BDF0 GENERATEANERROR, line 13 of testline.pp
0x0040BE0C main, line 17 of testline.pp
0x0040B7B1
This is more understandable than the normal message. Make sure that all units you use are compiled with debug info, because if they are not, no line number and filename can be found.

Related

PineScript error never seen ~ The body of the #f0 function is too long

As the title says it, I have never seen this type of error whereas not even a line number is given only "The body of the #f0 function is too long"
Any ideas?
Not exactly sure if this is relevant regarding functions, but this is information relating to errors thrown due to lengths of 'if' statements, I presume the same logic here is valid with functions too.
"This error occurs when the indented code inside an if statement is too large for the compiler. Because of how the compiler works, you won’t receive a message telling you exactly how many lines of code you are over the limit. The only solution now is to break up your if statement into smaller parts (functions or smaller if statements)."
So, I would suggest you break the function into sections (if possible) or post some code so we may be more able to assist.

Silence "unknown OID 17227: failed to recognize type of 'geography'. It will be treated as String."

I'm using columns of type "geography" for some few "point within polygon" queries. They are too few and too simple to bundle a GIS gem, I handle it all on the SQL level.
However, every time Rails boots (rake tasks, console etc), the following warning is spit:
unknown OID 17227: failed to recognize type of 'geography'. It will be treated as String.
I'm fine with "geography" being treated as "String", but the warning triggers warning mails every time a cronjob executes any rake task.
Any idea how I can silence this warning?
Thanks for your hints!
Looking at the source of ActiveRecord, I can answer the question myself:
The warning is hardcoded and therefore can't be silenced by AR configuration. However, RUBYOPT=-W0 gets rid of warnings altogether. This is a big chopper of course, but since I'm still getting those warnings in local development, I can live with a totally warning-less production system.
Since this is the first question/answer that appears given that the title is the error, I would recommend following this answer to fix it: What is the source of "unknown OID" errors in Rails?

Xcode Runtime Error log: What does the [#:#] mean in AppName[#:#]?

I got the following runtime error:
2014-12-10 19:26:39.695 Bliss2[21855:994070] Error: object not found for update (Code: 101, Version: 1.5.0)
I assume the [21855:994070] has a meaning.
How do I use it to track down the error in the code?
That is not a "runtime error". It is an NSLog message and has been executed and logged in perfectly good order (e.g. by some third-party code you are using?). Of course the code may then have thrown an exception / aborted, but if it did (and I don't know whether it did), that has nothing to do with the log message itself, except that you're being told first that there's a problem, apparently as a courtesy.
As for the numbers, they probably have nothing to say that will concern you here. The first number is your process number and won't be stable between invocations; it is rarely of interest. The second number is the thread number and is of interest when there are many log statements for discovering whether this log statement is executed in a background thread (or in the same thread as other log statements).

Why does Matlab standalone application exit with error "TooManyOutputs"?

I have created a standalone application in Matlab, actually it works, it displays the desired output but it closes immediately, not even enough time to examine the output and read the error message on DOS (standalone mode) that says:
MATLAB:TooManyOutputs
Warning: 1 visible figure(s) exist at MCR Termination
If your application has terminated unexpectedly, please note that
applications generated by the MATLAB Compiler terminate when there are no
visible figure windows. See the documentation for WaitForFiguresToDie and
WAITFORCALLBACKS for more information.
Any help would be appreciated.
Looking at the first line of your message, TooManyOutputs suggests that you have an assignment somewhere of the form
[a b] = somefunction(parameters)
so you want the outputs of somefunction to be put in a and b, but somefunction only returns one parameter. This bug causes your program to terminate, and then MCR realizes the program exits without closing your figure window, causing the later error messages.
If I'm right about TooManyOutputs, you should already have that error message when running your code directly in Matlab; have you tried that before creating a standalone application?
If this doesn't help, you should probably post some of your code to make it clearer where the problem could come from.

Why am I getting a buffer overrun error with this line of code?

I only have 1 line of code, and this is:
pcrecpp::RE re("abc");
inside a function OnBnClickedButtonGo(). And this function fails in Release mode, but it works OK in debug mode.
(I am using Visual Studio 8 on Windows XP.)
The error message is:
A buffer overrun has occurred in testregex.exe which has corrupted the program's
internal state. Press Break to debug the program or Continue to terminate
the program.
For more details please see Help topic 'How to debug Buffer Overrun Issues'.
I suspect it is its destructor, which is invisible and implied... but I don't know really.
PS: I am statically linking to the PCRE lib version 7.8.
PS2: Not very relevant, but may help some people who have trouble linking to the PCRE library (it took me hours to sort it out): include the line #define PCRE_STATIC.
I had the same error message in my case. In debug is everything fine, but in release I get the error message. I have a native C/C++ library like native.dll. I have created a mixed unmanaged/managed C++ library, which is a wrapper for that library to .net. Somewhere in this mixed.dll I have an unmanaged function signature declaration, like:
typedef void ( *FunctionOnStartSend)();
for this the I get the message, but if I add a "magic word" there then there is no error message:
typedef void (__stdcall *FunctionOnStartSend)();
If it's happening only in release mode, it's possible that something is getting "optimized" out. Try doing something more than just the one liner, like a Match() and maybe even printing out the matches.
Here is my fresh history:
About a month ago I've got a strange link failure of the VS2008 and that day I dug that setting _SECURE_SCL=0 may help (see link text). And it helped. That day it helped me and I just propagated this setting to all the libs we build at team -- that's because MS says that two libs built with different _SECURE_SCL are incompartible.
Time passed and three days ago I've got a bug when VS2008 says that error message that we see in the first post. And there are no help from the debugger because it overruns only in Release build. I've spend almost 2 days pump'n'jump'n the code of the libs and the overrun was flawed from line to line. Finally I started checking build settings line by line and figured the diff in this setting!
Why, oh why Microsoft guys can't embed some small check in dynamic loader code to test that the library currently running and the one going to be dynamically loaded are incompartible?! Some pice of code that save people's time. Blah!