Date: Sun, 05 Apr 2015 20:20:24 +0000 From: bugzilla-noreply@freebsd.org To: freebsd-ports-bugs@FreeBSD.org Subject: [Bug 199186] Fix sysutils/i7z segfaults and warnings Message-ID: <bug-199186-13@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=199186 Bug ID: 199186 Summary: Fix sysutils/i7z segfaults and warnings Product: Ports & Packages Version: Latest Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: Individual Port(s) Assignee: zont@FreeBSD.org Reporter: dim@FreeBSD.org Assignee: zont@FreeBSD.org Flags: maintainer-feedback?(zont@FreeBSD.org) Created attachment 155215 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=155215&action=edit Fix sysutils/i7z segfaults and warnings I found out that sysutils/i7z segfaults under various conditions, e.g. different compilers and compilation flags. For example, compiling with clang -O0 almost always works, but as soon as you start optimizing, segfaults occur. There is also a comment in the Makefile about having to disable several gcc optimizations to avoid segfaults. I did some debugging, and it turns out that the inline cpuid() implementation can inadvertently clobber registers, causing the cpu_heirarchy_info struct in 'chi' to be destroyed. Later on, this can lead to segfaults. I replaced the cpuid() implementation by a more standard one, and that solves all crashes for me. I tried compiling with: * clang 3.4.1 (on stable/10), with default flags * clang 3.4.1 (on stable/10), with CPUTYPE=core-avx2 * clang 3.4.1 (on stable/10), with CPUTYPE=core-avx2 and -O3 * gcc 4.2.1 (on stable/10), with default flags * gcc 4.2.1 (on stable/10), with -O3 There was also no more need to use -fno-schedule-insns2 -fno-schedule-insns -fno-caller-saves for gcc. In addition, I fixed a number of warnings about printf formats used for time_t, but that is mostly cosmetic. -- You are receiving this mail because: You are the assignee for the bug.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-199186-13>