[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#413551: #413551: apt-cache randomly abort on std::bad_alloc



Hi,

> By moments when I launch apt-search whatever, I get the following
> results :
> % apt-cache search php
> terminate called after throwing an instance of 'std::bad_alloc'
>   what():  St9bad_alloc
> zsh: abort      apt-cache search php

I got same problem.

When I try to search a package using "(apt-cache or aptitude) search" command,
I got sometimes following error message:
terminate called after throwing an instance of 'std::bad_alloc'
  what():  St9bad_alloc

I have three computers with Debian installed.
But this problem is only occurs on one of these.


'std::bad_alloc' exception is occurred when trying to allocate too large memory.
So I think this problem is related to allocation of the memory.

I've traced apt-cache using gdb, and then I saw this problem is caused by incorrect setting in /etc/apt/apt.conf.
I have used following setting:
APT::Cache-Limit "100000000";
This makes apt-cache allocate 100MB memory in any time.
The computer that get this problem have 96MB memory (32MB ram + 64MB swap).
So memory allocation sometimes failed.

I've changed /etc/apt/apt.conf to:
APT::Cache-Limit "20000000";
and "apt-cache search" now works!


I suggest you to check your /etc/apt/apt.conf file and APT::Cache-Limit value, and decrease that value if it is too large for you.


Hope it helps.


Thanks,
Morita Sho



Reply to: