[MacPorts] #67539: openssh @9.3p1_1 Nearly all client programs crash with Segmentation Fault.
MacPorts
noreply at macports.org
Thu Jun 8 18:15:36 UTC 2023
#67539: openssh @9.3p1_1 Nearly all client programs crash with Segmentation Fault.
------------------------+----------------------
Reporter: snowflake | Owner: artkiver
Type: defect | Status: assigned
Priority: Normal | Milestone:
Component: ports | Version: 2.8.99
Resolution: | Keywords:
Port: openssh |
------------------------+----------------------
Comment (by piru):
While at it I also developed a quick runtime test. It's a bit crude but
works.
{{{
#include <string.h>
#include <stdlib.h>
__attribute__((noinline)) void *mymalloc(size_t l)
{
return malloc(l);
}
__attribute__((noinline)) int dummy(void *a, const void *b, size_t c)
{
return !a || !b || !c;
}
__attribute__((noinline)) int test(char *s)
{
size_t l = strlen(s) + 1;
void *p = mymalloc(l);
return dummy(p, s, l);
}
int main(void)
{
return test("a");
}
}}}
To test:
{{{
clang --target=x86_64-apple-darwin-macho -fzero-call-used-regs=all -O1 -o
x x.c && ./x && echo "clang ok"
}}}
It depends highly on specifics of the clang internals, such as register
allocation etc. So it is not guaranteed to work in every situation.
However, at worst it will report false negative, i.e. not detect a buggy
clang.
--
Ticket URL: <https://trac.macports.org/ticket/67539#comment:37>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list