memory allocation failed

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
BigNoub
Posts: 33
Joined: 2015-12-29T14:49:52-07:00
Authentication code: 1151

memory allocation failed

Post by BigNoub »

I'm using this command:

Code: Select all

!convert input.jpg -scale 50x50! -depth 8 -fuzz 30% -transparent black sparse-color:- | convert -size 50x50 xc: -sparse-color voronoi '@-' +dither -colors 1 -depth 8 -format "%c" histogram:info: 
it's working fine on my local computer (ubuntu 16.04 with IM 7.0.8 ) but it's not working on a remote server (ubuntu 18.04 with IM 6.9.7), I get the error message:

Code: Select all

convert-im6.q16: not authorized `@-' @ error/property.c/InterpretImageProperties/3516.
convert-im6.q16: memory allocation failed SparseColorOption @ error/mogrify.c/SparseColorOption/535.
convert-im6.q16: not authorized `@-' @ error/property.c/InterpretImageProperties/3516.
The remote server has plenty of memory (12GB), and I've tried to paste the settings from my local policy.xml file:

Code: Select all

<policymap>
  <policy domain="resource" name="temporary-path" value="/tmp"/> 
  <policy domain="resource" name="memory" value="12GiB"/> 
  <policy domain="resource" name="map" value="4GiB"/> 
  <policy domain="resource" name="area" value="1GB"/> 
  <policy domain="resource" name="disk" value="16EB"/> 
  <policy domain="resource" name="file" value="768"/> 
  <policy domain="resource" name="thread" value="4"/> 
  <policy domain="resource" name="throttle" value="0"/> 
  <policy domain="resource" name="time" value="3600"/> 
  <policy domain="system" name="precision" value="6"/>
  <policy domain="cache" name="shared-secret" value="passphrase"/>
  <policy domain="coder" rights="none" pattern="EPHEMERAL" />
  <policy domain="coder" rights="none" pattern="URL" />
  <policy domain="coder" rights="none" pattern="HTTPS" />
  <!-- <policy domain="coder" rights="none" pattern="MVG" /> -->
  <policy domain="coder" rights="none" pattern="MSL" />
  <policy domain="coder" rights="none" pattern="TEXT" />
  <policy domain="coder" rights="none" pattern="SHOW" />
  <policy domain="coder" rights="none" pattern="WIN" />
  <policy domain="coder" rights="none" pattern="PLT" />
  <policy domain="path" rights="none" pattern="@*" />
  <!-- disable ghostscript format types -->
  <policy domain="coder" rights="none" pattern="PS" />
  <policy domain="coder" rights="none" pattern="EPS" />
  <policy domain="coder" rights="read|write" pattern="PDF" />
  <policy domain="coder" rights="none" pattern="XPS" />
  <policy domain="coder" rights="read|write" pattern="LABEL" />
    
</policymap>
Is there a setting I'm still missing? Do I need to do something special so that IM reads the changes to policy.xml? I've read I need to reboot my server but I can't do that, and !identify -list policy shows me the correct policy
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: memory allocation failed

Post by snibgo »

BigNoub wrote:<policy domain="path" rights="none" pattern="@*" />
That looks like the problem. It disallows "@-anything", and you are using "@-", so IM tells you that isn't authorized.
snibgo's IM pages: im.snibgo.com
BigNoub
Posts: 33
Joined: 2015-12-29T14:49:52-07:00
Authentication code: 1151

Re: memory allocation failed

Post by BigNoub »

that was it! Thanks!
Post Reply