bug#25267: crashes here only for invalid scheme

2016-12-24 Thread Linas Vepstas
FYI: important note: this crashes only because an exception path is
taken. Due to a "bug" in the shell script above, `ctr` is undefined,
so an unbound-variable exception is thrown.  When the scheme is valid,
then it does NOT crash here!

--linas


opencog> (NumberNode ctr)
Entering scheme shell; use ^D or a single . on a line by itself to exit.
guile> Backtrace:
In ice-9/boot-9.scm:
 157: 12 [catch #t # ...]
In unknown file:
   ?: 11 [apply-smob/1 #]
In ice-9/boot-9.scm:
 157: 10 [catch #t # ...]
In unknown file:
   ?: 9 [apply-smob/1 #]
   ?: 8 [call-with-input-string "(NumberNode ctr)\n" ...]
In ice-9/boot-9.scm:
2320: 7 [save-module-excursion #]
In ice-9/eval-string.scm:
  44: 6 [read-and-eval # #:lang ...]
  37: 5 [lp (NumberNode ctr)]
In ice-9/eval.scm:
 387: 4 [eval # ()]
 393: 3 [eval # ()]
In unknown file:
   ?: 2 [memoize-variable-access! # #]
In ice-9/boot-9.scm:
 102: 1 [# unbound-variable ...]
In unknown file:
   ?: 0 [apply-smob/1 # unbound-variable ...]

ERROR: In procedure apply-smob/1:
ERROR: Unbound variable: ctr
ABORT: unbound-variable





bug#24446: close - not a bug

2016-12-24 Thread Linas Vepstas
Seems to me this bug report can be closed as "not a bug", given the
post above.

-- linas





bug#25267: guile-2.2 crash in GC

2016-12-24 Thread Linas Vepstas
FYI, this is quickly and easily reproducible, happens within seconds,
and hits the same spot every time. Note-to-self (not for general
consumption): my unit test to provoke this is to start the cogserver
and run this shell script:

#!/bin/bash

i=0
while true ; do
  let i=$i+1
  if [ "$(($i % 2000))" -eq "0" ] ; then
echo loop $i
  fi
  # echo '(display ctr)' | nc localhost 17001
  echo '(NumberNode ctr)' | nc localhost 17001
done

other testing variants are described in
https://github.com/opencog/opencog/issues/2550





bug#25267: guile-2.2 crash in GC

2016-12-24 Thread Linas Vepstas
Merry Christmas!

Below is a crash observed in guile-2.2, the git version of 21 December
2016  (last commit 0ce8a9a5e01d3a12d83fea85968e1abb602c9298 Author:
Andy Wingo 
Date:   Sun Dec 18 23:00:07 2016 +0100)

I do not have any simple test-case to reproduce this (yet?) so this is
an FYI bug report.  It was provoked by a stress test, with the goal of
running some 60+ calls to scm_c_catch in 60+ distinct C++ threads.  I
have no idea if this will crash any other version of guile; I have
never done this stress test before.

Here's what GDB says:

Thread 296 "cogserver" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffc0ff9700 (LWP 3680)]
thread_mark (addr=0x558f7700, mark_stack_ptr=,
mark_stack_limit=0x7fffc0ff7c50, env=)
at ../../libguile/threads.c:111
111  while ((chain = *(void **)chain))
(gdb) bt
#0  thread_mark (addr=0x558f7700, mark_stack_ptr=,
mark_stack_limit=0x7fffc0ff7c50, env=)
at ../../libguile/threads.c:111
#1  0x72a80ffb in GC_mark_from (mark_stack_top=0x7fffc0fe7c60,
mark_stack_top@entry=0x7fffc0fe7ca0,
mark_stack=mark_stack@entry=0x7fffc0fe7c50,
mark_stack_limit=mark_stack_limit@entry=0x7fffc0ff7c50) at mark.c:737
#2  0x72a8163e in GC_do_local_mark (local_mark_stack=0x7fffc0fe7c50,
local_top=0x7fffc0fe7ca0) at mark.c:994
#3  0x72a81864 in GC_mark_local (
local_mark_stack=local_mark_stack@entry=0x7fffc0fe7c50, id=id@entry=0)
at mark.c:1129
#4  0x72a819bf in GC_do_parallel_mark () at mark.c:1157
#5  0x72a8282d in GC_mark_some (
cold_gc_frame=0x7fffc0ff7cb0 "\344\207\315\362\377\177") at mark.c:372
#6  0x72a782dd in GC_stopped_mark (
stop_func=0x72a77d70 ) at alloc.c:698
#7  0x72a78dca in GC_try_to_collect_inner (
stop_func=0x72a77d70 ) at alloc.c:486
#8  0x72a79782 in GC_collect_or_expand (
needed_blocks=needed_blocks@entry=1,
ignore_off_page=ignore_off_page@entry=0, retry=retry@entry=0)
at alloc.c:1344
---Type  to continue, or q  to quit---
#9  0x72a79942 in GC_allocobj (gran=gran@entry=2, kind=1)
at alloc.c:1434
#10 0x72a7f0a6 in GC_generic_malloc_inner (lb=lb@entry=32, k=k@entry=1)
at malloc.c:140
#11 0x72a80114 in GC_generic_malloc_many (lb=32, k=1,
result=0x563f7d88) at mallocx.c:439
#12 0x77728c34 in scm_inline_gc_alloc (kind=,
idx=, freelist=)
at ../../libguile/gc-inline.h:94
#13 scm_inline_gc_malloc (thread=, bytes=)
at ../../libguile/gc-inline.h:125
#14 scm_inline_gc_malloc_words (words=, thread=)
at ../../libguile/gc-inline.h:132
#15 scm_inline_words (n_words=, car=,
thread=) at ../../libguile/gc-inline.h:163
#16 vm_regular_engine (thread=0x0, vp=0x566fbd80,
registers=0x7fffc0ff7c50, resume=1434328064)
at ../../libguile/vm-engine.c:1622
#17 0x7772928e in scm_call_n (proc=0x7fffd971dd70,
argv=argv@entry=0x7fffc0ff80b0, nargs=nargs@entry=4)
at ../../libguile/vm.c:1250
#18 0x776ac224 in scm_call_4 (proc=,
arg1=arg1@entry=0x56750fa0, arg2=arg2@entry=0x56870fa0,
---Type  to continue, or q  to quit---
arg3=arg3@entry=0x5607d890, arg4=arg4@entry=0x52)
at ../../libguile/eval.c:502
#19 0x7769dd55 in display_backtrace_body (a=)
at ../../libguile/backtrace.c:244
#20 0x777251da in vm_regular_engine (thread=0x0, vp=0x566fbd80,
registers=0x7fffc0ff7c50, resume=1434328064)
at ../../libguile/vm-engine.c:760
#21 0x7772928e in scm_call_n (proc=proc@entry=0x56870f80,
argv=argv@entry=0x0, nargs=nargs@entry=0) at ../../libguile/vm.c:1250
#22 0x776ac189 in scm_call_0 (proc=proc@entry=0x56870f80)
at ../../libguile/eval.c:475
#23 0x77718280 in catch (tag=tag@entry=0x404, thunk=0x56870f80,
handler=0x56870f60, pre_unwind_handler=0x4)
at ../../libguile/throw.c:138
#24 0x777185c5 in scm_catch_with_pre_unwind_handler (
key=key@entry=0x404, thunk=, handler=,
pre_unwind_handler=) at ../../libguile/throw.c:252
#25 0x7771877f in scm_c_catch (tag=tag@entry=0x404,
body=body@entry=0x7769dc30 ,
body_data=body_data@entry=0x7fffc0ff8480,
handler=handler@entry=0x7769e050 ,
handler_data=handler_data@entry=0x56870fa0,
pre_unwind_handler=pre_unwind_handler@entry=0x0,
---Type  to continue, or q  to quit---
pre_unwind_handler_data=0x0) at ../../libguile/throw.c:375
#26 0x7771878e in scm_internal_catch (tag=tag@entry=0x404,
body=body@entry=0x7769dc30 ,
body_data=body_data@entry=0x7fffc0ff8480,
handler=handler@entry=0x7769e050 ,
handler_data=handler_data@entry=0x56870fa0)
at ../../libguile/throw.c:384
#27 0x7769dc25 in scm_display_backtrace_with_highlights (
stack=, port=port@entry=0x56870fa0,
first=first@entry=0x4, depth=depth@entry=0x4,
highlights=highlights@entry=0x304) at ../../libguile/backtrace.c:282
#28 0x74a