This is the mail archive of the cygwin 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: xz -9 : Cannot allocate memory


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


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