This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: 1.3.22-1 on XP: malloc returns overlapping buffers


> From: cygwin-owner@cygwin.com [mailto:cygwin-owner@cygwin.com]On Behalf
> Of roconnor

> I am finding that under some circumstances a buffer returned by malloc
> will overlap with a buffer returned by a previous call to malloc that
> has not been freed.  I was able to reduce it to the following test
> case.  Running under cygwin 1.3.22-1 on Windows XP Professional
> Version 2002 SP1 it reports an overlap of 4824 bytes on two different
> machines, as well as on a third machine running Windows 2000 5.00.2195
> SP4.  On Windows NT 4.0.1381, it finds no overlap.
>
> Am I doing something wrong or is there a bug in malloc or XP?  More
> details below.
--8<--

-- Win98SE --
$ gcc -o test test.c
$ ./test
malloc (16777216) = -2074415096
overlap = 2084322112
$ uname -a
CYGWIN_98-4.10 Annika 1.3.22(0.78/3/2) 2003-03-18 09:20 i686 unknown unknown
Cygwin
$ cygcheck -svr >~/c_svr98.txt


Conclusion: Don't use "int"


-- Win2000 --

$ gcc -o test test.c
$ ./test
malloc (16777216) = 6881288
malloc (16777216) = 23724040
malloc (16777216) = 40566792
malloc (16777216) = 57409544
malloc (16777216) = 74252296
malloc (16777216) = 91095048
malloc (16777216) = 107937800
malloc (16777216) = 124780552
malloc (16777216) = 141623304
malloc (16777216) = 570687496
overlap = 4928
$ uname -a
CYGWIN_NT-5.0 P450 1.3.22(0.78/3/2) 2003-03-18 09:20 i686 unknown unknown
Cygwin

 The machine is  a P2/450 w 256MB RAM

 As I can run this Cygwin installation from W98SE i have done the test there
too...
I'll report on that in another mail.

/Hannu E K Nevalainen, B.Sc. EE Microcomputer systems - 59°16.37'N,
17°12.60'E
--END OF MESSAGE--

Attachment: c_svr.txt
Description: Text document

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]