NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
re: bin/57476: dhcpd dumps core
The following reply was made to PR bin/57476; it has been noted by GNATS.
From: matthew green <mrg%eterna.com.au@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: gnats-admin%netbsd.org@localhost, netbsd-bugs%netbsd.org@localhost, martin%NetBSD.org@localhost
Subject: re: bin/57476: dhcpd dumps core
Date: Thu, 22 Jun 2023 06:17:27 +1000
> From your debug info it looks as if in this loop:
>
> for (bptr = hash [hashix]; bptr; bptr = bptr -> cdr) {
> if (((struct option_cache *)(bptr -> car)) -> option -> code ==
> code)
> return (struct option_cache *)(bptr -> car);
> }
>
> bptr->car == 0 (NULL). I can't tell on which iteration,
when i first saw this PR, it made me ponder, but having you
debug this far i'm convinced i have seen this problem on big
endian arm64 the last year and a half (ever since switching
my host over from a sparc64.)
IIRC, this system went live in late feb last year, and i've
seen this crash twice so far, so it does not happen often,
and i did not see any obvious errors in the code here, but
i suspect you looked further going on the next message. my
last crash was april, and i haven't seen the log trigger.
i still have the latest core file lying around, but the
binary is newer since i'm running with this patch now:
Index: common/options.c
===================================================================
RCS file: /cvsroot/src/external/mpl/dhcp/dist/common/options.c,v
retrieving revision 1.5
diff -p -r1.5 options.c
*** common/options.c 13 Jan 2021 17:01:31 -0000 1.5
--- common/options.c 21 Jun 2023 20:12:29 -0000
*************** struct option_cache *lookup_hashed_optio
*** 2497,2502 ****
--- 2497,2507 ----
hashix = compute_option_hash (code);
for (bptr = hash [hashix]; bptr; bptr = bptr -> cdr) {
+ if (bptr -> car == NULL) {
+ log_error ("Null pointer in bptr -> cdr: %s(%d)",
+ __func__, __LINE__);
+ continue;
+ }
if (((struct option_cache *)(bptr -> car)) -> option -> code ==
code)
return (struct option_cache *)(bptr -> car);
Home |
Main Index |
Thread Index |
Old Index