X-Recipient: archive-cygwin@delorie.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:to:from:subject:date:message-id:references
	:mime-version:content-type:content-transfer-encoding; q=dns; s=
	default; b=mAuicpwKDx2ihLPO4mE0tYIfwU0IM2cH1RB+W5CiKK+M0OQoMs4LH
	2rad6ns5fl2+MnHXqVJpFyEGfYg5x3kj4oRfF9IcE8AjoeZKBceh3Zn32MaaJGfr
	ZFan/TwE7c68QILqGNtum1h+ojRinxbW6oUl5jHDCCxYl4g+OwT30o=
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:to:from:subject:date:message-id:references
	:mime-version:content-type:content-transfer-encoding; s=default;
	 bh=+yPBKNUylsI8TBbCZjaLuvTRA1c=; b=LHRvl5mlu+fp20Jo0adJyHj9U0zI
	JGTB/XTIOLu0akPGRaWco24dlHIeYUw26tUrrX5kMLnYD78GqVWqwoFksYfRDPSM
	QUGxSwZ4Bv+rElTgtuPyP7PY3dzpMTZre0OpJkijyImF9xYTbPEmzTRlHmeycnRh
	JgAgd+1SEDoOgKY=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.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
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=0.7 required=5.0 tests=AWL,BAYES_00,FSL_HELO_BARE_IP_1,FSL_HELO_BARE_IP_2,HELO_MISC_IP,KHOP_THREADED,RCVD_NUMERIC_HELO,RDNS_NONE,SPF_FAIL autolearn=no version=3.3.2
X-HELO: plane.gmane.org
To: cygwin@cygwin.com
From: Achim Gratz <Stromeko@NexGo.DE>
Subject: Re: xz -9 : Cannot allocate memory
Date: Thu, 29 Aug 2013 14:13:02 +0000 (UTC)
Lines: 52
Message-ID: <loom.20130829T155739-66@post.gmane.org>
References: <50A41697.3080406@tiscali.co.uk>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
User-Agent: Loom/3.14 (http://gmane.org/)

David Stacey <drstacey <at> tiscali.co.uk> writes:
> I am trying to use 'xz -9' to compress a file, but the programme exits 
> with the error message 'Cannot allocate memory'. Here's what I tried:
> 
> $ echo Hello World > compress_me.txt
> 
> $ xz -9 compress_me.txt
> xz: compress_me.txt: Cannot allocate memory
[...]
> And this worked. Is this the correct way to fix the problem? If so, 
> please could we increment the heap size for xz in a post install script?

I'm using a self-compiled xz-5.0.5 that has started to exhibit that very
problem after updating to Cygwin 1.7.24.  Setting the initial heap size to
_anything_ but 0x0 will make the error go away.  I've run strace on it and
the error propagates from mmap64 apparently:

   81   64830 [main] xz 17764 fstat64: 0 = fstat(3, 0x4141A0)
   44   64874 [main] xz 17764 set_signal_mask: setmask 21807003, newmask 0,
mask_bits 21807003
   34   64908 [main] xz 17764 pthread_sigmask: 0 = pthread_sigmask(2,
0x4144A8, 0x0)
   46   64954 [main] xz 17764 read: read(3, 0x410160, 8192) blocking
 1199   66153 [main] xz 17764 fhandler_base::read: returning 8192, binary
mode
   45   66198 [main] xz 17764 read: 8192 = read(3, 0x410160, 8192)
  355   66553 [main] xz 17764 mmap64: addr 0x0, len 101253120, prot 0x3,
flags 0x22, fd -1, off 0x0
  402   66955 [main] xz 17764 mmap64: 0x79660000 = mmap()
   50   67005 [main] xz 17764 mmap64: addr 0x0, len 604307456, prot 0x3,
flags 0x22, fd -1, off 0x0
   41   67046 [main] xz 17764 seterrno_from_win_error:
/home/c.../winsup/cygwin/mmap.cc:1641 windows error 8
   62   67108 [main] xz 17764 geterrno_from_win_error: windows error 8 ==
errno 12
   23   67131 [main] xz 17764 mmap64: 0xFFFFFFFF = mmap()
   29   67160 [main] xz 17764 __set_errno: void* sbrk(ptrdiff_t):303 setting
errno 12
   37   67197 [main] xz 17764 mmap64: addr 0x0, len 604307456, prot 0x3,
flags 0x22, fd -1, off 0x0
   33   67230 [main] xz 17764 seterrno_from_win_error:
/home/c.../winsup/cygwin/mmap.cc:1641 windows error 8
   23   67253 [main] xz 17764 geterrno_from_win_error: windows error 8 ==
errno 12
   25   67278 [main] xz 17764 mmap64: 0xFFFFFFFF = mmap()

With the initial heap size set to 1MB, the same allocations for mmap work
just fine.  The mmap length used by xz is the same for files of all sizes.


Regards,
Achim.


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

