ports/105085: net/mpd4 4.0b5 causes segmentation fault with amd64 architecture.
Yoshisato YANAGISAWA
osho at pcc-software.org
Thu Nov 2 20:30:21 UTC 2006
>Number: 105085
>Category: ports
>Synopsis: net/mpd4 4.0b5 causes segmentation fault with amd64 architecture.
>Confidential: no
>Severity: critical
>Priority: high
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Thu Nov 02 20:30:20 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator: Yoshisato YANAGISAWA
>Release: FreeBSD 6.1-RELEASE-p9 amd64
>Organization:
PCC-Software.ORG
>Environment:
System: FreeBSD ai.pcc-software.org 6.1-RELEASE-p9 FreeBSD 6.1-RELEASE-p9 #18: Sat Sep 30 04:29:34 JST 2006 osho at ai.pcc-software.org:/usr/obj/usr/src/sys/AI amd64
>Description:
mpd4, which is a program to establish kernel-PPP(oE)
connection, stops with segmentation fault when used on
an amd64 architecture. This segmentation fault might be
caused by some misbehaviour of va_list functions.
>How-To-Repeat:
Install port net/mpd4 on amd64 machine and run it.
>Fix:
Since this problem potentially occurs any program which run on amd64,
libc developers should fix it.
I wrote a workaround patch to use va_list only inside the same
function to avoid this problem:
diff -ruN mpd4.bak/Makefile mpd4/Makefile
--- mpd4.bak/Makefile Fri Nov 3 05:05:43 2006
+++ mpd4/Makefile Fri Nov 3 05:07:14 2006
@@ -7,6 +7,7 @@
PORTNAME= mpd4
PORTVERSION= 4.0b5
+PORTREVISION= 1
CATEGORIES= net
MASTER_SITES= ${MASTER_SITE_LOCAL}
MASTER_SITE_SUBDIR= glebius
diff -ruN mpd4.bak/files/patch-src::log.c mpd4/files/patch-src::log.c
--- mpd4.bak/files/patch-src::log.c Thu Jan 1 09:00:00 1970
+++ mpd4/files/patch-src::log.c Fri Nov 3 05:05:57 2006
@@ -0,0 +1,91 @@
+--- src/log.c.bak Mon Oct 30 06:47:07 2006
++++ src/log.c Fri Nov 3 05:03:19 2006
+@@ -158,6 +158,7 @@
+ #else
+ #define LogTimeStamp(c) do{}while(0)
+ #endif
++static void LogString(const char *buf);
+
+ /*
+ * LogOpen()
+@@ -275,21 +276,24 @@
+ LogPrintf(const char *fmt, ...)
+ {
+ va_list args;
++ char buf[MAX_CONSOLE_BUF_LEN];
++
++ LogTimeStamp(logprintf);
+
+ va_start(args, fmt);
+- vLogPrintf(fmt, args);
++ vsnprintf(buf, sizeof(buf), fmt, args);
+ va_end(args);
+-}
+
+-void
+-vLogPrintf(const char *fmt, va_list args)
+-{
+- char buf[MAX_CONSOLE_BUF_LEN];
+-
+- LogTimeStamp(logprintf);
++ va_start(args, fmt);
+ valog(LOG_INFO, fmt, args);
+- vsnprintf(buf, sizeof(buf), fmt, args);
++ va_end(args);
+
++ LogString(buf);
++}
++
++static void
++LogString(const char *buf)
++{
+ if (!gBackground)
+ {
+ fputs(buf, stdout);
+@@ -345,6 +349,7 @@
+ {
+ int k, total;
+ u_char bytes[DUMP_BYTES_PER_LINE];
++ char buf[MAX_CONSOLE_BUF_LEN];
+ char line[256];
+ int linelen;
+ va_list ap;
+@@ -352,9 +357,14 @@
+ if (level & gLogOptions) {
+ /* Do header */
+
++ LogTimeStamp(logprintf);
++ va_start(ap, fmt);
++ valog(LOG_INFO, fmt, ap);
++ va_end(ap);
+ va_start(ap, fmt);
+- vLogPrintf(fmt, ap);
++ vsnprintf(buf, sizeof(buf), fmt, ap);
+ va_end(ap);
++ LogString(buf);
+
+ /* Do data */
+
+@@ -417,15 +427,21 @@
+ {
+ int k, stop, total;
+ char line[256];
++ char consbuf[MAX_CONSOLE_BUF_LEN];
+ int linelen;
+ va_list ap;
+
+ if (level & gLogOptions) {
+ /* Do header */
+
++ LogTimeStamp(logprintf);
++ va_start(ap, fmt);
++ valog(LOG_INFO, fmt, ap);
++ va_end(ap);
+ va_start(ap, fmt);
+- vLogPrintf(fmt, ap);
++ vsnprintf(consbuf, sizeof(consbuf), fmt, ap);
+ va_end(ap);
++ LogString(consbuf);
+
+ /* Do data */
+
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list