Comment by 🦉 noktule
Not seeing any errors so far but the leaderboard seems gone? Anyway glad I found this post, the tilde hosted games are down regularly these days 😭
Sep 06 · 3 months ago
18 Later Comments ↓
@stack no luck yet, even on the ubuntu vm. You may want to double-check that your instance of polluxd is using the correct libpxd.so - I have seen strange errors kind of like yours when testing when the testing version of polluxd tried to use the system-wide libpxd.so instead of a freshly built testing version. Otherwise, your configuration file will be helpful, thank you! I'll use that one verbatim and see if there's anything that shows up.
I will be on an airplane for most of the day but I'll report back what I find.
Oh, that is probably what happened. When I built the original version I installed it in /usr/bin and /usr/lib! Thanks for the tip, it will probably cure the problem.
@ingrix, that was it! I totally forgot about the library, started up the updated server in its own directory, and as it started (apparently) fine, totally spaced on the lib.
Thank you -- at this point I think I have a working system.
The only minor point I have is whether null input is allowed. The previous 3 (or was it 4) servers that hosted SpellBinding allowed a null-input URL "...?", which I used to shuffle. It appears polluxd does not like it and resends client request. I am not clear on what the spec intends after glancing over it just now.
In any case it does not interfere with the operation of the system.
@ingrix,
Null responses
It looks like (correct me if I am wrong), upon receivng a request with a ? but nothing following, polluxd does not place the null response into the environment variable. To a CGI, an empty response never arrives, it is as if the user never responded to the query, forcing a re-issued query.
I would argue that it is a bug, and sending a null response is different than sending no response.
Other servers I've used allowed the CGI to see the null and act accordingly.
My games relied on that behaviour in a minor way, and are a bit wacky (especially first time around, upon entry because my urls often end in a ? to request a gamefield redraw)
I use blank input to shuffle or redraw puzzles, and it adds a keystroke or you wind up in a loop because the game never sees the null input and assumes there was no input at all.
@stack I couldn't respond earlier but saw your reply, and then noticed exactly what you say when playing SpellBinding - I couldn't get the letters to shuffle. I agree with your analysis and I also agree that it is a bug. I won't be able to fix it tonight, but can probably get to it tomorrow. I'll let you know when I post the patch.
Thanks again for the feedback.
@ingrix thank you, whenever you can. I truly appreciate your help and was at the end of my wits before you offered help.
Also as pointed out by others, is it possible to serve index.gmi when a bare directory is requested?
@stack See comment above:
@stack
I reworked the URL parsing code. This version should report present-but-empty queries - at least I can see empty queries when requesting CGI, anyway. It hasn't been tested exhaustively yet to make sure the URL parsing changes didn't violate some assumption I made elsewhere in the main library (tests are broken and need to be fixed), so if you see any strange behavior please let me know. I'll also do more testing tonight. If any important bugfixes are made I'll let you know about that too.
@ingrix, just deployed it. Looks ok so far. Thanks again
@ingrix, I found the server dead this morning.
unk px connection.c: 370: overflow, buffer sizes need adjustment info c polluxd_cgi.c: 86: cgi helper 113038: cgi request ...
@ingrix, the server has been running for a couple of days (since you provided the latest tarball) prior to crashing.
I set up a cron entry to restart it daily in the meantime.
Let me know if I can do more logging or something that helps.
Looking at the source, it seems to be converting address to string, so kind of strange.
You may want to not abort on things like that, but just close the connection?
@stack thanks for the report, you're probably right that closing the connection makes more sense. I'll get a fix out with that and more asap
@ingrix - is there something like a more traditional log, with a line per request containing time, client address, and full request url? As I have it, the server spits maybe 10 lines of mostly-unhelpful stuff to stderr (I think)
@stack
That has a quick-fix for the issue you're encountering, and the "buffers" have been adjusted to be large enough to hopefully avoid issue. Now it will print "WARNING: peer string is longer than expected..." if address strings exceed expectations - if you can, please let me know if you see any of those so I can figure out what weird case you managed to run in to (I thought I had the math right on those originally but I guess not).
@stack I have the logging set up that way because it helps me figure out what happened if things go wrong in the process, but that's probably less useful for end-users.... The logging does support multiple levels of verbosity so I can make a change to print what you request instead. I worry a bit about spitting out the whole request because on other applications the request may contain e.g. passwords, but I'll figure something out.
@ingrix - perhaps the configuration file can keep an opt-in parameter for logging entire request, defaulting to trim query
@stack I think something like that is a good way to go, let's see how far we get with it. It'll probably take a day or so to get all of the changes put in place the right way, but stay tuned.
@ingrix: I deployed libpxd-c0144d1
No great rush - things that crash are bad, but things like logging format - not so much...
Original Post
New SpellBinding Server — I am happy to announce that, finally, SpellBinding and other games have a dedicated server. After moving the games from tilde to tilde I am looking forward to 100% uptime. Soft open to iron out any remaining issues [gemini link] Let me know if there are any dangling links or anything else ungodly.