"Output file stream not open": Error while running SE for X86 using gem5 - gem5

I'm trying to run a SE simulation for x86 platform. Whenever I run the sample command on the website, but it doesn't work
The error log is as follows:
gem5.opt: build/X86/base/output.cc:93: OutputFile<StreamType>::OutputFile(const OutputDirectory&, const string&, std::ios_base::openmode, bool) [with StreamType = std::basic_ofstream<char>; std::__cxx11::string = std::__cxx11::basic_string<char>; std::ios_base::openmode = std::_Ios_Openmode]: Assertion `_fstream->is_open()' failed.
Program aborted at tick 0
--- BEGIN LIBC BACKTRACE ---
build/X86/gem5.opt(_Z15print_backtracev+0x15)[0x16d8065]
build/X86/gem5.opt(_Z12abortHandleri+0x39)[0x16e8989]
/lib64/libpthread.so.0[0x390200f7e0]
/lib64/libc.so.6(gsignal+0x35)[0x3901832495]
/lib64/libc.so.6(abort+0x175)[0x3901833c75]
/lib64/libc.so.6[0x390182b60e]
/lib64/libc.so.6(__assert_perror_fail+0x0)[0x390182b6d0]
build/X86/gem5.opt(_ZN15OutputDirectory4openERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt13_Ios_Openmodebb+0x281)[0xa8ed01]
build/X86/gem5.opt(_ZN5Stats8initTextERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb+0x3f)[0xaaef9f]
build/X86/gem5.opt[0x16bdde0]
build/X86/gem5.opt[0x99f9e1]
build/X86/gem5.opt(PyEval_EvalFrameEx+0x7cf3)[0x180e6e3]
build/X86/gem5.opt(PyEval_EvalCodeEx+0x89c)[0x180ff6c]
build/X86/gem5.opt[0x188502e]
build/X86/gem5.opt(PyObject_Call+0x3a)[0x177e29a]
build/X86/gem5.opt(PyEval_EvalFrameEx+0xe76)[0x1807866]
build/X86/gem5.opt(PyEval_EvalCodeEx+0x89c)[0x180ff6c]
build/X86/gem5.opt(PyEval_EvalFrameEx+0x6318)[0x180cd08]
build/X86/gem5.opt(PyEval_EvalFrameEx+0x641a)[0x180ce0a]
build/X86/gem5.opt(PyEval_EvalCodeEx+0x89c)[0x180ff6c]
build/X86/gem5.opt(PyEval_EvalFrameEx+0x6318)[0x180cd08]
build/X86/gem5.opt(PyEval_EvalCodeEx+0x89c)[0x180ff6c]
build/X86/gem5.opt(PyEval_EvalCode+0x19)[0x1810059]
build/X86/gem5.opt(PyRun_StringFlags+0xf5)[0x1837db5]
build/X86/gem5.opt(_Z6m5MainiPPc+0x5f)[0x16e74bf]
build/X86/gem5.opt(main+0x38)[0x7410d8]
/lib64/libc.so.6(__libc_start_main+0xfd)[0x390181ed1d]
build/X86/gem5.opt[0x766d31]
--- END LIBC BACKTRACE ---
Abort

Related

Catching snakemake runtime errors with onerror

I'm working on a bioinformatics pipeline and one of the rule is to perform genome assembly using SPAdes (https://github.com/ablab/spades):
rule perform_de_novo_assembly_using_spades:
input:
bam = input.bam
output:
spades_contigs = directory(_RESULTS_DIR + "assembled_spades/")
threads:
_NBR_CPUS
run:
out_dir = _RESULTS_DIR + "assembled_spades/"
command = "spades.py -t " + str(threads) + " --12 " + input.bam + " -o " + out_dir
shell(command + " || true")
... More rules
onsuccess: print("Pipeline completed successfully!")
onerror: print("One or more errors occurred. Please refer to log file.")
The problem is sometimes for some problematic input files SPAdes can fail, resulting in my workflow being terminated. Therefore I added " || true " to the shell command to run SPAdes (according to this post: What would be an elegant way of preventing snakemake from failing upon shell/R error?) so that workflow will continue despite SPAdes failing. However right now my pipeline will run and still gives the "Pipeline completed successfully!" onsuccess message at the end. Ideally I want to it to print the onerror message "One or more errors occurred. Please refer to log file." Is there a way to make my workflow continue to the end despite SPAdes giving a runtime error and snakemake catching the error so that it displays the onerror message at the end?

Why I am getting SQL_NO_DATA_FOUND error while I am executing following code section?

CODE:
This code runs successfully on a Windows machine. But it isn't working on a Linux machine. It does not perform any operation.
ret = SQLFetch(hstmt)
if (ret == SQL_SUCCESS_WITH_INFO)
ret = SQL_SUCCESS;
When I execute this code, I get the error SQL_NO_DATA_FOUND. Why am I getting this error? what is SQLFetch() and what is its functionality?

Import class-dump info into LLDB

This question is basically a clone of Import class-dump info into GDB, but with LLDB instead of GDB.
Using the method described in the answer to the question mentioned above, I am able to create symbol file containing the symbols called test.stabs.
To import and use this info in LLDB, I tried to do the following:
$ lldb test
(lldb) target module add test.stabs
(lldb) b +[TestClass randomNum]
Breakpoint 1: where = test.stabs`+[TestClass randomNum]:F(0,1), address = 0x0000000100000ed0
As you can see LLDB can load the address, but when actually running the target, LLDB doesn't break:
(lldb) r
Process 40430 launched: '/Users/Tyilo/test' (x86_64)
num: 4
Process 40430 exited with status = 0 (0x00000000)
You could of course specify the address of the breakpoint directly:
(lldb) b -a 0x0000000100000ed0
and it will work.
Is there a way of making the breakpoint sat by b +[TestClass randomNum] work in LLDB?
I've made a python function that can be used to achieve what I want, however it only works if the program is running. Save the code below as break_message.py and import it into lldb by running command script import break_message.py. Now you can use it like so:
$ lldb -p $(pgrep Finder)
(lldb) command script import break_message.py
(lldb) break_message -[TApplicationController cmdEmptyTrash:]
(lldb) continue
Now open your Trash in Finder and empty it (put something in it if it's already empty). The breakpoint will be hit in lldb.
import lldb
import re
def lldb_run(command):
res = lldb.SBCommandReturnObject()
lldb.debugger.GetCommandInterpreter().HandleCommand(command, res)
return res
def lldb_call(command):
res = lldb_run('call ' + command)
out = res.GetOutput()
r = re.compile(r'^[^=]*= (.*)\n$')
m = r.search(out)
return m.groups()[0]
def __lldb_init_module(debugger, internal_dict):
lldb_run('command script add -f break_message.{0} {0}'.format('break_message'))
def break_message(debugger, command, result, internal_dict):
r = re.compile(r'([+-])\s*\[\s*(\S+)\s+([^\]]+)\]')
m = r.search(command)
if not m:
print 'Error in message format!'
return
typ, cls, sel = m.groups()
sel = re.sub(r'\s+', '', sel)
meta = typ == '+'
clsptr = lldb_call('(id)objc_getClass("{}")'.format(cls))
if clsptr == 'nil':
print "Couldn't find class: " + cls
return
selptr = lldb_call('(id)sel_registerName("{}")'.format(sel))
if selptr == 'nil':
print "Couldn't register selector: " + sel
return
func = 'class_getClassMethod' if meta else 'class_getInstanceMethod'
method = lldb_call('(id){}({}, {})'.format(func, clsptr, selptr))
if method == 'nil':
print "Couldn't find method for: " + sel
return
imp = lldb_call('(id)method_getImplementation({})'.format(method))
lldb_run('breakpoint set -a {}'.format(imp))
lldb thinks the name of your method is +[TestClass randomNum]:F(0,1)? The name of your file, test.stabs, makes me think that it has been constructed with stabs debug info -- that looks like stabs.
lldb doesn't know anything about the stabs debug format -- and you can't even generate it with clang -- we use DWARF for everything on Mac OS X and iOS. You would probably have more success stripping the stabs debug info out of your binary entirely (see the strip(1)) command - lldb wouldn't be distracted by it then.

Passing Argument to Specific Function in STAX Job Using Command Line

I have a STAX Job new15.xml inside /home/dharm/staf/services/stax/samples location.
new15.xml have two function main and readFile
file_name = '/home/dharm/datafiles/ReadData3.txt'
Required Argument for readFile is file_name.
I want to execute this command using command line but i also want to give required parameter to readFile function.
staf local execute file /home/dharm/staf/services/stax/samples/new15.xml wait return result
What are the modification i should do in command to make it work.
"What I have Trierd"
FIRST
dharm#ubuntu:~$ staf local stax execute file /home/dharm/staf/services/stax/samples/new15.xml ARGS file_name="'/home/dharm/datafiles/ReadData3.txt'" wait returnresult
Response
--------
{
Job ID : 3
Start Date-Time: 20130418-23:54:39
End Date-Time : 20130418-23:54:40
Status : Terminated
Result : None
Job Log Errors : [
{
Date-Time: 20130418-23:54:40
Level : Error
Message : STAXPythonEvaluationError signal raised. Terminating job.
===== XML Information =====
File: /home/dharm/staf/services/stax/samples/new15.xml, Machine: local://local
Line <Error in ARGS option>: Error in element type "<External>".
===== Python Error Information =====
com.ibm.staf.service.stax.STAXPythonEvaluationException:
Python object evaluation failed for:
file_name='/home/dharm/datafiles/ReadData3.txt'
SyntaxError: ("mismatched input '=' expecting EOF", ('<pyEval string>', 1, 9, "file_name='/home/dharm/datafiles/ReadData3.txt'\n"))
===== Call Stack for STAX Thread 1 =====
[]
}
]
Testcase Totals: {
Tests : 0
Passes: 0
Fails : 0
}
}
"2ND Command"
dharm#ubuntu:~$ staf local stax execute file /home/dharm/staf/services/stax/samples/new15.xml SCRIPT file_name="'/home/dharm/datafiles/ReadData3.txt'" wait returnresult
Response
--------
{
Job ID : 4
Start Date-Time: 20130418-23:56:01
End Date-Time : 20130418-23:56:02
Status : Terminated
Result : None
Job Log Errors : [
{
Date-Time: 20130418-23:56:02
Level : Error
Message : STAXFunctionArgValidate signal raised. Terminating job.
===== XML Information =====
File: /home/dharm/staf/services/stax/samples/new15.xml, Machine: local://local
Line 20: Error in element type "call".
Required argument "file_name" is not provided in the call to function "readFile".
===== Call Stack for STAX Thread 1 =====
[
function: main (Line: 19, File: /home/dharm/staf/services/stax/samples/new15.xml, Machine: local://local)
]
}
]
Testcase Totals: {
Tests : 0
Passes: 0
Fails : 0
}
}

Which processes can be launched using performTaskWithPathArgumentsTimeout function?

I use UIAutomation to automate an iPad application. I have tried to use
(object) performTaskWithPathArgumentsTimeout(path, args, timeout) to run Safari.app from my script:
var target = UIATarget.localTarget();
var host = target.host();
var result = host.performTaskWithPathArgumentsTimeout("/Applications/Safari.app", ["http://www.google.com"], 30);
UIALogger.logDebug("exitCode: " + result.exitCode);
UIALogger.logDebug("stdout: " + result.stdout);
UIALogger.logDebug("stderr: " + result.stderr);
I got the following results:
exitCode: 5
stdout:
stderr:
I’ve also tried to launch echo:
var target = UIATarget.localTarget();
var host = target.host();
var result = host.performTaskWithPathArgumentsTimeout("/bin/echo", ["Hello
World"], 5);
UIALogger.logDebug("exitCode: " + result.exitCode);
UIALogger.logDebug("stdout: " + result.stdout);
UIALogger.logDebug("stderr: " + result.stderr);
Results:
exitCode: 0
stdout: Hello World
stderr:
So, looks like performTaskWithPathArgumentsTimeout works for specific applications only.
Could you please help me to answer the following questions:
1. What does exitCode = 5 mean?
2. Which processes can be launched using performTaskWithPathArgumentsTimeout function?
1) Exit code 5 is most likely EIO, as defined in : Input/Output error. You're attempting to execute "/Applications/Safari.app", which to the launching task is a directory and not a binary.
2) You can launch any application with performTaskWithPathArgumentsTimeout() that NSTask can launch. As long as it's a valid executable, it should work.
For your specific example though, Safari won't accept an argument passed on the command line like that as a URL to visit. You need to use open /Applications/Safari.app "http://www.google.com" instead:
var result = host.performTaskWithPathArgumentsTimeout("/usr/bin/open", ["/Applications/Safari.app", "http://www.google.com"], 30);