X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-4.8 required=5.0	tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
In-Reply-To: <ce08d44ac1c41b2145456992672dbc20.squirrel@zeusw.org>
References: <1341437446.12368.ezmlm@cygwin.com>	<ce08d44ac1c41b2145456992672dbc20.squirrel@zeusw.org>
Date: Fri, 6 Jul 2012 07:47:54 -0400
Message-ID: <CAF1jjLuPV+nYP7uOa8_AAa9b1dkLTruwq=a-K7oZN2=RkRHtCA@mail.gmail.com>
Subject: Re: Differences between C++ 'new' operator and 'malloc()' (NOT a C/C++ question)
From: NightStrike <nightstrike@gmail.com>
To: sc.cygwin.com@zeusw.org, cygwin@cygwin.com
Content-Type: text/plain; charset=ISO-8859-1
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On Thu, Jul 5, 2012 at 9:36 AM, Claude SIMON <sc.cygwin.com@zeusw.org> wrote:
> Let's consider a Java native component which only calls a 'malloc(1)'. It
> doesn't even test the returned value (it is usually not a good idea, but
> it doesn't matter here).
>
> This component :
> - compiled with g++ under Linux : works,
> - compiled with g++ under Mac OS : works,
> - compiled with Visual C++ under Windows : works,
> - compiled with g++ under Cygwin : CRASHES !
>
> It crashes as soon the 'malloc(1)' function is called. You don't even have
> the opportunity to test the returned value, nor to use it. It's perhaps a
> Cygwin bug, or perhaps a JVM/JRE/JDK bug ; I don't know and I don't bother
> (but if someone will make some investigation about that, I'm ready to help
> him or her if I can).
>
> When you replace the 'malloc()' by the 'new' operator, then the component
> compiled with g++ under Cygwin works too.


Can you provide a reduced self contained small test case that
demonstrates the problem?  That'll be your fastest path to a
resolution.  It's also the easiest way to explain what you are seeing.

--
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

