ports/154483: [patch] devel/cgdb -- fix segfault on amd64
Pietro Cerutti
gahr at FreeBSD.org
Thu Feb 3 11:20:08 UTC 2011
>Number: 154483
>Category: ports
>Synopsis: [patch] devel/cgdb -- fix segfault on amd64
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Thu Feb 03 11:20:07 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator: Pietro Cerutti
>Release:
>Organization:
The FreeBSD Project
>Environment:
FreeBSD SN2000.medacta.ch 9.0-CURRENT FreeBSD 9.0-CURRENT #9: Mon Jan 31 14:14:54 CET 2011 root at SN2000:/usr/obj/usr/src/sys/IMAC amd64
>Description:
A missing declaration of void *cgdb_malloc(size_t) makes the compiler assume that the function return int, thus truncating the returned 64-bit pointer to 32 bits.
This causes the returned malloc'd pointer to point to an invalid location, thus causing the seg-fault. This has been discussed with one of the authors on IRC, a fix will be included in the next version upstream. I think it is important nonetheless to include a patch immediately to prevent systematic segfaults on amd64.
>How-To-Repeat:
Run cgdb on amd64.
>Fix:
Add this patch.
Patch attached with submission follows:
--- various/rline/src/rline.c.orig 2011-02-03 10:54:48.000000000 +0100
+++ various/rline/src/rline.c 2011-02-03 10:56:01.000000000 +0100
@@ -42,6 +42,8 @@
#endif /* HAVE_LIBREADLINE */
+#include "various/util/include/sys_util.h"
+
/* }}}*/
struct rline
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list