Ah well, good, I must have missed that the first time (apparently).

Anyway, I'll put in some debugs (printfs, right) and do some tracing tomorrow and see what I can narrow down, unless someone else manages to find it before then.


On Wednesday, March 2, 2016 8:53 PM, Chris Angelico <rosuav@gmail.com> wrote:


On Thu, Mar 3, 2016 at 12:50 PM, Lance Dillon <riffraff169@yahoo.com> wrote:
> Sorry, that was all wrong.  That is callback_args, which is a required
> parameter.
>
>
> get_all_args("signal_connect",args,"%s%*%*.%s%d",&a,&tmp1,&tmp2,&detail,&connect_before);
>
>  assign_svalue_no_free(&b->cb,tmp1);
>  assign_svalue_no_free(&b->args,tmp2);
>
> So when it tries to free the signal, it tries to free b->args, which is
> invalid when no callback_arg passed in.
>
> So probably always needs a callback arg, even if only 0.  In fact, if empty,
> should probably just default to 0, just to make it easier on code later.

That's what already happens, actually - see just above the get_all_args:

  if (args==2) {
    push_int(0);
    args++;
  }

If you provide only the signal and the function, it quietly pushes a
zero onto the stack and pretends you included that.


ChrisA