public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: Piotr Jedyk <jedaj.art@gmail.com>
To: newlib@sourceware.org
Subject: BUG: After malloc(AVAILABLE_HEAP), which returns 0, every malloc, even malloc(0) returns ENOMEM.
Date: Tue, 20 Sep 2016 17:43:00 -0000	[thread overview]
Message-ID: <CAGRYuPV8PqPnEkoi9nu+3zE1bNov2CiTWyR5dj-CT2Ks228SXA@mail.gmail.com> (raw)

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.

                 reply	other threads:[~2016-09-20 17:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAGRYuPV8PqPnEkoi9nu+3zE1bNov2CiTWyR5dj-CT2Ks228SXA@mail.gmail.com \
    --to=jedaj.art@gmail.com \
    --cc=newlib@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).