Althttpd

202203031915 and Later Crashes on Alpine Linux
Login

202203031915 and Later Exits at 10s on Alpine Linux

(1.3) By sodface on 2022-03-25 17:27:54 edited from 1.2 [source]

Starting with 202203031915 althttpd starts and then exits right at 10 seconds regardless of whether I'm using http or https or whether I make a page request or not after starting.

I can start and successfully make a couple page requests within the 10 seconds before it exits.

Here's a time of a launch where I made no page requests:

server:/srv/aports/repo/althttpd$ time althttpd --jail 0 --port 8080 --root /srv/symplate --logfile /srv/symplate/log/althttpd.log --user sodface
real	0m 10.00s
user	0m 0.00s
sys	0m 0.00s

(2) By drh on 2022-03-20 10:46:24 in reply to 1.2 [link] [source]

Do you have any idea why it works perfectly on Ubuntu?

(3) By Stephan Beal (stephan) on 2022-03-20 11:33:53 in reply to 2 [link] [source]

Do you have any idea why it works perfectly on Ubuntu?

FWIW, i can reproduce this on Raspberry Pi OS (Debian derivative):

[pi@pi4b8:~/fossil/althttpd]$ time ./althttpd --jail 0 --port 9090 --root . --logfile /dev/stderr

real	0m10.005s
user	0m0.000s
sys	0m0.006s

as well as Mint (Ubuntu derivative):

[stephan@nuc:~/fossil/althttpd]$ time ./althttpd --jail 0 --port 9090 --root . --logfile /dev/stderr

real	0m10.003s
user	0m0.003s
sys	0m0.001s

Adding --debug 1 works around it, as that disables the timers.

(4) By sodface on 2022-03-20 12:16:11 in reply to 3 [link] [source]

FWIW, i can reproduce ...

Thanks, my first thought was this was another musl vs glibc difference somehow but I think your tests eliminate that possibility. Maybe kernel version?

server:~$ uname -a
Linux server 5.15.29-0-lts #1-Alpine SMP Wed, 16 Mar 2022 15:02:59 +0000 x86_64 Linux

(5) By drh on 2022-03-20 16:00:04 in reply to 2 [link] [source]

Perhaps the difference is that my tests are run via xinetd, not in standalone mode. I have check-in a change. Please try again and report back success of failure.

(6) By Stephan Beal (stephan) on 2022-03-20 16:47:24 in reply to 5 [link] [source]

I have check-in a change. Please try again and report back success of failure.

That does the trick for me.

(7) By sodface on 2022-03-20 18:30:16 in reply to 5 [link] [source]

This looks good to me too. Thanks!

On Alpine, I use an openrc script to start althttpd, which is where I first saw the issue:

server:/srv/aports/repo/althttpd$ rc-status
Runlevel: default
 ntpd                                                                                                                                                                         [  started  ]
 nfs                                                                                                                                                                          [  started  ]
 althttpd                                                                                                                                                                     [  crashed  ]
 samba                                                                                                                                                                        [  started  ]
                                                                                                                 

I've tested the latest commit both at the command line and via openrc and both methods seem to work now, so I guess both are "standalone" from althttpd's perspective.

(8) By sean (naes_guy) on 2022-03-25 19:13:04 in reply to 5 [link] [source]

Thanks for the fix.

Us three had the hint it had something to do with your timer.

Probably resolves these issues, too: https://www.sqlite.org/althttpd/forumpost/24a326ebb3