[Bug 241258] Error building 12.1-RC1 from 11.3, "jevents" program getting a sigsegv in /usr/src/lib/libpmc/pmu-events
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Tue Oct 15 08:13:16 UTC 2019
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=241258
--- Comment #1 from sigsys at gmail.com ---
Oops. I made a mistake. Comparing the file it was generating on another
12-STABLE system, I noticed that it was stripping the string wrong. Rewrote the
whole function, it was confusing.
Index: lib/libpmc/pmu-events/jevents.c
===================================================================
--- lib/libpmc/pmu-events/jevents.c (revision 353500)
+++ lib/libpmc/pmu-events/jevents.c (working copy)
@@ -117,13 +117,14 @@
static void fixdesc(char *s)
{
char *e = s + strlen(s);
-
/* Remove trailing dots that look ugly in perf list */
- --e;
- while (e >= s && isspace(*e))
- --e;
- if (*e == '.')
- *e = 0;
+ while (e-- > s) {
+ if (isspace(*e))
+ continue;
+ if ('.' == *e)
+ *e = '\0';
+ break;
+ }
}
/* Add escapes for '\' so they are proper C strings. */
Testing by doing this:
cd /usr/src/lib/libpmc/pmu-events
make
cd /usr/obj/usr/src/amd64.amd64/lib/libpmc
cp libpmc_events.c libpmc_events.c.saved
./pmu-events/jevents "x86" /usr/src/lib/libpmc/pmu-events/arch libpmc_events.c
diff -u libpmc_events.c.saved libpmc_events.c
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-bugs
mailing list