Code Monkey home page Code Monkey logo

cogserver's Issues

python printing is broken

Printing to the python shell is broken. This got broken by pull request opencog/opencog#2311, the refactoring of the network code is not yet complete.

Tor reproduce: telnetto the cogserver, enter the python shell, and execute any python code -- nothing is printed.

"make tests" fails to build PyEvalUTest

I'm packaging cogserver for GNU Guix and found that make tests fails to build PyEvalUTest. Note that I'm building in an environment that only contains Python, but not Cython.

It seems to me that the tests for Python functionality ought to be disabled when the Python bindings have not been built.

Here's the tail of the build log:

[ 88%] Building CXX object tests/cython/CMakeFiles/PyEvalUTest.dir/PyEvalUTest.cpp.o
cd /tmp/guix-build-cogserver-0-1.c8ad85f.drv-0/build/tests/cython && /gnu/store/x3jx25cd3q363mr7nbgzrhrv1vza6cf7-gcc-7.4.0/bin/c++  -DCONFDIR=\"/gnu/store/16c6l18g5yilphb1rnyc3nwijf1azf6w-cogserver-0-1.c8ad85f/etc\" -DDATADIR=\"/gnu/store/16c6l18g5yilphb1rnyc3nwijf1azf6w-cogserver-0-1.c8ad85f/share/opencog\" -DGUILE_SITE_DIR=\"/gnu/store/16c6l18g5yilphb1rnyc3nwijf1azf6w-cogserver-0-1.c8ad85f/share/guile/site/2.2/\" -DHAVE_ATOMSPACE -DHAVE_COGUTIL -DHAVE_GUILE -DHAVE_GUILE2 -DHAVE_GUILE_2_2 -DPROJECT_BINARY_DIR=\"/tmp/guix-build-cogserver-0-1.c8ad85f.drv-0/build\" -DPROJECT_SOURCE_DIR=\"/tmp/guix-build-cogserver-0-1.c8ad85f.drv-0/source\" -I/gnu/store/1mkkv2caiqbdbbd256c4dirfi4kwsacv-guile-2.2.6/include/guile/2.2 -I/tmp/guix-build-cogserver-0-1.c8ad85f.drv-0/source -I/gnu/store/f5g4av3mwn7zr81yqr1gn9hpb5d2c4m4-boost-1.70.0/include -I/gnu/store/ifsrj0bbpvq3rayq86nr778y3f50li0n-cogutil-2.0.3-1.b07b41b/include -I/gnu/store/d4mbj5yqszdg9rxf6h12jyvyn0hgx3m5-atomspace-5.0.3-1.ed1d316/include -I/tmp/guix-build-cogserver-0-1.c8ad85f.drv-0/build -I/gnu/store/x5fj048bvqpafb07dpidy36fj7l3qfnx-python-minimal-3.7.4/include/python3.7m -I/tmp/guix-build-cogserver-0-1.c8ad85f.drv-0/source/tests/cython  -Wall -fPIC -Wno-variadic-macros -fopenmp -std=gnu++11 -O2 -g -DNDEBUG   -o CMakeFiles/PyEvalUTest.dir/PyEvalUTest.cpp.o -c /tmp/guix-build-cogserver-0-1.c8ad85f.drv-0/build/tests/cython/PyEvalUTest.cpp
In file included from /tmp/guix-build-cogserver-0-1.c8ad85f.drv-0/build/tests/cython/../../../source/tests/cython/PyEvalUTest.cxxtest:6:0,
                 from /tmp/guix-build-cogserver-0-1.c8ad85f.drv-0/build/tests/cython/PyEvalUTest.cpp:24:
/tmp/guix-build-cogserver-0-1.c8ad85f.drv-0/source/opencog/cogserver/modules/python/PyMindAgent.h:13:10: fatal error: opencog/cython/PyIncludeWrapper.h: No such file or directory
 #include <opencog/cython/PyIncludeWrapper.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[3]: *** [tests/cython/CMakeFiles/PyEvalUTest.dir/build.make:70: tests/cython/CMakeFiles/PyEvalUTest.dir/PyEvalUTest.cpp.o] Error 1
make[3]: Leaving directory '/tmp/guix-build-cogserver-0-1.c8ad85f.drv-0/build'
make[2]: *** [CMakeFiles/Makefile2:856: tests/cython/CMakeFiles/PyEvalUTest.dir/all] Error 2
make[2]: Leaving directory '/tmp/guix-build-cogserver-0-1.c8ad85f.drv-0/build'
make[1]: *** [CMakeFiles/Makefile2:129: CMakeFiles/tests.dir/rule] Error 2
make[1]: Leaving directory '/tmp/guix-build-cogserver-0-1.c8ad85f.drv-0/build'
make: *** [Makefile:202: tests] Error 2

Test suite failed, dumping logs.
command "make" "tests" failed with status 2

make check fails trying to find PyIncludeWrapper.h

This was previously reported at #24

As of commit a932b22 this is still a problem. make check aborts like this:

...
[ 88%] Building CXX object tests/cython/CMakeFiles/PyEvalUTest.dir/PyEvalUTest.cpp.o
cd /tmp/guix-build-cogserver-0-2.a932b22.drv-0/build/tests/cython && /gnu/store/x3jx25cd3q363mr7nbgzrhrv1vza6cf7-gcc-7.4.0/bin/c++  -DCONFDIR=\"/gnu/store/90b5vm87vlwar6w8g3hcmmm9i4md5md5-cogserver-0-2.a932b22/etc\" -DDATADIR=\"/gnu/store/90b5vm87vlwar6w8g3hcmmm9i4md5md5-cogserver-0-2.a932b22/share/opencog\" -DGUILE_SITE_DIR=\"/gnu/store/90b5vm87vlwar6w8g3hcmmm9i4md5md5-cogserver-0-2.a932b22/share/guile/site/2.2/\" -DHAVE_ATOMSPACE -DHAVE_COGUTIL -DHAVE_GUILE -DHAVE_GUILE2 -DHAVE_GUILE_2_2 -DPROJECT_BINARY_DIR=\"/tmp/guix-build-cogserver-0-2.a932b22.drv-0/build\" -DPROJECT_SOURCE_DIR=\"/tmp/guix-build-cogserver-0-2.a932b22.drv-0/source\" -I/gnu/store/1mkkv2caiqbdbbd256c4dirfi4kwsacv-guile-2.2.6/include/guile/2.2 -I/tmp/guix-build-cogserver-0-2.a932b22.drv-0/source -I/gnu/store/f5g4av3mwn7zr81yqr1gn9hpb5d2c4m4-boost-1.70.0/include -I/gnu/store/ifsrj0bbpvq3rayq86nr778y3f50li0n-cogutil-2.0.3-1.b07b41b/include -I/gnu/store/xs9biw1wpwjjp42v5806s1jrzhk76h4c-atomspace-5.0.3-1.86c848d/include -I/tmp/guix-build-cogserver-0-2.a932b22.drv-0/build -I/gnu/store/x5fj048bvqpafb07dpidy36fj7l3qfnx-python-minimal-3.7.4/include/python3.7m -I/tmp/guix-build-cogserver-0-2.a932b22.drv-0/source/tests/cython  -Wall -fPIC -Wno-variadic-macros -fopenmp -std=gnu++11 -O2 -g -DNDEBUG   -o CMakeFiles/PyEvalUTest.dir/PyEvalUTest.cpp.o -c /tmp/guix-build-cogserver-0-2.a932b22.drv-0/build/tests/cython/PyEvalUTest.cpp
In file included from /tmp/guix-build-cogserver-0-2.a932b22.drv-0/build/tests/cython/../../../source/tests/cython/PyEvalUTest.cxxtest:6:0,
                 from /tmp/guix-build-cogserver-0-2.a932b22.drv-0/build/tests/cython/PyEvalUTest.cpp:24:
/tmp/guix-build-cogserver-0-2.a932b22.drv-0/source/opencog/cogserver/modules/python/PyMindAgent.h:13:10: fatal error: opencog/cython/PyIncludeWrapper.h: No such file or directory
 #include <opencog/cython/PyIncludeWrapper.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[3]: *** [tests/cython/CMakeFiles/PyEvalUTest.dir/build.make:70: tests/cython/CMakeFiles/PyEvalUTest.dir/PyEvalUTest.cpp.o] Error 1
make[3]: Leaving directory '/tmp/guix-build-cogserver-0-2.a932b22.drv-0/build'
make[2]: *** [CMakeFiles/Makefile2:856: tests/cython/CMakeFiles/PyEvalUTest.dir/all] Error 2
make[2]: Leaving directory '/tmp/guix-build-cogserver-0-2.a932b22.drv-0/build'
make[1]: *** [CMakeFiles/Makefile2:129: CMakeFiles/tests.dir/rule] Error 2
make[1]: Leaving directory '/tmp/guix-build-cogserver-0-2.a932b22.drv-0/build'
make: *** [Makefile:202: tests] Error 2

Test suite failed, dumping logs.
command "make" "tests" failed with status 2

I'm building in an isolated environment using GNU Guix. The environment contains atomspace, boost, cogutil, gmp, Guile 2.2, cxxtest, Python 3, and pkg-config (in addition to the GCC 7 toolchain).

Python 3 is checked for during the configure phase. I would not include it in the environment if it was possible to configure without it.

encounter missing install target

try to build cogserver follow the procedures written in readme.md:
scrooge@scrooge-X455LD:~/cogserver/build$ cmake ..
-- Build type: Release
-- CogUtil found.
-- AtomSpace found.
-- Boost version: 1.58.0
-- Found the following Boost libraries:
-- date_time
-- filesystem
-- program_options
-- regex
-- serialization
-- system
-- thread
-- chrono
-- atomic
-- Boost version 105800 found.
-- Guile (2.2.3 >= 2.2.2) was found.
-- Python 3.5.2 interpreter found.
-- Python 3.5.2 libraries found.
-- Cython ( 0.23.5 >= 0.23.0) found.
-- Python destination dir found: /usr/local/lib/python3.5/dist-packages
-- Python install dir: /usr/local/lib/python3.5/dist-packages/opencog
-- Using nosetests executable /usr/bin/nosetests3
-- Found Intel TBB

-- Found ZeroMQ library: /usr/lib/x86_64-linux-gnu/libzmq.so
-- Detected ZeroMQ version number: 4.1.4
-- ZeroMQ was found.
-- Valgrind Prefix:
-- Could NOT find VALGRIND (missing: VALGRIND_INCLUDE_DIR VALGRIND_PROGRAM)
-- VALGRIND missing: needed for thread debugging.
CMake Error at opencog/cogserver/server/CMakeLists.txt:57 (INSTALL):
install TARGETS given target "network" which does not exist in this
directory.

-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)

Building for Ubuntu 16.04.6 LTS

The following components will be built:

CogServer - CogServer network and job server.
Cython bindings - Cython (python) bindings.
Python tests - Python bindings nose tests.
Unit tests - Unit tests.

The following components WILL NOT be built:

Doxygen - Code documentation.

-- Configuring incomplete, errors occurred!
See also "/home/scrooge/cogserver/build/CMakeFiles/CMakeOutput.log".
See also "/home/scrooge/cogserver/build/CMakeFiles/CMakeError.log".

ShellUTest fails because of NumberNode formatting change

I tried to run ShellUTest locally and it looks like it fails because trailing zeroes are absent in NumberNode format. At least I don't see them in failure message but see them in example from code of the unit test. And size difference is exactly 7 symbols:

/home/vital/projects/opencog/cogserver-build/tests/shell/../../../cogserver/tests/shell/ShellUTest.cxxtest:76: Error: Expected (281 <= reso.size()), found (281 > 274)
Error: Create rep 29 of 30 in thread 16 failed
	Got: 274 >>>opencog> Entering scheme shell; use ^D or a single . on a line by itself to exit.
guile> (EvaluationLink
   (PredicateNode "visible face")
   (ListLink
      (NumberNode "26039")
   )
)

guile> 
guile> <<<

CythonServer test fails libtruthvalue.so: undefined symbol: _ZN7opencog14EvaluationLink11do_evaluateEPNS_9AtomSpaceERKNS_6HandleEb

CythonServer test fails because libtruthvalue.so uses EvaluationLink::do_evaluation method but doesn't depend on libexecution.so. See opencog/atomspace@5b1642d

5/6 Test #5: CythonServer .....................***Failed    0.32 sec
Failure: ImportError (/usr/local/lib/opencog/libtruthvalue.so: undefined symbol: _ZN7opencog14EvaluationLink11do_evaluateEPNS_9AtomSpaceERKNS_6HandleEb) ... ERROR

======================================================================
ERROR: Failure: ImportError (/usr/local/lib/opencog/libtruthvalue.so: undefined symbol: _ZN7opencog14EvaluationLink11do_evaluateEPNS_9AtomSpaceERKNS_6HandleEb)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/nose/failure.py", line 39, in runTest
    raise self.exc_val.with_traceback(self.tb)
  File "/usr/lib/python3/dist-packages/nose/loader.py", line 417, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python3/dist-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python3/dist-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/usr/lib/python3.6/imp.py", line 235, in load_module
    return load_source(name, filename, file)
  File "/usr/lib/python3.6/imp.py", line 172, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 684, in _load
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/ws/cogserver/tests/cython/server/test_agent_finder.py", line 3, in <module>
    from opencog.agent_finder import find_subclasses
ImportError: /usr/local/lib/opencog/libtruthvalue.so: undefined symbol: _ZN7opencog14EvaluationLink11do_evaluateEPNS_9AtomSpaceERKNS_6HandleEb

----------------------------------------------------------------------
Ran 1 test in 0.013s

FAILED (errors=1)

Cogserver unclean shutdown

Something about the cogserver shutdown sequence frequently leads to the error message on shutdown:

corrupted size vs. prev_size
Aborted

This happens some time after main() has exited, and has something to do with the thread shutdown. This often makes the unit tests for https://github.com/opencog/atomspace-cog/ fail.

Cogserver and attention circular dependencies?

Trying to build cogserver, I get these errors:

In file included from /home/eddie/hansonrobotics/OpenCog/cogserver/opencog/cogserver/modules/events/AtomSpacePublisherModule.cc:47:0:
/home/eddie/hansonrobotics/OpenCog/cogserver/opencog/cogserver/modules/events/AtomSpacePublisherModule.h:104:3: error: ‘AVCHSigl’ does not name a type
   AVCHSigl* _avchange_signal;
   ^
/home/eddie/hansonrobotics/OpenCog/cogserver/opencog/cogserver/modules/events/AtomSpacePublisherModule.h:107:3: error: ‘AVCHSigl’ does not name a type
   AVCHSigl* _add_af_signal;
   ^
/home/eddie/hansonrobotics/OpenCog/cogserver/opencog/cogserver/modules/events/AtomSpacePublisherModule.h:110:3: error: ‘AVCHSigl’ does not name a type
   AVCHSigl* _remove_af_signal;
   ^
/home/eddie/hansonrobotics/OpenCog/cogserver/opencog/cogserver/modules/events/AtomSpacePublisherModule.h:134:24: error: ‘AttentionValuePtr’ has not been declared
   Json::Value avToJSON(AttentionValuePtr av);
                        ^
/home/eddie/hansonrobotics/OpenCog/cogserver/opencog/cogserver/modules/events/AtomSpacePublisherModule.h:160:30: error: ‘AttentionValuePtr’ does not name a type
                        const AttentionValuePtr& av_old,
                              ^
/home/eddie/hansonrobotics/OpenCog/cogserver/opencog/cogserver/modules/events/AtomSpacePublisherModule.h:161:30: error: ‘AttentionValuePtr’ does not name a type
                        const AttentionValuePtr& av_new);
                              ^
/home/eddie/hansonrobotics/OpenCog/cogserver/opencog/cogserver/modules/events/AtomSpacePublisherModule.h:166:26: error: ‘AttentionValuePtr’ does not name a type
                    const AttentionValuePtr& av_old,
                          ^
/home/eddie/hansonrobotics/OpenCog/cogserver/opencog/cogserver/modules/events/AtomSpacePublisherModule.h:167:26: error: ‘AttentionValuePtr’ does not name a type
                    const AttentionValuePtr& av_new);
                          ^
/home/eddie/hansonrobotics/OpenCog/cogserver/opencog/cogserver/modules/events/AtomSpacePublisherModule.h:169:29: error: ‘AttentionValuePtr’ does not name a type
                       const AttentionValuePtr& av_old,
                             ^
/home/eddie/hansonrobotics/OpenCog/cogserver/opencog/cogserver/modules/events/AtomSpacePublisherModule.h:170:29: error: ‘AttentionValuePtr’ does not name a type
                       const AttentionValuePtr& av_new);
                             ^
/home/eddie/hansonrobotics/OpenCog/cogserver/opencog/cogserver/modules/events/AtomSpacePublisherModule.cc: In member function ‘void opencog::AtomSpacePublisherModule::enableSignals()’:
/home/eddie/hansonrobotics/OpenCog/cogserver/opencog/cogserver/modules/events/AtomSpacePublisherModule.cc:122:1: error: ‘ttentionValuePtr’ was not declared in this scope
 ttentionValuePtr& av_old,
 ^
/home/eddie/hansonrobotics/OpenCog/cogserver/opencog/cogserver/modules/events/AtomSpacePublisherModule.cc:122:19: error: ‘av_old’ was not declared in this scope
 ttentionValuePtr& av_old,
                   ^
/home/eddie/hansonrobotics/OpenCog/cogserver/opencog/cogserver/modules/events/AtomSpacePublisherModule.cc:123:48: error: expected primary-expression before ‘const’
                                                const AttentionValuePtr& av_new)
                                                ^
/home/eddie/hansonrobotics/OpenCog/cogserver/opencog/cogserver/modules/events/AtomSpacePublisherModule.cc:132:47: error: qualified-id in declaration before ‘(’ token
 void AtomSpacePublisherModule::TVChangedSignal(const Handle& h,
                                               ^
/home/eddie/hansonrobotics/OpenCog/cogserver/opencog/cogserver/modules/events/AtomSpacePublisherModule.cc:339:1: error: expected ‘}’ at end of input
 }
 ^

It looks to me the errors involve unrecognized types that are defined in the attention package--AttentionValuePtr and AVCHSigl

error: ‘AttentionValuePtr’ does not name a type

But cogserver is a prerequisite for the attention package--attention can't be built unless cogserver is already built

  attention/build$ cmake ..
  . . .
  CMake Error at CMakeLists.txt:180 (MESSAGE):
  CogServer missing: it is needed!

Is there a circular dependency here?

CogServer does not error on module load failure

If you launch the CogServer and it cannot load a module because it has not been installed or is not present in the module search path, there is no error. It only prints some log entries at WARN level.

To duplicate, put a module in the MODULES section of a config file. Then remove the module from the install directory.

test failed

After building cogserver, I try to write python code with import opencog.cogserver but failed with missing module named "cogserver", then I try running make test under the build folder of cogserver, then I get this:
Listening on port 17333
.
Failed 1 and Skipped 0 of 5 tests
Success rate: 80%

67% tests passed, 2 tests failed out of 6

Total Test time (real) = 182.90 sec

The following tests FAILED:
3 - PythonModuleUTest (SEGFAULT)
6 - ShellUTest (Failed)
Errors while running CTest
CMakeFiles/test.dir/build.make:57: recipe for target 'CMakeFiles/test' failed
make[3]: *** [CMakeFiles/test] Error 8
CMakeFiles/Makefile2:99: recipe for target 'CMakeFiles/test.dir/all' failed
make[2]: *** [CMakeFiles/test.dir/all] Error 2
CMakeFiles/Makefile2:106: recipe for target 'CMakeFiles/test.dir/rule' failed
make[1]: *** [CMakeFiles/test.dir/rule] Error 2
Makefile:197: recipe for target 'test' failed
make: *** [test] Error 2

during the test session:
[2019-11-17 01:23:55:930] [DEBUG] Cannot create unknown request "loadpy"
In PythonModuleUTest::testLoadExceptionAgent:
/home/scrooge/cogserver/build/tests/cython/../../../tests/cython/PythonModuleUTest.cxxtest:78: Error: Assertion failed: loadpyRequest != __null

Start 4: PyEvalUTest

4/6 Test #4: PyEvalUTest ...................... Passed 0.25 sec
Start 5: CythonServer
5/6 Test #5: CythonServer ..................... Passed 1.25 sec
Start 6: ShellUTest
6/6 Test #6: ShellUTest .......................***Failed 179.50 sec
Running cxxtest tests (5 tests)opencog> Entering scheme shell; use ^D or a single . on a line by itself to exit.

Python cogserver AWOL

Looking in the directory opencog/cython I see cogserver.pxd and cogserver.pyx (and two other pyx files) but I cannot find anything that says start_cogserver() or anything similar. Apparently, this code was somehow lost or cut during reorganization. I did a deep dive into ancient history, but could not locate it... !!??

Split up cogserver into three parts.

The cogserver is mashup of three unrelated concepts; it would probably work better if it was detangled into those components more cleanly. It is:

  • A network shell server. Like telnet, but different.
  • A command shell. Like bash, but different. With "pluggable modules" (e.g. PythonModule)
  • A cooperative-multi-tasking framework, for the cooperative scheduling of "MindAgents".

These three are currently in somewhat questionable state of repair, and it might even be very wise to re-imagine the architecture/design from the ground-up.

  • The multi-tasking ("Agents") framework is lame, and is little more than a REPL loop. The dream of the multi-tasking framework was to somehow manage tasks and set priorities for them (allocating CPU resources), but forcing all agents to be cooperative multi-taskers causes well-known issues (MS Windows3.1 and Apple OS9 from late 1980's illustrated the possibilities and the limitations very clearly.)

  • The command-shell is kind of goofy, like somebody's school project. It expects new commands to be implemented as dynamically loaded shared libraries, with a very strict API about what is and is not allowed, which makes it very hard to create high-quality modules. Giving the command shell a minimalist design would simplify it, make it work better/less awkwardly.

  • The network server is the most debugged and mostly quite stable. I would have recommended discarding it, replacing it with some other open-source project, except I once searched the internet for a drop-in replacement, and (surprisingly) found none. Maybe the world needs a generic shell-server!? Biggest problem with the network server is it provides zero authentication, zero security. (it's not obvious how to rip it out and replace it by ssh, for example)

I can kind-of see why all three components are interesting, but given the limitations, they need to be reimagined from the ground-up.

ShellUTest errors sometimes with Debug build

I get sporadic failures with ShellUTest, but have only noticed them with a Debug build.

Compiler is standard for Ubuntu 16.04 gcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609

Maybe related to opencog/opencog#2542 ? Though a cause was found and fixed in that issue.

The output is:

Start  5: ShellUTest
*** Error in `/home/joel/work/opencog/opencog/build_debug/tests/server/ShellUTest': corrupted size vs. prev_size: 0x00007f7b38000a60 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f7b5db067e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x7e9dc)[0x7f7b5db0d9dc]
/lib/x86_64-linux-gnu/libc.so.6(+0x81cde)[0x7f7b5db10cde]
/lib/x86_64-linux-gnu/libc.so.6(__libc_malloc+0x54)[0x7f7b5db13184]
/lib/x86_64-linux-gnu/libc.so.6(_IO_file_doallocate+0x55)[0x7f7b5dafc1d5]
/lib/x86_64-linux-gnu/libc.so.6(_IO_doallocbuf+0x34)[0x7f7b5db0a594]
/lib/x86_64-linux-gnu/libc.so.6(_IO_file_underflow+0x1fc)[0x7f7b5db0969c]
/lib/x86_64-linux-gnu/libc.so.6(_IO_default_uflow+0xe)[0x7f7b5db0a60e]
/lib/x86_64-linux-gnu/libc.so.6(_IO_getline_info+0xaa)[0x7f7b5dafdc6a]
/lib/x86_64-linux-gnu/libc.so.6(fgets+0xad)[0x7f7b5dafcb7d]
/home/joel/work/opencog/opencog/build_debug/tests/server/ShellUTest(_Z8cmd_execB5cxx11PKc+0x100)[0x4200a4]
/home/joel/work/opencog/opencog/build_debug/tests/server/ShellUTest(_Z11gargleblastii+0x9f)[0x4201e3]
/home/joel/work/opencog/opencog/build_debug/tests/server/ShellUTest(_ZNSt12_Bind_simpleIFPFviiEiiEE9_M_invokeIILm0ELm1EEEEvSt12_Index_tupleIIXspT_EEE+0x5a)[0x42faea]
/home/joel/work/opencog/opencog/build_debug/tests/server/ShellUTest(_ZNSt12_Bind_simpleIFPFviiEiiEEclEv+0x1d)[0x42f945]
/home/joel/work/opencog/opencog/build_debug/tests/server/ShellUTest(_ZNSt6thread5_ImplISt12_Bind_simpleIFPFviiEiiEEE6_M_runEv+0x1c)[0x42f842]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xb8c80)[0x7f7b5e344c80]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7f7b5de606ba]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7f7b5db9641d]
======= Memory map: ========
<snip>

ShellUTest fails

ShellUTest probably after formatting changes in opencog/atomspace.

One of the cases:

guile> <<<
/ws/cogserver/build/tests/shell/../../../tests/shell/ShellUTest.cxxtest:76: Error: Expected (274 <= reso.size()), found (274 > 265)
Error: Create rep 29 of 30 in thread 11 failed
	Got: 265 >>>opencog> Entering scheme shell; use ^D or a single . on a line by itself to exit.
guile> (EvaluationLink
  (PredicateNode "visible face")
  (ListLink
    (NumberNode "21039")))

Complete test log:
shellutest.20200615.log

python shell handling is broken.

See comments in pull request opencog/atomspace#838

At this time, starting the cogserver, and then telnet localhost 17001, entering the python shell, and entering this:

for i in range(10) :
    print "foo", i

produces no output in either the shell or the cogserver (see also issue #2 -- currently prints go to the cogserver; once fixed, prints should go to the shell.) There are also various inconsistencies: running the python shell stand-alone gives this:

$ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 
>>> 
>>> 
>>> 

after hitting carriage return 3 times. Doing the same in the telnet terminal gives this:

$ telnet localhost 17001
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
opencog> py
Entering python shell; use ^D or a single . on a line by itself to exit.
py> 
... 
... 
py> 
py> 
... 
... 
... 
... 
... 
... 
py> 
... 
... 
... 
... 
py> 
... 

There are also inconsistencies in what python considers to be "legal syntax". For example, the following code, when entered at the python shell, is invalid syntax:

def fun(x):
    y = x + 1

    print "foo", y
    return y

fun(1)
print "bar"

it generates this error:

$ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> def fun(x):
...     y = x + 1
... 
>>>     print "foo", y
  File "<stdin>", line 1
    print "foo", y
    ^
IndentationError: unexpected indent
>>> 

however, copying that code to a file, say f.py and running it as $ python f.py does not produce any error:

$ python f.py
foo 2
bar
$

running the above code at the telnet prompt does nothing.

I'm not sure quite how to resolve this ... if python itself is not self-consistent with what it considers to be valid syntax, I'm not sure how how to emulate that .. at any rate, the telnet shell is clearly broken.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.