Summary: | net/echoping: SIG11 with -m dns only on amd64 | ||||||
---|---|---|---|---|---|---|---|
Product: | Ports & Packages | Reporter: | Phillip R. Jaenke <prj> | ||||
Component: | Individual Port(s) | Assignee: | Alexey Dokuchaev <danfe> | ||||
Status: | Closed FIXED | ||||||
Severity: | Affects Only Me | CC: | arved, danfe, lwhsu | ||||
Priority: | --- | Keywords: | needs-patch | ||||
Version: | Latest | ||||||
Hardware: | Any | ||||||
OS: | Any | ||||||
Attachments: |
|
I can't reproduce % echoping -m dns ns1.isc-sns.net www.freebsd.org Elapsed time: 0.035630 seconds % uname -a FreeBSD nihayet.local.arved.priv.at 12.0-RELEASE-p10 FreeBSD 12.0-RELEASE-p10 GENERIC amd64 The command output from your truss output doesn't even work: /usr/local/bin/echoping -t 5 -m /usr/local/lib/echoping/dns.so -n 20 10.53.0.1 -t A nsd0.rootlair.pvt Error: Unknown type Usage: [-?] [-t|--type=type] [--tcp] [--no-recurse] [-?|--help] [--usage] request Phillip, is this still happening on newer FreeBSD versions? (In reply to Li-Wen Hsu from comment #2) > Phillip, is this still happening on newer FreeBSD versions? It certainly does, albeit this has nothing to with FreeBSD or Clang. It crashes at dns.c:111 when trying to access upper_type_name = (char *) to_upper(type_name); which ends up being bogus because of the missing prototype for to_upper() so compiler assumes it returns an int which does not match the pointer size on amd64, leading to the crash (but not on i386). Not sure why it does not happen on aarch64. Let me see what I can do. A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=7f1fbb2020e286621e3107c2bf369f9973e99112 commit 7f1fbb2020e286621e3107c2bf369f9973e99112 Author: Alexey Dokuchaev <danfe@FreeBSD.org> AuthorDate: 2021-07-13 09:47:48 +0000 Commit: Alexey Dokuchaev <danfe@FreeBSD.org> CommitDate: 2021-07-13 09:48:01 +0000 net/echoping: fix the segmentation fault at dns.c:111 Add missing prototype for to_upper() which returns char *. Without it, compiler assumed that it returns an int, which results in segmentation fault in init() at dns.c when trying process its result which had been cast to char *, albeit needlessly (this code does lots of bogus casts). PR: 220294 net/echoping/Makefile | 2 +- net/echoping/files/patch-echoping.h | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) The program should no longer crash now. Please reopen if you observe any other segfaults. |
Created attachment 183821 [details] truss output of echoping sig11 on 11.0-RELEASE amd64 Problem appears to possibly be program bug in echoping but may be clang. SIG11 occurs after munmap() call and only occurs on amd64. No problems were observed on i386 or aarch64. No other symptoms have been observed yet but http and https work without problems.