Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Feb 2011 11:13:11 GMT
From:      Pietro Cerutti <gahr@FreeBSD.org>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/154483: [patch] devel/cgdb -- fix segfault on amd64
Message-ID:  <201102031113.p13BDBTj019717@red.freebsd.org>
Resent-Message-ID: <201102031120.p13BK74s046399@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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@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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201102031113.p13BDBTj019717>