Error I am seeing a lot

449 views
Skip to first unread message

mi...@mikeharpe.com

unread,
Sep 15, 2020, 12:08:07 PM9/15/20
to [PiDP-11]

This error has been happening a lot on my pidp11...

server11: ../../07.0_blinkenlight_api/historybuffer.c:128: historybuffer_idx2pos: Assertion `idx < _this->endpos' failed.
                                                       localhost: RPC: Unable to receive; errno = Connection refused
                                     (in .//../../../07.0_blinkenlight_api/blinkenlight_api_client.c, line 296)

I don't know much about this setup so I don't know where to start troubleshooting.

Any help appreciated.

Michael Harpe
Sellersburg, IN USA
Message has been deleted

Robert Evans

unread,
Sep 16, 2020, 2:51:09 PM9/16/20
to [PiDP-11]
You may be seeing a known bug in server11.  Try looking at this topic: History buffer crash is still with us.

Oscar Vermeulen

unread,
Sep 16, 2020, 7:05:03 PM9/16/20
to mi...@mikeharpe.com, [PiDP-11]
Mike,

That bug makes me think you have the old version of the software. We (we as in Joerg Hoppe, not so much me to be honest) found and fixed the bug and ever since, I have not heard of any problems anymore.

Kind regards,

Oscar.


--
You received this message because you are subscribed to the Google Groups "[PiDP-11]" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pidp-11+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pidp-11/3556ae86-6453-4586-810d-d85a8cec62dan%40googlegroups.com.

Johnny Billquist

unread,
Sep 16, 2020, 7:07:01 PM9/16/20
to Oscar Vermeulen, mi...@mikeharpe.com, [PiDP-11]
There was a fix (I guess at least a year ago by now), which very much
improved the situation. But I still occasionally get it hung, but now it
can be a month or two between it happening.

Was there any more recent fixes?

Johnny

On 2020-09-17 01:04, Oscar Vermeulen wrote:
> Mike,
>
> That bug makes me think you have the old version of the software. We (we
> as in Joerg Hoppe, not so much me to be honest) found and fixed the bug
> and ever since, I have not heard of any problems anymore.
>
> Kind regards,
>
> Oscar.
>
>
> On Tue, 15 Sep 2020 at 18:08, mi...@mikeharpe.com
> <mailto:mi...@mikeharpe.com> <mi...@mikeharpe.com
> <mailto:mi...@mikeharpe.com>> wrote:
>
>
> This error has been happening a lot on my pidp11...
>
> server11: ../../07.0_blinkenlight_api/historybuffer.c:128:
> historybuffer_idx2pos: Assertion `idx < _this->endpos' failed.
>                                                        localhost:
> RPC: Unable to receive; errno = Connection refused
>                                      (in
> .//../../../07.0_blinkenlight_api/blinkenlight_api_client.c, line 296)
>
> I don't know much about this setup so I don't know where to start
> troubleshooting.
>
> Any help appreciated.
>
> Michael Harpe
> Sellersburg, IN USA
>
> --
> You received this message because you are subscribed to the Google
> Groups "[PiDP-11]" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to pidp-11+u...@googlegroups.com
> <mailto:pidp-11+u...@googlegroups.com>.
> <https://groups.google.com/d/msgid/pidp-11/3556ae86-6453-4586-810d-d85a8cec62dan%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "[PiDP-11]" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to pidp-11+u...@googlegroups.com
> <mailto:pidp-11+u...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pidp-11/CAJAwMc2ny%2B9YiTpfhKbHYygQZ6XuoghHvw%3DkKWPfAQ6Vs4TFag%40mail.gmail.com
> <https://groups.google.com/d/msgid/pidp-11/CAJAwMc2ny%2B9YiTpfhKbHYygQZ6XuoghHvw%3DkKWPfAQ6Vs4TFag%40mail.gmail.com?utm_medium=email&utm_source=footer>.

--
Johnny Billquist || "I'm on a bus
|| on a psychedelic trip
email: b...@softjar.se || Reading murder books
pdp is alive! || tryin' to stay hip" - B. Idol

Michael Harpe

unread,
Sep 18, 2020, 7:25:30 AM9/18/20
to [PiDP-11]
I am going to install the newer version of the software this weekend.

Thanks, everyone for the help. Reading the thread was interesting. There are some hard-core comp sci people on here!

Michael Harpe
ex-PDP-11/45 operator and sometimes system programmer.

Mike Katz

unread,
Sep 18, 2020, 1:37:56 PM9/18/20
to Michael Harpe, [PiDP-11]
I think hard core is just a nice way of saying old computer nerds :-D

And in either case, i'm guilty as charged.
To unsubscribe from this group and stop receiving emails from it, send an email to pidp-11+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pidp-11/CAEmk7sergBtOPxUwMNHZcAdv%2BzZt_DBNWkiy-a2mNDNgYru2pA%40mail.gmail.com.

wjegr...@gmail.com

unread,
Sep 18, 2020, 1:46:48 PM9/18/20
to [PiDP-11]

That is indeed an old problem, and fixed by me. It was a race condition between two critical regions, fixed many months ago. Note that there was an initial fix that reduced the incidence, and a second fix by me that solved it. I've been running that since the patch, haven't seen the problem in that time.

Bill

wjegr...@gmail.com

unread,
Sep 18, 2020, 1:56:36 PM9/18/20
to [PiDP-11]
Hmm, I suppose someone should check to see if my change actually made it in (I'm feeling lazy today). Should be a change in historybuffer.c, just search for 'wje' for the change and an explanation of the problem.

Steven A. Falco

unread,
Sep 18, 2020, 2:19:56 PM9/18/20
to pid...@googlegroups.com
I don't see "wje" in historybuffer.c. I also downloaded a fresh copy from https://www3.ispnet.net/pidp11/pidp11.tar.gz and don't see it there either.

Can you please post your changes as a diff?

Steve
>> To view this discussion on the web visit https://groups.google.com/d/msgid/pidp-11/CAEmk7sergBtOPxUwMNHZcAdv%2BzZt_DBNWkiy-a2mNDNgYru2pA%40mail.gmail.com <https://groups.google.com/d/msgid/pidp-11/CAEmk7sergBtOPxUwMNHZcAdv%2BzZt_DBNWkiy-a2mNDNgYru2pA%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the Google Groups "[PiDP-11]" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pidp-11+u...@googlegroups.com <mailto:pidp-11+u...@googlegroups.com>.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pidp-11/4334c07a-b25f-42e2-9748-c72cd8d34fedn%40googlegroups.com <https://groups.google.com/d/msgid/pidp-11/4334c07a-b25f-42e2-9748-c72cd8d34fedn%40googlegroups.com?utm_medium=email&utm_source=footer>.

wjegr...@gmail.com

unread,
Sep 18, 2020, 3:08:46 PM9/18/20
to [PiDP-11]
Simple change. I don't have the original src, so no diff, but trivial:
At approximately line 290 in historybuffer.c, inside get_average_vals(), new code is:

_this->control_>averaged_value = 0;

// wje - the lock must be placed before historybuffer_fill() is called.
// Otherwise, it can return an index valid at the time but that becomes invalid
// by the time historybuffer_get() is called because historybuffer_set_val() could have run in between the two
// calls, and could have caused a buffer wrap.
#ifdef USE_MUTEX
    pthread_mutex_lock(&_this->mutex) ; // inhibit concurrent writes
#endif
    last_idx = historybuffer_fill(_this) - 1;
    if (last_idx < 0)
    {
#ifdef USE_MUTEX
        pthread_mutex_unlock(&_this->mutex) ; // allow write
#endif
        return; // buffer empty, return all 0's
    }
    
    hbe + hostorybuffer_get(_this, last_idx);

The change was just a couple of lines around USE_MUTEX. Replace existing code between the first _this->control line and the last hbe + line with the new code. I was told this change was added to the main branch, guess not, or my comments were rudely stripped. BTW, the discussion around this change was around 29-May-2019.

Bill

wjegr...@gmail.com

unread,
Sep 18, 2020, 3:10:00 PM9/18/20
to [PiDP-11]
Also, I keep mine up 24/7 on a UPS. It's basically been running for 16 months with the above code, no crash.

Steven A. Falco

unread,
Sep 18, 2020, 5:03:50 PM9/18/20
to pid...@googlegroups.com
Thanks. I get the basic idea - moving the mutex ahead of the historybuffer_fill call. But I don't think the code in your email is quite correct. The line:

hbe + hostorybuffer_get(_this, last_idx);

would not do anything, because the result isn't assigned to anything. The original code has:

hbe = historybuffer_get(_this, last_idx);

which makes more sense. Are you sure about that line?

Steve
> To view this discussion on the web visit https://groups.google.com/d/msgid/pidp-11/476d319f-2808-47f9-9966-19a214d1332dn%40googlegroups.com <https://groups.google.com/d/msgid/pidp-11/476d319f-2808-47f9-9966-19a214d1332dn%40googlegroups.com?utm_medium=email&utm_source=footer>.

Steven A. Falco

unread,
Sep 18, 2020, 5:19:32 PM9/18/20
to pid...@googlegroups.com, Oscar Vermeulen
Bill - I attached a patch with your change, but with the "=" sign around line 299 left alone rather than changing it to a "+". I'm running this version now and I'll report any issues.

Oscar - I know your time is currently very precious right now, but if you could comment at some point, I'd appreciate it. It sounds like Bill's patch was perhaps lost in your master copy.

Steve
history.patch

wjegr...@gmail.com

unread,
Sep 18, 2020, 5:47:58 PM9/18/20
to [PiDP-11]
'=' is correct, that was somehow a cut/paste error on my part. The patch looks correct.
Bill

Steven A. Falco

unread,
Sep 18, 2020, 6:04:30 PM9/18/20
to pid...@googlegroups.com
Thanks for confirming that '=' is correct. Now all we need is to get your version into the upstream code so everyone has the fix.

And for completeness, I've attached the file you provided via PM, so folks can just drop it in on their systems and recompile the server.

Thanks again!
Steve
> To view this discussion on the web visit https://groups.google.com/d/msgid/pidp-11/b672a3b2-6564-4238-8014-33f49041652dn%40googlegroups.com <https://groups.google.com/d/msgid/pidp-11/b672a3b2-6564-4238-8014-33f49041652dn%40googlegroups.com?utm_medium=email&utm_source=footer>.

historybuffer.c

Neal G.

unread,
Oct 9, 2020, 9:38:16 PM10/9/20
to [PiDP-11]
Thanks. I just encountered what appears to be the same problem. LED display froze after running RSX for 29-1/2 days. RSX was still alive and running, server11 process was still present, but no activity. I'll check my system for these revisions and give them a try if not present.

- Neal G.

Steven A. Falco

unread,
Oct 10, 2020, 10:30:39 AM10/10/20
to pid...@googlegroups.com, Oscar Vermeulen
The patch is not in Oscar's official download. I've attached the file (07.0_blinkenlight_api/historybuffer.c) that you need to install. Just copy the file to this directory on your Pi: /opt/pidp11/src/07.0_blinkenlight_api then run the script to rebuild the server: sudo /opt/pidp11/src/makeserver.sh and restart the display (or just reboot the pi).

Oscar - it would be great if you could put this fix into your official download so folks don't keep hitting the error.

I've also attached a diff in case you want to see what was changed.

Stev
historybuffer.c
diff.txt

Oscar Vermeulen

unread,
Oct 10, 2020, 6:27:01 PM10/10/20
to Steven A. Falco, PiDP-11
Steve,

On Sat, 10 Oct 2020 at 16:30, Steven A. Falco <steve...@gmail.com> wrote:
Oscar - it would be great if you could put this fix into your official download so folks don't keep hitting the error.

I will - but give me a week or two; the "family health complications" I've been having for a while are not getting any better at the moment. But it's at the top of the to-do!

Kind regards,

Oscar.

Charley Jones

unread,
Oct 10, 2020, 6:40:51 PM10/10/20
to Oscar Vermeulen, Steven A. Falco, PiDP-11
Wow, newbie finds an actual bug.  Good job on your first outing!

Sent from my iPhone Xs!

On Oct 10, 2020, at 3:27 PM, Oscar Vermeulen <vermeul...@gmail.com> wrote:


--
You received this message because you are subscribed to the Google Groups "[PiDP-11]" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pidp-11+u...@googlegroups.com.

sydn...@gmail.com

unread,
Oct 10, 2020, 7:01:22 PM10/10/20
to [PiDP-11]
Steve, thank you very much for this! I've been suffering with this issue for some time. I've loaded your patched historybuffer.c and rebuilt the server. I'll let you know if the problem has dissapeared!

Steven A. Falco

unread,
Oct 11, 2020, 10:50:43 AM10/11/20
to Oscar Vermeulen, PiDP-11
Thanks Oscar - and best wishes for you and your family.

Steve

On 10/10/20 6:26 PM, Oscar Vermeulen wrote:
> Steve,
>
Reply all
Reply to author
Forward
0 new messages