mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Carl Chave <online@chave.us>
To: musl@lists.openwall.com
Subject: Re: [musl] Hung processes with althttpd web server
Date: Thu, 5 Oct 2023 14:52:35 -0400	[thread overview]
Message-ID: <CAGP1gyP22ut+033jQAJPFjAiSMmLmnw3wackTZzTX9iiMEo6Ww@mail.gmail.com> (raw)
In-Reply-To: <ZR4vhfR8T1Bgh3GX@voyager>

Markus,

> The signal handler will call MakeLogEntry(), and that will do
> signal-unsafe things such as call free(), localtime(), or fopen(). If
> the main process is currently using malloc() when that happens, you will
> get precisely this hang.

One of the patches I applied adds the pid to the end of the logfile
entry so I could better track the type of requests that were
triggering the hang. In this case, the hung pid is 9780. The logfile
entry for 9780 is:

2023-10-04 10:32:19,174.138.61.44,"http://","",400,3,180,258,0,0,0,47,1,"","",7,200,9780

The 400 response code is handled here:
https://sqlite.org/althttpd/file?ci=tip&name=althttpd.c&ln=2686-2693

The signal handler section:
https://sqlite.org/althttpd/file?ci=tip&name=althttpd.c&ln=1229-1261

Looks like it's supposed to log a line with 131, 132, 133, or 139 (or
nTimeoutLine though I'm not exactly sure what value to look for on
that) in the second to last log field and I'm not seeing any of those.

Not arguing with your analysis but I'm trying to figure out how to
verify it. I could try running with:

--debug BOOLEAN  Disables input timeouts.  This is useful for
debugging when inputs are being typed in manually.

Though I'm not sure if that would help or cause more problems.

Carl

      parent reply	other threads:[~2023-10-05 18:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-05  1:41 Carl Chave
2023-10-05  2:15 ` Rich Felker
2023-10-05  2:43   ` Carl Chave
2023-10-05 13:39     ` Szabolcs Nagy
2023-10-05 18:26       ` Carl Chave
2023-10-05 18:48         ` Markus Wichmann
2023-10-05 19:06           ` Carl Chave
2023-10-05  3:37 ` Markus Wichmann
2023-10-05 12:39   ` Rich Felker
2023-10-05 18:34     ` Markus Wichmann
2023-10-05 18:52   ` Carl Chave [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAGP1gyP22ut+033jQAJPFjAiSMmLmnw3wackTZzTX9iiMEo6Ww@mail.gmail.com \
    --to=online@chave.us \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).