From owner-freebsd-bugs@FreeBSD.ORG Tue Jun 26 15:50:03 2007 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1EFD716A567 for ; Tue, 26 Jun 2007 15:50:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id E30C113C48C for ; Tue, 26 Jun 2007 15:50:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l5QFo2Vp049503 for ; Tue, 26 Jun 2007 15:50:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l5QFo2XH049502; Tue, 26 Jun 2007 15:50:02 GMT (envelope-from gnats) Resent-Date: Tue, 26 Jun 2007 15:50:02 GMT Resent-Message-Id: <200706261550.l5QFo2XH049502@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Bjoern Koenig 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" To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: kan@FreeBSD.org Subject: kern/114049: [patch] sbrk(0) is broken on ARM architecture X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Bjoern Koenig List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jun 2007 15:50:03 -0000 >Number: 114049 >Category: kern >Synopsis: [patch] sbrk(0) is broken on ARM architecture >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Jun 26 15:50:02 GMT 2007 >Closed-Date: >Last-Modified: >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 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: >Unformatted: