Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Jul 2005 17:12:24 +0200 (CEST)
From:      Bram Moolenaar <Bram@moolenaar.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/84231: ccmalloc port crashes
Message-ID:  <200507281512.j6SFCODU003206@masaka.moolenaar.net>
Resent-Message-ID: <200507281610.j6SGAE7N010405@freefall.freebsd.org>

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

>Number:         84231
>Category:       ports
>Synopsis:       ccmalloc port crashes
>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 Jul 28 16:10:14 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Bram Moolenaar
>Release:        FreeBSD 5.3-RELEASE i386
>Organization:
Zimbu Labs
>Environment:
System: FreeBSD masaka.moolenaar.net 5.3-RELEASE FreeBSD 5.3-RELEASE #12: Wed Mar 2 20:26:40 CET 2005 mool@masaka.moolenaar.net:/usr/src/sys/i386/compile/MASAKA i386

ccmalloc version 0.3.9, portrevision 2

gcc (GCC) 3.4.2 [FreeBSD] 20040728

>Description:
	When using the ccmalloc library with an application a crash may occur.
	This is caused by the GCC function __builtin_return_address() not
	properly checking for the stack frame.
>How-To-Repeat:
	Link your application with the ccmalloc library and run it.  Crash
	detected with Vim 7, but probably happens with many applications.
>Fix:
	Use __builtin_frame_address() to check for the stack frame before
	calling __builtin_return_address().

	Apply this patch:

--- src/callchain.c.orig	Mon Feb  3 09:03:54 2003
+++ src/callchain.c	Sun Jun 26 12:37:45 2005
@@ -1154,9 +1154,10 @@
  * a bug in gcc 2.95.4 and 3.0.4; maybe fixed more recently.
  *
  * (Edward Welbourne).
+ *
+ * Fixed to use __builtin_frame_address() by Bram Moolenaar.
  */
-#define RA(a) case a: return (caddr_t) \
-__builtin_return_address(a) ? __builtin_return_address(a) : (caddr_t) 0;
+#define RA(a) case a: return (caddr_t) (__builtin_frame_address(a) ? __builtin_return_address(a) : 0);
 
 static caddr_t
 return_address (unsigned i)



>Release-Note:
>Audit-Trail:
>Unformatted:



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