From mint-bounce@lists.fishpool.fi Mon Sep 5 00:13:04 2005 X-Original-To: fnaumann@mail.boerde.de Delivered-To: fnaumann@mail.boerde.de Subject: [MiNT] Mint Bug? From: Mark Duckworth To: Mint List Content-Type: text/plain Date: Sun, 04 Sep 2005 18:09:03 -0400 Message-Id: <1125871743.23405.23.camel@mduckworth.phillypark.net> Mime-Version: 1.0 X-Mailer: Evolution 2.2.3 (2.2.3-2.1.fc4.nr) Content-Transfer-Encoding: 7bit X-ecartis-version: Ecartis v1.0.0 Sender: mint-bounce@lists.fishpool.fi Errors-To: mint-bounce@lists.fishpool.fi X-original-sender: mduckworth@atari-source.com Precedence: bulk List-help: List-unsubscribe: List-Id: X-List-ID: X-Virus-Scanned: by amavisd-new at relay.boerde.de X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on relay.boerde.de X-Spam-Status: No, hits=-1.0 tagged_above=-50.5 required=7.0 tests=AWL, BAYES_00 X-Spam-Level: Hey guys, This one is VERY INTERESTING! I'm confused with this one. Binutils 2.16.1 gets an error linking part of gcc. This error is not present with binutils 2.13. Anyway, I traced it down to a failure of malloc() itself sometime around after binutils allocates 10megabytes. So I ran a test. It allocates 1 megabyte every 1 second, tells you if the pointer is null or not, and then runs "free". If the pointer is null it means malloc failed, incidentally I ran free just to ensure it wasn't magically a null pointer and the memory was actually allocated. Here is the output: root@washi:/root/binutils/binutils-mint/ld>./malloctest Malloc 1, allocating 1 megabyte 261472256 bytes (255344K) free. Malloc 2, allocating 1 megabyte 260440064 bytes (254336K) free. Malloc 3, allocating 1 megabyte 259407872 bytes (253328K) free. Malloc 4, allocating 1 megabyte 258375680 bytes (252320K) free. Malloc 5, allocating 1 megabyte 257343488 bytes (251312K) free. Malloc 6, allocating 1 megabyte 256311296 bytes (250304K) free. Malloc 7, allocating 1 megabyte 255279104 bytes (249296K) free. Malloc 8, allocating 1 megabyte 254246912 bytes (248288K) free. Malloc 9, allocating 1 megabyte 253214720 bytes (247280K) free. Malloc 10, allocating 1 megabyte 252182528 bytes (246272K) free. Malloc 11, allocating 1 megabyte 251150336 bytes (245264K) free. Malloc 12, allocating 1 megabyte 250118144 bytes (244256K) free. Malloc 13, allocating 1 megabyte ERROR!: pointer is NULL on count: 13 250118144 bytes (244256K) free. Malloc 14, allocating 1 megabyte ERROR!: pointer is NULL on count: 14 250118144 bytes (244256K) free. You can see at count 13 malloc fails.. it will continue to fail. To see if this is a per-process limit, I logged in again via ssh and ran the test again while the other one was frozen with it's allocated ram. Every pointer returned was null. I don't know much about how malloc works, but this test succeeds on all of my linux boxes to an extremely high count. For giggles, I tried on aranym too - It SUCCEEDS. Right up until aranym runs out of ram completely. I have to try on a TT as well, but I don't have that setup right now. So this is either a CT60 hardware problem since the same failure occurs on a completely different CT60 falcon, a MiNT/Falcon/CT60 code bug (something that aranym wouldn't be using), or I'm just nuts. I spent an awful lot of time bughunting in binutils for incorrect sizes when it turns out malloc wasn't even succeeding! Thanks, Mark