How to decipher Erlang runtime error message - intellij-idea

When I run an Erlang function using IntelliJ's "Run Configuration", I am getting the following error message. The error message contains lot of nested brackets. Please help me in understanding the message.
"C:\Program Files\Erlang OTP\bin\erl.exe" -pa F:/1TB/P/workspace-IntelliJ-Erlang2/netconfClient/out/production/netconfClient -pa F:/1TB/P/workspace-IntelliJ-Erlang2/netconfClient -eval netconfManager:open2(). -s init stop -noshell
init terminating in do_boot ({badarg,[{ets,select,[ct_attributes,[_]],[{_}]},{ct_config,get_key_from_name,1,[{_},{_}]},{ct_util,does_connection_exist,3,[{_},{_}]},{ct_gen_conn,do_start,4,[{_},{_}]},{ct_netconfc,open,4,[{_},{_}]},{erl_eval,do_apply,7,[{_},{_}]},{init,start_it,1,[{_},{_}]},{init,start_em,1,[{_},{_}]}]})
Crash dump is being written to: erl_crash.dump...{"init terminating in do_boot",{badarg,[{ets,select,[ct_attributes,[{{ct_conf,'$1','_','_','_',undefined,'_'},[],['$1']}]],[{error_info,#{cause=>id,module=>erl_stdlib_errors}}]},{ct_config,get_key_from_name,1,[{file,"ct_config.erl"},{line,578}]},{ct_util,does_connection_exist,3,[{file,"ct_util.erl"},{line,577}]},{ct_gen_conn,do_start,4,[{file,"ct_gen_conn.erl"},{line,281}]},{ct_netconfc,open,4,[{file,"ct_netconfc.erl"},{line,424}]},{erl_eval,do_apply,7,[{file,"erl_eval.erl"},{line,744}]},{init,start_it,1,[{file,"init.erl"},{line,1234}]},{init,start_em,1,[{file,"init.erl"},{line,1220}]}]}}
done
Right click on a function in a .erl file and click on "Run ."

The error message consists of Error code and Stack trace.
Error code is badarg. Please refer to
Exit Reasons for the list of error code.
The stack trace contains one entry for each function call. Each call
provides file name, function name, line number. For example,
{init,start_em,1,[{file,"init.erl"},{line,1220}]} indicates that
init.erl is the file, start_em is the function and 1220 is line #.
After manual indentation, we could better visualize the stacktrace as follows.
{badarg,[
{ets,select,[ct_attributes,[_]],[{_}]},
{ct_config,get_key_from_name,1,[{_},{_}]},
{ct_util,does_connection_exist,3,[{_},{_}]},
{ct_gen_conn,do_start,4,[{_},{_}]},
{ct_netconfc,open,4,[{_},{_}]},
{erl_eval,do_apply,7,[{_},{_}]},
{init,start_it,1,[{_},{_}]},
{init,start_em,1,[{_},{_}]}
]}
{badarg,[
{ets,select,[ct_attributes,[{{ct_conf,'$1','_','_','_',undefined,'_'},[],['$1']}]],[{error_info,#{cause=>id,module=>erl_stdlib_errors}}]},
{ct_config,get_key_from_name,1,[{file,"ct_config.erl"},{line,578}]},
{ct_util,does_connection_exist,3,[{file,"ct_util.erl"},{line,577}]},
{ct_gen_conn,do_start,4,[{file,"ct_gen_conn.erl"},{line,281}]},
{ct_netconfc,open,4,[{file,"ct_netconfc.erl"},{line,424}]},
{erl_eval,do_apply,7,[{file,"erl_eval.erl"},{line,744}]},
{init,start_it,1,[{file,"init.erl"},{line,1234}]},
{init,start_em,1,[{file,"init.erl"},{line,1220}]}
]}

Related

starter_fs.py: error: unrecognized arguments: --nvmain-config

I am running gem5 patched with NVMain. But when I am going to run then getting error unrecognized element --nvmain-config. I have seen all the other article is using this argument and their program run also. I also changed script from starter_fs.py to fs.py but still no good. Please help me how i can run it.
I have added the picture for better understanding .
usage: starter_fs.py [-h] [--dtb DTB] [--kernel KERNEL]
[--disk-image DISK_IMAGE] [--script SCRIPT]
[--cpu {hpi,atomic,minor}] [--cpu-freq CPU_FREQ]
[--num-cores NUM_CORES]
[--mem-type {NVMainMemory,HBM_1000_4H_1x128,DRAMCtrl,DDR3_2133_8x8,HBM_1000_4H_1x64,GDDR5_4000_2x32,HMC_2500_1x32,LPDDR3_1600_1x32,WideIO_200_1x128,DDR4_2400_8x8,DDR3_1600_8x8,DDR4_2400_4x16,DDR4_2400_16x4,SimpleMemory,LPDDR2_S4_1066_1x32}]
[--mem-channels MEM_CHANNELS] [--mem-ranks MEM_RANKS]
[--mem-size MEM_SIZE] [--checkpoint] [--restore RESTORE]
starter_fs.py: error: unrecognized arguments: --nvmain-config=./Configs/PCM_ISSCC_2012_4GB.config

Is there a bgerror hook equivalent for uncaught errors out of the event loop in TCL?

In Tcl, when an uncaught error occurs in the background in the event loop, the function bgerror will be called if one exists (or any function registered via interp bgerror).
When an unknown command is encountered, the unknown command will be called.
Is there a similar mechanism for uncaught errors outside of the event loop that make their way to the top level? The default behavior from tclsh is just to print the error on stderr, but I would like a specific proc to be called instead without having to put the entire code in one big catch.
The default behaviour, if a Tcl error makes it's way to the top of the main execution path, is to print the errorInfo trace to standard error and, if running as a script, exit with a non-zero result code. If you want to override this, you need to either write your own entry code/main loop in C (when you can do anything you want when Tcl_Eval() returns TCL_ERROR), or wrap your code in a catch or try. You can use uplevel #0 within such Tcl code to ensure that the trapping code doesn't appear to be on the stack as seen by the rest of your code.
For example:
proc printStackOnError {script} {
try {
uplevel "#0" $script
} on error {msg opt} {
set stackinfo [dict get $opt -errorinfo]
# remove last three uninteresting lines; they're just part of this procedure's machinery
puts stderr [join [lrange [split $stackinfo "\n"] 0 end-3] "\n"]
}
}
Demonstrating (interactively, with Tcl 8.6):
% printStackOnError {eval {error foo}}
foo
while executing
"error foo"
("eval" body line 1)
invoked from within
"eval {error foo}"
You're advised to make sure you either print or log the errorInfo when an error is trapped at that level. Otherwise any bugs in your code are going to be unreasonably difficult to fix.

An error occurred when executing Randomwalk2dmobility in NS3

I am a newbie to NS3. I want to understand the execution status of handover in the Randomwalk2d module and visualize it. The default is two Ue and two enb, but errors will always occur during execution. Can anyone help me solve the problem?
This is my code link:https://drive.google.com/file/d/163NQOyvs0bTh2J4P9_vpS4Y7iqocB3HJ/view?usp=sharing
When I execute the command : ./waf --run scratch/lte_handover --visualize, the following error appear
../scratch/lte_handover.cc:In funtion 'int main(int, char**)':
../scratch/lte_handover.cc:296:78: error: expected ')' before ';' token
"Bounds",RectangleValue (Rectangle (0,2000,0,2000)));
^
Build failed
->task in 'lte_handover' failed with exit status 1 (run with -v to display more information)
Follow the instructions to enter the command :./waf --run scratch/lte_handover -v, and the following information appears
Several tasks use the same identifier. Please check the information on
https://waf.io/apidocs/Task.html?highlight=uid#waflib.Task.Task.uid
object 'SuidBuild_task'(
{task 139759060979784: SuidBuild_task -> }) defined in 'tap-creator'
object 'SuidBuild_task'(
{task 139759060980008: SuidBuild_task -> }) defined in 'tap-creator'
object 'SuidBuild_task'(
{task 139759065638504: SuidBuild_task -> }) defined in 'tap-creator'
Seems that you have an extra ) in that line above. You are not closing this command as you commented all the lines
ueMobility.SetPositionAllocator ("ns3::RandomRectanglePositionAllocator", // <-- close
ueMobility.SetMobilityModel ("ns3::RandomWalk2dMobilityModel","Bounds", RectangleValue (Rectangle (0,2000,0,2000)));

hide error messages in dcl script

I have a test script I'm running that generates some errors,shown below, I expect these errors. Is there anyway I can prevent them from showing on the screen however? I use the
$ write sys$output
to display if there is an expected error.
I tried to use
$ DEFINE SYS$ERROR ERROR.LOG
but this then changed my entire error output log to this, if this is the correct way to handle it can I unset this at the end of my script somehow?
[error example]
%DCL-E-OPENIN, error opening TEST$DISK:[AAA]NOTTHERE.TXT; as input
-RMS-E-FNF, file not found
%DCL-E-OPENIN, error opening TEST$DISK:[AAA]NOTTHERE.TXT; as input
-RMS-E-FNF, file not found
%DCL-W-UNDFIL, file has not been opened by DCL - check logical name
DEFINE/USER creates a logical name that disappears when the next image exits.
So if you use that just before a command just to protect that command, then fine.
Otherwise I would prefer SET MESSAGE to control the output.
And of course yoy want to grab $STATUS and verify it after the command for success or for the expected error, reporting any unexpected error.
Better still... if you expect certain error conditions to occur,
then why not test for them?
For example:
$ file = F$SEARCH("TEST$DISK:[AAA]NOTTHERE.TXT")
$ IF file.NES."" THEN TYPE 'file'
Cheers,
Hein
To suppress Error message inside a script. try this command
$ DEFINE/USER SYS$ERROR NL:
NL: is a null device, so you don`t see any error messages displayed on your terminal.
good luck
This works interactively and in batch.
$ SET MESSAGE /NOTEXT /NOSEV /NOFAC /NOID
$ <DCL_Command>
$ SET MESSAGE /TEXT /SEV /FAC/ ID

Bad spawn_id while executing expect command

I am writing a script that will copy Valgrind onto whatever shelf that we enter on the command line. The syntax is as follows:
vgrindCopy [shelf number]
For some reason, the files will copy over without any issue, but after the copy completes the follow error is observed:
bad spawn_id (process died earlier?)
while executing
"expect "#""
Here is a copy of the relevant code:
function login_shelf {
expect -c "
set timeout 15
spawn $1
expect \"password:\"
send \"$PW\r\"
expect \"#\"
sleep 1
exit
"
}
# login and make the valgrind directory at /sfs/software/shelf/current
set -- /opt/swe/tools/ext/gnu/valgrind-3.7.0/i686-linux2.6/lib/valgrind/*
login_shelf "/opt/corp/projects/shelftools/bin/app rsync -Lau $* $shelf:/shelf/valgrind"
After playing around with the code, I found that if I remove the line "expect \"#\"", then the program doesn't copy any of the files over anymore. What odd as well is that I'm seeing the issue when I run the script, but a co-worker is not.
Has anyone had a similar issue and determined the cause? Any help would be greatly appreciated as always!
Your code is spawning the rsync and at the expect \"#\" is waiting for rsync to output a #, which it never does, so it exits and expect reports the error.
When you remove the expect \"#\" the expect script exits, terminating the rsync.
Instead of expect \"#\" you should wait for rsync to exit:
expect eof
wait