Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Mar 2015 20:25:31 +1100
From:      Trevor Roydhouse <trev@sentry.org>
To:        freebsd-arm <freebsd-arm@freebsd.org>
Subject:   Re: pthread_create() munging malloc()ed memory? (malloc(), threads, and static linking) [RPI-B+, 10.1]
Message-ID:  <5509448B.20500@sentry.org>
In-Reply-To: <6580F1DF-3A9F-42C1-A27F-75546FD73829@icloud.com>
References:  <6580F1DF-3A9F-42C1-A27F-75546FD73829@icloud.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



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