Haxe and NME crash: "error creating pch" - haxe

When I try to compile to cpp on OSX Lion with Haxe and NME, I get the following backtrace:
[...many lines above this one omitted...]
Called from ? line 1
Called from BuildTool.hx line 1265
Called from BuildTool.hx line 554
Called from a C function
Called from BuildTool.hx line 591
Called from BuildTool.hx line 710
Called from BuildTool.hx line 739
Called from BuildTool.hx line 153
Uncaught exception - Error creating pch: 256 - build cancelled
How can I fix this error?

Running the following command solved the problem for me:
sudo cp /usr/lib/haxe/lib/nme/3,4,3/ndll/Mac/tls.ndll /usr/lib/neko/tls.ndll
Appears to be a bug on Haxe's part, but until it is resolved, this should fix the problem.

Related

python tests using robot framework

Does anyone have a good example of testing a python program using Robot Framework.
I am trying to run my python program (chaptermarkers.py) with an argument of --test and checking the results.
Passing the argument has been an odyssey of google searches for 2 days.
[file: common_resourses.robot]
*** Settings ***
Library OperatingSystem
*** Variables ***
${CHAPTERMARKERS_EXEC} chaptermarkers
${LOG LEVEL} DEBUG
*** Keywords ***
# TODO
[Test Cases: file: default_suite.robot]
*** Settings ***
Documentation *Test Chapter Markers runs but has error in filename*
Metadata Github https://github.com/cbitterfield/chaptermarkers
Metadata Version 1.0.0
Metadata Executed At ${HOST}
# External libraries imports
Library Process
Library String
Resource common_resources.robot
*** Variables ***
${EXPECTED_MESSAGE} Movie Filename
${REPORT FILE} report.html
${LOG FILE} logfile.html
${LOG LEVEL} DEBUG
${OUTPUT DIR} /Users/colin/IdeaProjects/chaptermarkers
${test} --test
*** Test Cases ***
Scenerio test chaptermarkers run
[Tags] DEBUG
[Documentation] Verifies that chaptermarkers is executed well and without errors
${result}= Run process ${CHAPTERMARKERS_EXEC} ${test}
Should Contain ${result.stdout} ${EXPECTED_MESSAGE}
Should Be Empty ${result.stderr}
No matter how I try to put something after the program, I get an error of directory missing.
[Crazy unusable error messages]
$ robot --loglevel DEBUG --log log.html --report report.html stests/default_suite.robot
[ ERROR ] Error in file '/Users/colin/IdeaProjects/chaptermarkers/stests/default_suite.robot' on line 25: Invalid variable name '${test} --test'.
==============================================================================
Default Suite :: *Test Chapter Markers runs but has error in filename*
==============================================================================
Scenerio test chaptermarkers run :: Verifies that chaptermarkers i... | FAIL |
Variable '${test}' not found. Did you mean:
${TEST_TAGS}
${TEST_NAME}
------------------------------------------------------------------------------
Default Suite :: *Test Chapter Markers runs but has error in filen... | PASS |
0 critical tests, 0 passed, 0 failed
1 test total, 0 passed, 1 failed
==============================================================================
Output: /Users/colin/IdeaProjects/chaptermarkers/output.xml
[ ERROR ] Unexpected error: FileNotFoundError: [Errno 2] No such file or directory: '/Users/colin/IdeaProjects/chaptermarkers/env/lib/python3.8/site-packages/robot/htmldata/rebot/log.html'
Traceback (most recent call last):
File "/Users/colin/IdeaProjects/chaptermarkers/env/lib/python3.8/site-packages/robot/utils/application.py", line 83, in _execute
rc = self.main(arguments, **options)
File "/Users/colin/IdeaProjects/chaptermarkers/env/lib/python3.8/site-packages/robot/run.py", line 451, in main
writer.write_results(settings.get_rebot_settings())
File "/Users/colin/IdeaProjects/chaptermarkers/env/lib/python3.8/site-packages/robot/reporting/resultwriter.py", line 65, in write_results
self._write_log(results.js_result, settings.log, config)
File "/Users/colin/IdeaProjects/chaptermarkers/env/lib/python3.8/site-packages/robot/reporting/resultwriter.py", line 79, in _write_log
self._write('Log', LogWriter(js_result).write, path, config)
File "/Users/colin/IdeaProjects/chaptermarkers/env/lib/python3.8/site-packages/robot/reporting/resultwriter.py", line 86, in _write
writer(path, *args)
File "/Users/colin/IdeaProjects/chaptermarkers/env/lib/python3.8/site-packages/robot/reporting/logreportwriters.py", line 43, in write
self._write_file(path, config, LOG)
File "/Users/colin/IdeaProjects/chaptermarkers/env/lib/python3.8/site-packages/robot/reporting/logreportwriters.py", line 36, in _write_file
writer.write(template)
File "/Users/colin/IdeaProjects/chaptermarkers/env/lib/python3.8/site-packages/robot/htmldata/htmlfilewriter.py", line 33, in write
for line in HtmlTemplate(template):
File "/Users/colin/IdeaProjects/chaptermarkers/env/lib/python3.8/site-packages/robot/htmldata/normaltemplate.py", line 28, in __iter__
with codecs.open(self._path, encoding='UTF-8') as file:
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/codecs.py", line 905, in open
file = builtins.open(filename, mode, buffering)
(env) razzamataz:chaptermarkers colin$
A few things I noticed:
There needs to be at least two spaces between ${test} and --test in your variables section. You provided only one. The same in the Run Process line, there should be at least two spaces between exec and argument. The rule is that RF uses two spaces as delimiter.
Your test name is indented. RF inteprets it as a keyword calling which is unexpected. It should start from the begining of the line without indent
The file missing error looks weired and I don't know the reason. The file is part of RF library and if you installed RF correctly, it should be there. I suggest that you start a new virtual environment and try again if it's not too complex.
P.S. Just FYI, all RF buil-in libraries can be found here:
https://robotframework.org/#libraries.

For the IPython run magic the option to ignore SystemExist doesn't seem to work with modules

The docs for the %run magic -e option state:
ignore sys.exit() calls or SystemExit exceptions in the script being
run. This is particularly useful if IPython is being used to run
unittests, which always exit with a sys.exit() call. In such cases you
are interested in the output of the test results, not in seeing a
traceback of the unittest module.
This works when running scripts but doesn't seem to work when running modules.
So when I type %run -e -m pytest I still get a traceback when a test fails due the SystemExit thrown by pytest which is case mentioned in the docs above that -e is meant to address. I know I can type !pytest but I don't want to wait until pytest completed before I start to see results, and I also want to add the current directory to to module search path.
I am running IPython within Spyder but the behaviour is the same if I run IPython from the Windows command prompt. I there any way of doing what I want and avoiding the distracting traceback?
I ran the following test with %run -m pytest from the spyder ipython console
import pytest
def test_fail():
assert 0
The output was:
============================= test session starts =============================
platform win32 -- Python 3.7.7, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
rootdir: D:\home\shane\temp\pytest
collected 1 item
test_dummy.py F [100%]
================================== FAILURES ===================================
__________________________________ test_fail __________________________________
def test_fail():
> assert 0
E AssertionError
test_dummy.py:21: AssertionError
=========================== short test summary info ===========================
FAILED test_dummy.py::test_fail - AssertionError
============================== 1 failed in 0.03s ==============================
Traceback (most recent call last):
File "c:\opt\python37\lib\runpy.py", line 205, in run_module
return _run_module_code(code, init_globals, run_name, mod_spec)
File "c:\opt\python37\lib\runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "c:\opt\python37\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "c:\opt\python37\lib\site-packages\pytest\__main__.py", line 7, in <module>
raise SystemExit(pytest.main())
SystemExit: ExitCode.TESTS_FAILED

How to handle a segmentation fault occurred in python

I have written a piece of code that checks in a system if there is a new entry in the database or not if a new entry is found it will fetch the data and client will try to send it to the server ... but if data is continuously found in every execution of threading.timer cycle it will try to send it to the server...
Now issue is if the server is unreachable then it will print that server is not alive etc. if this cycle goes for few minutes the script just crash and it shows Segmentation Fault ... i want to handle this exception and wanted to process something if Segmentation fault occurs
working environment:
linux
python3
sql-server
EDIT
This is what shows after script gets crashed...
Fatal Python error: Segmentation fault
Thread 0xb3dff460 (most recent call first):
File "/usr/lib/python3.4/threading.py", line 294 in wait File "/usr/lib/python3.4/threading.py", line 553 in wait File "/usr/lib/python3.4/threading.py", line 1184 in run File "/usr/lib/python3.4/threading.py", line 920 in _bootstrap_inner File "/usr/lib/python3.4/threading.py", line 888 in _bootstrap
Current thread 0xb33ff460 (most recent call first):
File "abc.py", line 343 in send_to_server
File "abc.py", line 244 in sql_connect1
File "/usr/lib/python3.4/threading.py", line 1186 in run
File "/usr/lib/python3.4/threading.py", line 920 in _bootstrap_inner
File "/usr/lib/python3.4/threading.py", line 888 in _bootstrap
Thread 0xb45ff460 (most recent call first):
File "abc.py", line 408 in send_to_server
File "abc.py", line 244 in sql_connect1
File "/usr/lib/python3.4/threading.py", line 1186 in run
File "/usr/lib/python3.4/threading.py", line 920 in _bootstrap_inner
File "/usr/lib/python3.4/threading.py", line 888 in _bootstrap
Thread 0xb4fff460 (most recent call first):
File "abc.py", line 343 in send_to_server
File "abc.py", line 244 in sql_connect1
File "/usr/lib/python3.4/threading.py", line 1186 in run
File "/usr/lib/python3.4/threading.py", line 920 in _bootstrap_inner
File "/usr/lib/python3.4/threading.py", line 888 in _bootstrap
Thread 0xb6f39300 (most recent call first):
File "/usr/lib/python3.4/threading.py", line 1076 in _wait_for_tstate_lock
File "/usr/lib/python3.4/threading.py", line 1060 in join
File "/usr/lib/python3.4/threading.py", line 1294 in _shutdown
Segmentation fault
well i didn't know a segmentation fault was even possible, a segmentation fault mean that somwhere you go too far in the memory to a place that is not mapped.
you should note the line where it is said the problem originally happened and check the lines.
It's hard to say, but :
you are using python3.4, but we don't know the exact version, so maybe upgrading to the last version of 3.4 (or better, upgrading to 3.6 or 3.7) could help.
we also don't know what version of pyodbc you are using. Maybe this bug has been resolved. But there are several seg fault reported in github
we don't see you're code. Maybe you make use of the driver incorrectly (can't see why but...)

Debugging Node.js express app

TypeError: Cannot call method 'get' of undefined
at C:\Users\denman\workspace-nodejs\ExpressNodeUpAndRunning\app.js:112:25
I am trying to find out the line number of the error...
is 112 the line number of the app.js file where the error occurred? Then what is 25?
The 3 components are sourceFilePath:lineNumber:columnNumber.
So the error occurs on line 112, at column 25.

"Fatal error" inside V8 during GC when using node-fibers in node.js

I'm running into a fatal error reported by V8 when running the following program:
var Fiber = require("fibers");
Fiber(function () {});
global.gc();
The command used to run it:
> node --expose-gc scratch.js
The text of the fatal error is as follows:
#
# Fatal error in ..\..\src\global-handles.cc, line 99
# CHECK(state_ != FREE) failed
#
I'm using the following versions:
node 0.10.25 x86 (built with vcbuild x86 Debug using VC2013)
node-fibers 1.0.1 taken from the GitHub repo (not npmjs)
The assertion failure happens below the gc() call. Here's a call stack from the GC callback calling back into fibers right down to the ASSERT statement:
node.exe!v8::internal::GlobalHandles::Node::Release(v8::internal::GlobalHandles * global_handles) Line 99 C++
node.exe!v8::internal::GlobalHandles::Destroy(v8::internal::Object * * location) Line 431 C++
node.exe!v8::V8::DisposeGlobal(v8::internal::Object * * obj) Line 680 C++
node.exe!v8::Persistent<v8::Object>::Dispose() Line 4241 C++
fibers.node!Fiber::`scalar deleting destructor'(unsigned int) C++
fibers.node!Fiber::WeakCallback(void * data) Line 235 C++
fibers.node!uni::WeakCallbackShim<&Fiber::WeakCallback>(v8::Persistent<v8::Value> value, void * data) Line 111 C++
node.exe!v8::internal::GlobalHandles::Node::PostGarbageCollectionProcessing(v8::internal::Isolate * isolate, v8::internal::GlobalHandles * global_handles) Line 233 C++
This fatal error doesn't come up in the Release version of node. However, it appears to subtly corrupt the V8 engine and it ultimately fails a little bit down the line in a random piece of code.
Right now, the only workaround I've come up with is to leak fibers so that this piece of code is never hit. Am I doing something particularly wrong or is this a bug in fibers?
The bug is now apparently fixed by this commit:
https://github.com/laverdet/node-fibers/commit/3e154941ba5c3234752af304defcf028107e5557
src/fibers.cc
## -231,7 +231,6 ## class Fiber {
return;
}
- that.handle.Dispose();
delete &that;
}

Resources