zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: When is mem.c / malloc called?
Date: Fri, 10 Feb 2017 10:11:32 -0800	[thread overview]
Message-ID: <170210101132.ZM28854@torch.brasslantern.com> (raw)
In-Reply-To: <1486739822.1529995.876898008.190D9C9B@webmail.messagingengine.com>

On Feb 10,  7:17am, Sebastian Gniazdowski wrote:
} Subject: Re: When is mem.c / malloc called?
}
} Don't know why, but now when I have the fprintf() ...
} then I see "Hello", and shell startup always ends in:
} 
}  mem.c:1341: MEM: allocation error at sbrk, size 20480.
} 
} i.e. aborts, so I guess I'm safe - the pathway to use non-standard,
} thread unsafe malloc() is blocked because it's not working.

What's not working is your debugging technique.  fprintf/fflush invoke
memory allocation, so if you use them *inside* the allocator, things
break.  You would need to use low-level system calls e.g. write()
directly to avoid this, or use an actual debugger like GDB and put a
breakpoint in malloc.


  reply	other threads:[~2017-02-10 18:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-10 12:24 Sebastian Gniazdowski
2017-02-10 15:17 ` Sebastian Gniazdowski
2017-02-10 18:11   ` Bart Schaefer [this message]
2017-02-10 18:25 ` Bart Schaefer
2017-02-10 19:45   ` Sebastian Gniazdowski

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=170210101132.ZM28854@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).