From bkoenig@alpha-tierchen.de  Tue Jun 26 15:44:45 2007
Return-Path: <bkoenig@alpha-tierchen.de>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 79A4816A469;
	Tue, 26 Jun 2007 15:44:45 +0000 (UTC)
	(envelope-from bkoenig@alpha-tierchen.de)
Received: from mail.liberty-hosting.de (mail.smartterra.de [195.225.132.203])
	by mx1.freebsd.org (Postfix) with ESMTP id 397E413C465;
	Tue, 26 Jun 2007 15:44:45 +0000 (UTC)
	(envelope-from bkoenig@alpha-tierchen.de)
Received: from mail.liberty-hosting.de ([195.225.132.203])
 by localhost (liberty-mail [195.225.132.203]) (amavisd-new, port 10024)
 with ESMTP id 81233-05; Tue, 26 Jun 2007 17:27:09 +0200 (CEST)
Received: from home.alpha-tierchen.de (port-212-202-42-120.dynamic.qsc.de [212.202.42.120])
	by mail.liberty-hosting.de (Postfix) with ESMTP id A481D3E92D9;
	Tue, 26 Jun 2007 17:27:09 +0200 (CEST)
Received: from alpha-tierchen.de (muhkuh.lan [192.168.1.2])
	by home.alpha-tierchen.de (Postfix) with SMTP id E5C8F45046;
	Tue, 26 Jun 2007 17:24:35 +0200 (CEST)
Received: by alpha-tierchen.de (sSMTP sendmail emulation); Tue, 26 Jun 2007 17:24:36 +0200
Message-Id: <20070626152435.E5C8F45046@home.alpha-tierchen.de>
Date: Tue, 26 Jun 2007 17:24:36 +0200
From: "Bjoern Koenig" <bkoenig@alpha-tierchen.de>
Reply-To: Bjoern Koenig <bkoenig@alpha-tierchen.de>
To: FreeBSD-gnats-submit@freebsd.org
Cc: kan@freebsd.org
Subject: [patch] sbrk(0) is broken on ARM architecture
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         114049
>Category:       kern
>Synopsis:       [patch] sbrk(0) is broken on ARM architecture
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kan
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jun 26 15:50:02 GMT 2007
>Closed-Date:    Wed Jun 27 02:47:32 GMT 2007
>Last-Modified:  Wed Jun 27 02:50:02 GMT 2007
>Originator:     Bjoern Koenig
>Release:        FreeBSD 7.0-CURRENT arm
>Organization:
>Environment:
>Description:
	sbrk(0) is broken on ARM architecture.

	On May 16th 2007 the symbol "end" has been removed from the list of
	exported symbols in src/lib/libc/arm/Symbol.map. For this reason you
	needed to change "end" to "_end" in src/lib/libc/arm/sys/brk.S, but
	sbkr.S has been forgotten.
>How-To-Repeat:

cat > curbrk.c << EOF
#include <stdio.h>

int
main()
{
	printf("%08x\n", sbrk(0));
	return (0);
}
EOF
cc curbrk.c && ./a.out

The output is 'ffffffff' but should be something like '000106a0'.

>Fix:

--- src_lib_libc_arm_sys_sbkr.S begins here ---
--- HEAD/src/lib/libc/arm/sys/sbrk.S	2004-11-09 17:49:14.000000000 +0100
+++ HEAD-bkoenig/src/lib/libc/arm/sys/sbrk.S	2007-06-26 14:05:14.000000000 +0200
@@ -35,7 +35,7 @@
 __FBSDID("$FreeBSD: src/lib/libc/arm/sys/sbrk.S,v 1.2 2004/11/09 16:49:14 cognet Exp $");
 #include "SYS.h"
 
-	.globl	_C_LABEL(end)
+	.globl	_C_LABEL(_end)
 
 #ifdef WEAK_ALIAS
 WEAK_ALIAS(sbrk, _sbrk)
@@ -46,7 +46,7 @@
 	.globl	CURBRK
 	.type	CURBRK,#object
 CURBRK:
-	.word	_C_LABEL(end)
+	.word	_C_LABEL(_end)
 
 /*
  * Change the data segment size
--- src_lib_libc_arm_sys_sbkr.S ends here ---


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: linimon 
State-Changed-When: Tue Jun 26 20:46:42 UTC 2007 
State-Changed-Why:  
Looking into this, I see this exact change was made in the 1.3 version 
on the same day: 

http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libc/arm/sys/brk.S.diff?r1=1.2;r2=1.3;f=h 

Are you sure your source tree is up-to-date? 


Responsible-Changed-From-To: freebsd-bugs->linimon 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Tue Jun 26 20:46:42 UTC 2007 
Responsible-Changed-Why:  

http://www.freebsd.org/cgi/query-pr.cgi?pr=114049 

From: =?iso-8859-1?Q?Bj=F6rn_K=F6nig?= <bkoenig@alpha-tierchen.de>
To: bug-followup@freebsd.org
Cc: linimon@FreeBSD.org
Subject: Re: kern/114049: [patch] sbrk(0) is broken on ARM architecture
Date: Tue, 26 Jun 2007 23:34:04 +0200 (CEST)

 The change was made in brk.S, but not in sbrk.S. My patch applies to the
 latter file.
 
 
State-Changed-From-To: feedback->open 
State-Changed-By: linimon 
State-Changed-When: Tue Jun 26 21:56:33 UTC 2007 
State-Changed-Why:  
Submitter is correct, I was looking at the wrong file. 

kan, since you did the commit to the other file, can you give a quick 
review to this one?  It seems correct to me. 


Responsible-Changed-From-To: linimon->kan 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Tue Jun 26 21:56:33 UTC 2007 
Responsible-Changed-Why:  

http://www.freebsd.org/cgi/query-pr.cgi?pr=114049 
State-Changed-From-To: open->closed 
State-Changed-By: kan 
State-Changed-When: Wed Jun 27 02:46:25 UTC 2007 
State-Changed-Why:  
Committed, thanks. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=114049 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/114049: commit references a PR
Date: Wed, 27 Jun 2007 02:45:44 +0000 (UTC)

 kan         2007-06-27 02:45:38 UTC
 
   FreeBSD src repository
 
   Modified files:
     lib/libc/arm/sys     sbrk.S 
   Log:
   Fix sbrk.S to use _end symbol the same way brk.s was fixed some time
   ago. sbrk.S should have gotten the same change then but was forgotten.
   
   Approved by:    re (bmah)
   PR:             kern/114049
   
   Revision  Changes    Path
   1.3       +2 -2      src/lib/libc/arm/sys/sbrk.S
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
