From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15709 invoked by alias); 10 Feb 2017 18:27:14 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 40518 Received: (qmail 7804 invoked from network); 10 Feb 2017 18:27:13 -0000 X-Qmail-Scanner-Diagnostics: from park01.gkg.net by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(205.235.26.22):SA:0(0.5/5.0):. Processed in 2.214553 secs); 10 Feb 2017 18:27:13 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.5 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_SORBS_SPAM,RP_MATCHES_RCVD,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.1 X-Envelope-From: SRS0=9f3d=ZY=brasslantern.com=schaefer@bounces.park01.gkg.net X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at bounces.park01.gkg.net does not designate permitted sender hosts) X-Virus-Scanned: by amavisd-new at gkg.net Authentication-Results: amavisd4.gkg.net (amavisd-new); dkim=pass (2048-bit key) header.d=brasslantern-com.20150623.gappssmtp.com X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 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== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state: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=BVxv3zuVuC4rpiJVBAFuF4orqxM8JatrfmhksnZy2DpD2nz315yopqpXUUk3Rjz9fv E/nWKBGtDtPJ/bafgLxudN0x+hh0KIVesBtCUwaaVhs4i3zeFow8iVGbyYxVmOgI15oD xj2Ax5qvj19bMul8KMMsK/hlrT7XIXgBGwc0nHMgT87czzV5EdtZDBWLKg+TB3jBgUrs Vd9pJJv56+LSg2Auo4AEZwbW/iQMxD8bAMVxgCibPTesQapiG8RofZEgw/VB+Q0+qTe7 QNkJtfwVUI5FPB5fZ16vX6fbzsfPLA8WAYQxu8KBOqO8VbqhfLNUXTNO+B8WIedJK7vf j/OA== X-Gm-Message-State: AMke39nc1U7l2//xQL3Izo37LPbUCwyNXLlU86+cbCRUunDoLJdcVwLkslL3W2xRLkeYXQ== X-Received: by 10.176.64.168 with SMTP id i37mr5270144uad.60.1486751203444; Fri, 10 Feb 2017 10:26:43 -0800 (PST) Resent-From: Bart Schaefer Resent-Message-Id: <170210102659.ZM28983@torch.brasslantern.com> Resent-Date: Fri, 10 Feb 2017 10:26:59 -0800 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Resent-To: zsh-workers@closedmail.org From: Bart Schaefer Message-Id: <170210101132.ZM28854@torch.brasslantern.com> Date: Fri, 10 Feb 2017 10:11:32 -0800 In-Reply-To: <1486739822.1529995.876898008.190D9C9B@webmail.messagingengine.com> Comments: In reply to Sebastian Gniazdowski "Re: When is mem.c / malloc called?" (Feb 10, 7:17am) References: <1486729474.1489636.876722008.7B4EC1FC@webmail.messagingengine.com> <1486739822.1529995.876898008.190D9C9B@webmail.messagingengine.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: When is mem.c / malloc called? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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.