From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 104256 invoked by alias); 20 Sep 2016 17:43:06 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Received: (qmail 104237 invoked by uid 89); 20 Sep 2016 17:43:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1340, hello! X-HELO: mail-oi0-f53.google.com Received: from mail-oi0-f53.google.com (HELO mail-oi0-f53.google.com) (209.85.218.53) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 20 Sep 2016 17:42:55 +0000 Received: by mail-oi0-f53.google.com with SMTP id r126so30811911oib.0 for ; Tue, 20 Sep 2016 10:42:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=LbMAUNOFDzkFLBlJ+AG49/4GWFSAytWSmdUrzWFFBcc=; b=LjqIIHo/i+lfsuRcG4oNZ2GdiK9tgRpBhNcuDMUxaoSbJAItNNMAaWFZYqIm48r3W7 Sn3VoDbyN0z6W/I0KmUEmQNlP+PU/TRwyHoDfmcnUESZjv9oH9iYoM8GcZkAgm0u/CBQ VjM36ITdiABISKLHeWl79yh4Yj2KkL0hXwwH2+eFnizyqvRLgoi7a6a3q2fnNOkMmhIA GRqFbCeCzUWvg0sI30hdH/dwl2D9b1mH6HGEAc7EUZrdQEbBE9APtue6qUP5YHleg9Gw OECWDs4sOPKqQq6lcrLtlNESrqGHbihdn4sPz+3mW302w7OBwBBWx4ITBeqVFQIUVZ/e y4fA== X-Gm-Message-State: AE9vXwOZqZkar7s9fuO/WQqJ5PGDDZbtgzQuYbCqzNkcSJNsyTEZ3cEaSF8SHcZrYOEdRe4gu/f9tkzNlqr7BQ== X-Received: by 10.202.89.66 with SMTP id n63mr26073293oib.90.1474393373682; Tue, 20 Sep 2016 10:42:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.42.134 with HTTP; Tue, 20 Sep 2016 10:42:53 -0700 (PDT) From: Piotr Jedyk Date: Tue, 20 Sep 2016 17:43:00 -0000 Message-ID: Subject: BUG: After malloc(AVAILABLE_HEAP), which returns 0, every malloc, even malloc(0) returns ENOMEM. To: newlib@sourceware.org Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2016/txt/msg01048.txt.bz2 Hello! I think, I have found a bug which cause malloc() to not work, even malloc(0) without any successful malloc() before, so the heap should be empty. Description is available here: http://stackoverflow.com/questions/39088598/malloc-in-newlib-does-it-waste-memory-after-one-big-failure-allocation Library was built on x86_64 Debian configured as follows: CFLAGS_FOR_TARGET='-g3 -O0' \ ../configure \ --prefix="$g_tc_install" \ --target="$g_tc_target" \ --disable-newlib-supplied-syscalls \ --with-gmp="$g_tc_install" \ --with-mpfr="$g_tc_install" \ --with-mpc="$g_tc_install" \ --with-isl="$g_tc_install" \ ; Compiled with the bootstraped GCC configured as follows: LIBGCC2_FLAGS='-g3 -O0' \ ../configure \ --prefix="$g_tc_install" \ --target="$g_tc_target" \ --enable-languages='c,c++' \ --enable-__cxa_atexit \ --with-cpu="$g_tc_cpu" \ --with-mode="$g_tc_arm_mode" \ --with-newlib \ --with-headers="$g_tc_build/newlib/newlib/libc/include" \ --with-gmp="$g_tc_install" \ --with-mpfr="$g_tc_install" \ --with-mpc="$g_tc_install" \ --with-isl="$g_tc_install" \ ; Non-path variables was: export g_tc_target='arm-none-eabi' export g_tc_cpu='cortex-m7' export g_tc_arm_mode='thumb' Version was newlib-2.4.0.20160527, downloaded as a tar.