From nobody@FreeBSD.org  Fri Jul 13 07:25:12 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 0E19B1065672
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 13 Jul 2012 07:25:12 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id ED7738FC12
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 13 Jul 2012 07:25:11 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q6D7PBOk047394
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 13 Jul 2012 07:25:11 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q6D7PBXp047385;
	Fri, 13 Jul 2012 07:25:11 GMT
	(envelope-from nobody)
Message-Id: <201207130725.q6D7PBXp047385@red.freebsd.org>
Date: Fri, 13 Jul 2012 07:25:11 GMT
From: Richard Yao <ryao@gentoo.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: ptrace is broken in Linux emulation
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         169814
>Category:       kern
>Synopsis:       [linux] ptrace is broken in Linux emulation
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-emulation
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul 13 07:30:02 UTC 2012
>Closed-Date:    
>Last-Modified:  Mon Jul 16 03:15:30 UTC 2012
>Originator:     Richard Yao
>Release:        FreeBSD 9.0-RELEASE
>Organization:
Gentoo
>Environment:
Linux linux 2.6.16 FreeBSD Gentoo 9.0-r3 #0: Sun May 27 20:29:34 EDT 2012 i686 AMD Phenom(tm) II X6 1090T Processor AuthenticAMD GNU/Linux
>Description:
ptrace is broken, which causes sys-libs/glibc to fail to build in a Gentoo Linux jail under Linux emulation:

http://bpaste.net/show/34782/

This issue can also be demonstrated using strace:

# strace echo Hello World
strace: test_ptrace_setoptions_for_all: PTRACE_TRACEME doesn't work: Function not implemented
strace: test_ptrace_setoptions_for_all: unexpected exit status 1
>How-To-Repeat:
mkdir /mnt/linux
wget ftp://gentoo.osuosl.org/pub/gentoo/releases/amd64/current-stage3/*.tar.bz2 -O - | tar -x -C /mnt/linux
cp /etc/resolv.conf /mnt/linux/etc/resolv.conf
mount -t linprocfs none /mnt/linux/proc
mount -t linsysfs none /mnt/linux/sys
mount -t devfs none /mnt/linux/dev
mount -t fdescfs none /mnt/linux/dev/fd
chroot /mnt/linux /bin/bash
env-update
source /etc/profile
export PS1="(chroot) $PS1"
cd
emerge-webrsync
ln -sf /bin/busybox /bin/tar
ln -sf /bin/busybox /bin/rm
ln -sf /bin/busybox /usr/bin/touch

# And finally:
emerge strace
strace echo Hello World

# Alternatively, rebuild glibc:
emerge --oneshot sys-libs/glibc
>Fix:
There is no known fix or workaround.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-emulation 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Mon Jul 16 03:15:13 UTC 2012 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=169814 
>Unformatted:
