{"action":"created","issue":{"url":"https://api.github.com/repos/opencog/atomspace/issues/909","repository_url":"https://api.github.com/repos/opencog/atomspace","labels_url":"https://api.github.com/repos/opencog/atomspace/issues/909/labels{/name}","comments_url":"https://api.github.com/repos/opencog/atomspace/issues/909/comments","events_url":"https://api.github.com/repos/opencog/atomspace/issues/909/events","html_url":"https://github.com/opencog/atomspace/issues/909","id":180849914,"number":909,"title":"Segafault in URE-fc","user":{"login":"AmeBel","id":2135577,"avatar_url":"https://avatars.githubusercontent.com/u/2135577?v=3","gravatar_id":"","url":"https://api.github.com/users/AmeBel","html_url":"https://github.com/AmeBel","followers_url":"https://api.github.com/users/AmeBel/followers","following_url":"https://api.github.com/users/AmeBel/following{/other_user}","gists_url":"https://api.github.com/users/AmeBel/gists{/gist_id}","starred_url":"https://api.github.com/users/AmeBel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AmeBel/subscriptions","organizations_url":"https://api.github.com/users/AmeBel/orgs","repos_url":"https://api.github.com/users/AmeBel/repos","events_url":"https://api.github.com/users/AmeBel/events{/privacy}","received_events_url":"https://api.github.com/users/AmeBel/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-10-04T09:51:37Z","updated_at":"2016-10-05T11:31:30Z","closed_at":"2016-10-05T11:30:42Z","body":"@ngeiswei The segfault occurs with deduction-rule. Running `(cog-bind deduction-inheritance-rule)` doesn't cause any issue. Details and steps follow. \r\n\r\n1. Go under `<OPENCOG_ROOT>/opencog/nlp`\r\n2. Run the test file (see below)\r\n\r\n### Content of test file\r\n```scheme\r\n(use-modules (opencog))\r\n(use-modules (opencog atom-types))\r\n(use-modules (opencog nlp))\r\n(use-modules (opencog nlp chatbot))\r\n(use-modules (opencog nlp chatbot-psi))\r\n(use-modules (opencog rule-engine))\r\n\r\n;; -----------------------------------------------------------------------------\r\n;; Helper functions\r\n(define (last-interp)\r\n    (car (parse-get-interp (car (sentence-get-parses (get-last-said-sent))))))\r\n\r\n(define (last-r2l) (interp-get-r2l-outputs (last-interp)))\r\n\r\n(define (chat-inputs)\r\n    (define result  '())\r\n    (chat \"Socrates is a man\")\r\n    (set! result (append result (last-r2l)))\r\n    (chat \"Men breathe air\")\r\n    (set! result (append result (last-r2l)))\r\n    result\r\n)\r\n\r\n;; -----------------------------------------------------------------------------\r\n;; Configure rule-base\r\n(define rb (ConceptNode \"rb\"))\r\n\r\n(define (configure-pln)\r\n    (load-from-path \"opencog/pln/rules/formulas.scm\")\r\n    (load-from-path \"opencog/pln/rules/deduction-rule.scm\")\r\n\r\n    (ure-define-rbs rb 1)\r\n    (ure-set-fuzzy-bool-parameter rb \"URE:attention-allocation\" 0)\r\n    (ure-define-add-rule rb \"deduction-inheritance-rule\"\r\n        deduction-inheritance-rule .8)\r\n)\r\n\r\n;; -----------------------------------------------------------------------------\r\n;; Reproduce segfault\r\n(configure-pln)\r\n(cog-fc (Set) rb (Set (chat-inputs)))\r\n```\r\n\r\n### Backtrace\r\n```\r\nProgram received signal SIGSEGV, Segmentation fault.\r\n0x00007f4140f06766 in opencog::ForwardChainer::apply_rule(opencog::Handle const&)::{lambda(opencog::AtomSpace&, std::vector<opencog::Handle, std::allocator<opencog::Handle> >&)#1}::operator()(opencog::AtomSpa\r\nce&, std::vector<opencog::Handle, std::allocator<opencog::Handle> >&) const [clone .isra.54.97088] () at /home/amen/hansonrobotics/opencog/atomspace/opencog/rule-engine/forwardchainer/ForwardChainer.cc:397\r\n397                         if (t == LIST_LINK)\r\n(gdb) bt\r\n#0  0x00007f4140f06766 in opencog::ForwardChainer::apply_rule(opencog::Handle const&)::{lambda(opencog::AtomSpace&, std::vector<opencog::Handle, std::allocator<opencog::Handle> >&)#1}::operator()(opencog::Ato\r\nmSpace&, std::vector<opencog::Handle, std::allocator<opencog::Handle> >&) const [clone .isra.54.97088] ()\r\n    at /home/amen/hansonrobotics/opencog/atomspace/opencog/rule-engine/forwardchainer/ForwardChainer.cc:397\r\n#1  0x00007f4140f1504a in opencog::ForwardChainer::apply_rule (this=this@entry=0x7ffd24f93020, rhandle=...)\r\n    at /home/amen/hansonrobotics/opencog/atomspace/opencog/rule-engine/forwardchainer/ForwardChainer.cc:407\r\n#2  0x00007f4140f1156b in opencog::ForwardChainer::apply_all_rules (this=0x7ffd24f93020) at /home/amen/hansonrobotics/opencog/atomspace/opencog/rule-engine/forwardchainer/ForwardChainer.cc:161\r\n#3  0x00007f4140f11bb5 in opencog::ForwardChainer::do_chain (this=this@entry=0x7ffd24f93020) at /home/amen/hansonrobotics/opencog/atomspace/opencog/rule-engine/forwardchainer/ForwardChainer.cc:135\r\n#4  0x00007f4140f163a4 in opencog::InferenceSCM::do_forward_chaining (this=<optimized out>, hsource=..., rbs=..., hfocus_set=...)\r\n    at /home/amen/hansonrobotics/opencog/atomspace/opencog/rule-engine/InferenceSCM.cc:79\r\n#5  0x00007f4140f01f33 in opencog::SchemePrimitive<opencog::InferenceSCM>::invoke(scm_unused_struct*) [clone .local.126] (this=0x1e9f6d0, args=0x392a910)\r\n    at /home/amen/hansonrobotics/opencog/atomspace/opencog/guile/SchemePrimitive.h:374\r\n#6  0x00007f414cb61af8 in opencog::PrimitiveEnviron::do_call (sfe=0x2941e90, arglist=0x392a910) at /home/amen/hansonrobotics/opencog/atomspace/opencog/guile/SchemePrimitive.cc:150\r\n#7  0x00007f414fb3d12a in ?? () from /usr/lib/libguile-2.0.so.22\r\n#8  0x00007f414fb3d13f in ?? () from /usr/lib/libguile-2.0.so.22\r\n#9  0x00007f414fabfdc3 in scm_primitive_eval () from /usr/lib/libguile-2.0.so.22\r\n#10 0x00007f414fabfe23 in scm_eval () from /usr/lib/libguile-2.0.so.22\r\n#11 0x00007f414fb0e3bd in scm_shell () from /usr/lib/libguile-2.0.so.22\r\n#12 0x00007f414fadc42d in ?? () from /usr/lib/libguile-2.0.so.22\r\n#13 0x00007f414fab62ca in ?? () from /usr/lib/libguile-2.0.so.22\r\n#14 0x00007f414fb47c00 in ?? () from /usr/lib/libguile-2.0.so.22\r\n#15 0x00007f414fabf863 in scm_call_4 () from /usr/lib/libguile-2.0.so.22\r\n#16 0x00007f414fab69ff in ?? () from /usr/lib/libguile-2.0.so.22\r\n#17 0x00007f414fab6a95 in scm_c_with_continuation_barrier () from /usr/lib/libguile-2.0.so.22\r\n#18 0x00007f414fb2f78c in ?? () from /usr/lib/libguile-2.0.so.22\r\n#19 0x00007f414f224fe2 in GC_call_with_stack_base () from /usr/lib/x86_64-linux-gnu/libgc.so.1\r\n#20 0x00007f414fb2fb48 in scm_with_guile () from /usr/lib/libguile-2.0.so.22\r\n---Type <return> to continue, or q <return> to quit---\r\n#21 0x00007f414fadc5c5 in scm_boot_guile () from /usr/lib/libguile-2.0.so.22\r\n#22 0x0000000000400c04 in ?? ()\r\n#23 0x00007f414f499f45 in __libc_start_main (main=0x400b90, argc=1, argv=0x7ffd24f94228, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffd24f94218) at libc-start.c:287\r\n#24 0x0000000000400c77 in ?? ()\r\n```"},"comment":{"url":"https://api.github.com/repos/opencog/atomspace/issues/comments/251649782","html_url":"https://github.com/opencog/atomspace/issues/909#issuecomment-251649782","issue_url":"https://api.github.com/repos/opencog/atomspace/issues/909","id":251649782,"user":{"login":"ngeiswei","id":819225,"avatar_url":"https://avatars.githubusercontent.com/u/819225?v=3","gravatar_id":"","url":"https://api.github.com/users/ngeiswei","html_url":"https://github.com/ngeiswei","followers_url":"https://api.github.com/users/ngeiswei/followers","following_url":"https://api.github.com/users/ngeiswei/following{/other_user}","gists_url":"https://api.github.com/users/ngeiswei/gists{/gist_id}","starred_url":"https://api.github.com/users/ngeiswei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngeiswei/subscriptions","organizations_url":"https://api.github.com/users/ngeiswei/orgs","repos_url":"https://api.github.com/users/ngeiswei/repos","events_url":"https://api.github.com/users/ngeiswei/events{/privacy}","received_events_url":"https://api.github.com/users/ngeiswei/received_events","type":"User","site_admin":false},"created_at":"2016-10-05T11:31:30Z","updated_at":"2016-10-05T11:31:30Z","body":"Just needed a conditional to avoid adding undefined handles in the resulting inferences over the focus set."}}
{"actor":{"display_login":"ngeiswei"}}