Can you duplicate the problem when running with gdb and generate a
stack trace?
octave:1> function y = mysin (x)
> y = sin (x);
> endfunction
octave: interpfcn/symtab.h:2039: static void
symbol_table::set_curr_fcn(octave_user_function*,
symbol_table::scope_id): Assertion `scope != xtop_scope && scope !=
xglobal_scope' failed.
(gdb) bt
#0 0x000000314f235ba5 in __GI_raise (address@hidden) at
../nptl/sysdeps/unix/sysv/linux/raise.c:63
#1 0x000000314f237358 in __GI_abort () at abort.c:90
#2 0x000000314f22e972 in __assert_fail_base (fmt=0x314f3793e8
"%s%s%s:%u: %s%sAssertion `%s' failed.\n%n",
address@hidden "scope != xtop_scope && scope
!= xglobal_scope",
address@hidden "interpfcn/symtab.h",
address@hidden, address@hidden
0x7ffff7661bc0 <symbol_table::set_curr_fcn(octave_user_function*,
int)::__PRETTY_FUNCTION__> "static void
symbol_table::set_curr_fcn(octave_user_function*,
symbol_table::scope_id)") at assert.c:92
#3 0x000000314f22ea22 in __GI___assert_fail (assertion=
0x7ffff7661938 "scope != xtop_scope && scope != xglobal_scope", file=
0x7ffff765e79c "interpfcn/symtab.h", line=2039, function=
0x7ffff7661bc0 <symbol_table::set_curr_fcn(octave_user_function*,
int)::__PRETTY_FUNCTION__> "static void
symbol_table::set_curr_fcn(octave_user_function*,
symbol_table::scope_id)") at assert.c:101
#4 0x00007ffff6a6f6b7 in symbol_table::set_curr_fcn
(address@hidden, address@hidden)
at interpfcn/symtab.h:2039
#5 0x00007ffff6a6b366 in octave_user_function::octave_user_function
(this=0x79fe30, sid=1, pl=0xa8fdd0, rl=
0x0, cl=0xa7f520) at octave-value/ov-usr-fcn.cc:205