delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2019/09/12/12:13:39

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:to:cc:subject:date:message-id:references
:in-reply-to:content-type:content-id:content-transfer-encoding
:mime-version; q=dns; s=default; b=ZrZYIyWDdanoFSorBSBOL8rPBPyvM
06c/KhmGD37BZjtLCo8Q18KqoqbjaKw2ZMDWxI1g5fdDQiWvUODxVrNTExI+3wyC
OfrSgf6jNcJPqF1pTBWdFJ3xJdYOiL2g5abFwVhwTC4biZ3fB6mfeGl0Jm4bQQu6
gqwAB5/Yh0VjjE=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:to:cc:subject:date:message-id:references
:in-reply-to:content-type:content-id:content-transfer-encoding
:mime-version; s=default; bh=gLPI3vdDSPEszGitWZQnscXbEkI=; b=wLv
wjnTQVKsexX4qlNXJnb2zRC//Gkw3ppAVIZ0pXUn7uVZAwUKFCTAtVouDtJgg6jH
L5oK/ozRh0I+wZlOQyV+ZFPvKKlCxfAJR0mofDJq3YF0tzyu+0FAu1wb9HRTUYku
OU52bR7+Ib3C/NJBQq1x1APXThLGpgFa2oGRD3x8=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 spammy=k
X-HELO: NAM04-CO1-obe.outbound.protection.outlook.com
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lKHH3oyP1B8zlu2RhyY3a9CfqeS2MdPPAfcyeUT9cJTp0AzBM4P+2AgmMVnU95s7Nrz1vN7mBu/FdSHadrXWRy665NITdKnrxho4VZrRqv6unnas0MF/OsJBcvggHF6TFiOj85q1AOp9p7YAj9jTfgBjlKXHATt3ZBvj/6glC2Hbcck6s3VLIo4hDDEsz6eRLkK3wscQPhBXo4TA7N/VSsTse2Hxt0rNpnbwtk1ZtEXtg6INjGvhDM1HQTKHwIngle2p6GWQ+msPQ0oBwxoClmSdA3MhAJGzIcsnlu4whFRXoyjiGnUdU5FdbgHLlGK5sXqhVZbvuMcBBNQRQcjvaQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=97vbvUiFpTkiHa6o5fWtGBwDRzoce2kXU94yyAZXWmU=; b=h3Az6CV2z68PKfaGimsMM32FwrPO821wp0gemWPNpbBbjKY/uQcht45Nf2WWEs58Wjt28Hc/5G90zI3voiY8v7QKBRbPJNMUOg0TfhW5GHCY4R+YoFQm46Vf3ggK6cQsUQ+oEmaopnlJ/VRnLgpqvcpF+5L1t/nRts0HOScmXIsDj8RvrRQnAz0YvPQdG0Y1ixKwrdVmk/CzWwnvYupbawdm5T7ltlNO++W/YDUw0xHnNNfq1tz7sgM8apfG7B8CnMqTyDOQb9MAApzY+ZgCuQ/61Sh7rDvLmFH2YczrFL2Zy1Ask1AMOoMpd84opBlEyHKl43ABG5U+ktLCI+oM7Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cornell.edu; dmarc=pass action=none header.from=cornell.edu; dkim=pass header.d=cornell.edu; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cornell.edu; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=97vbvUiFpTkiHa6o5fWtGBwDRzoce2kXU94yyAZXWmU=; b=eOh1JJ+fxZVYy/rNDfJq3DJztwwytRqEqErb+lUv8G0XjQfBwuqRZqs3ffVMzfRRUUSRKKOlWy4Iu6AhmUiL1BJTVPFlHk2+r05hdUpz/cgcoWbU/APvnpGd+cwLr44N0Tlp89BEJua0267fiV+LsdgjXlMtll2mk1pH7YwWEKA=
From: Ken Brown <kbrown AT cornell DOT edu>
To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
CC: =?utf-8?B?UGV0ciBTa2/EjcOtaw==?= <pskocik AT gmail DOT com>
Subject: Re: malloc(0) crashing with SIGABRT
Date: Thu, 12 Sep 2019 16:12:36 +0000
Message-ID: <e6e9a36c-e388-7e74-850c-4607a74c7643@cornell.edu>
References: <366918d8-b505-45be-dc28-303579f17341 AT gmail DOT com> <78e19eb7-956e-cd05-a076-e56ce347bbbe AT gmail DOT com>
In-Reply-To: <78e19eb7-956e-cd05-a076-e56ce347bbbe@gmail.com>
user-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0
authentication-results: spf=none (sender IP is ) smtp.mailfrom=kbrown AT cornell DOT edu;
x-ms-exchange-purlcount: 1
x-ms-oob-tlc-oobclassifiers: OLM:6430;
received-spf: None (protection.outlook.com: cornell.edu does not designate permitted sender hosts)
x-ms-exchange-senderadcheck: 1
x-ms-exchange-transport-forked: True
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: IAyeA2bttB0j5+c1MVQpkUXwZ3cMusN4wm5PCfLCcLmxNbJHgPlIzWEQqobFnoYEtFevYNANPL2JkgjAX+W4HQ==
X-IsSubscribed: yes
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id x8CGDEAi030644

On 9/9/2019 1:13 PM, Petr Skočík wrote:
> There's been a twitter discussion on how different POSIX platforms
> handle malloc(0): https://twitter.com/sortiecat/status/1170697927804817412 .
> 
> As for Cygwin, the answer appears to be "not well", but this should be
> easy to fix.

Can you show how you produced a crash?  It works fine for me with the following 
test program:

$ cat malloc_zero.c
#include <stdlib.h>
#include <stdio.h>

int
main ()
{
   printf ("malloc (0) = %p\n", malloc (0));
}

$ gcc -Wall -o malloc_zero malloc_zero.c

$ ./malloc_zero.exe
malloc (0) = 0x8000003c0

[This is on 64-bit Cygwin.  It's the same on 32-bit, but with a different address.]

Ken

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


- Raw text -


  webmaster     delorie software   privacy  
  Copyright 2019   by DJ Delorie     Updated Jul 2019