Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: When is mem.c / malloc called?
- X-seq: zsh-workers 40518
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: When is mem.c / malloc called?
- Date: Fri, 10 Feb 2017 10:11:32 -0800
- Authentication-results: amavisd4.gkg.net (amavisd-new); dkim=pass (2048-bit key) header.d=brasslantern-com.20150623.gappssmtp.com
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=resent-from:resent-message-id:resent-date:resent-to:from:message-id :date:in-reply-to:comments:references:to:subject:mime-version; bh=O1kUnkEazb8nHG3+OtahE8ESqi2mbVYD/SRZhD6/K5c=; b=vRXgLs5fv2xASfWZ3lzZ+pW+EkO6jlLiWgBtrbAEOVkHzYvmTVMn0tn49wmNyzCWKh wJr66G2TpiLOGdAPBSpIiZYlXkC4eu0m+PkamniAekbNUxFE8z/tEZbXvKReZuvovA0Q m5w6jHXfBFg5TxGuVrfFQaxLwQF15rJSpmDVT4QTRj12wslauy6WmZZKMq94o3Bqii7L /pBDkpWr8KzvV3dT/9h0qBJl69wbCQZQUCB1x0OkQPfwNAfjHAxp8Znu2oHh9x6w17rW un4uGmzKmiARWptyWCDfdks7rEhlzsgBpmp7f0RXQEnlwyxGq8fb+fpTHn9KKGtFP9YG A/NQ==
- In-reply-to: <1486739822.1529995.876898008.190D9C9B@webmail.messagingengine.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <1486729474.1489636.876722008.7B4EC1FC@webmail.messagingengine.com> <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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author