From owner-freebsd-arm@FreeBSD.ORG Wed Mar 18 09:25:41 2015 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 490852F8 for ; Wed, 18 Mar 2015 09:25:41 +0000 (UTC) Received: from shadow.sentry.org (shadow.sentry.org [220.233.87.20]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CDECA8E3 for ; Wed, 18 Mar 2015 09:25:40 +0000 (UTC) Received: from shadow.sentry.org (localhost.sentry.org [127.0.0.1]) by shadow.sentry.org (8.14.8/8.14.8) with ESMTP id t2I9PVHv001773 for ; Wed, 18 Mar 2015 20:25:31 +1100 (EST) (envelope-from trev@sentry.org) Message-ID: <5509448B.20500@sentry.org> Date: Wed, 18 Mar 2015 20:25:31 +1100 From: Trevor Roydhouse Organization: Sentry User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:36.0) Gecko/20100101 Firefox/36.0 SeaMonkey/2.33 MIME-Version: 1.0 To: freebsd-arm Subject: Re: pthread_create() munging malloc()ed memory? (malloc(), threads, and static linking) [RPI-B+, 10.1] References: <6580F1DF-3A9F-42C1-A27F-75546FD73829@icloud.com> In-Reply-To: <6580F1DF-3A9F-42C1-A27F-75546FD73829@icloud.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender DNS name whitelisted, not delayed by milter-greylist-4.4.3 (shadow.sentry.org [0.0.0.0]); Wed, 18 Mar 2015 20:25:32 +1100 (EST) X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Mar 2015 09:25:41 -0000 Molly (Dev Lists) wrote: > After a few iterations of this (in a loop in main()), those "non-zero" > bytes become zeroed out during the call to pthread_create(). This only > occurs a couple of times, and then the behavior seems to return to > normal for subsequent calls. [...] > This is running on a Raspberry Pi B+ using the 10.1-RELEASE image > (FreeBSD 10.1-RELEASE #0 r274401). clang is version 3.4.1 (the > version included in the base system). RPi B+ FreeBSD rpi 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r278908: Tue Feb 17 23:25:47 UTC 2015 FreeBSD clang version 3.5.1 (tags/RELEASE_351/final 225668) 20150115 Target: armv6--freebsd11.0-gnueabi Thread model: posix trev@rpi [/home/trev] $ ./a.out Value in thread: 12345 Value in thread: 12345 Value in thread: 12345 Value in thread: 12345 Value in thread: 12345 Value in thread: 12345 Value in thread: 12345 Value in thread: 12345 Value in thread: 12345 Value in thread: 12345 Built as per: // Build with: cc -std=c11 -Weverything -pthread -static thisfile.c -- Trevor Roydhouse BJuris, LLB, LLM (UNSW) Systems Developer Australasian Legal Information Institute Web : www.austlii.edu.au