cannot initialze avast! engine: invalid agrument

hello,

since yesterday evening i am getting following error message when running avast

cannot initialze avast! engine: invalid agrument

3 independent instances on 3 different mashines are affected. Defenetely, nothing was changed on those systems. Could it be that the latest vps file (100328-1) is invalid? Exactly when this vps file was installed, it stopped working!

Hello,

I’m getting the same error-message. Before the update of the 29th of march, everything worked ok, after the update AVAST isn’t able to initialise.
I removed AVAST completely and installed it again but to no avail.

What’s up?

Kind regards,

PeterVO

anybody out there whose avast is still working with the 100328-1 vps file?

It would be nice to get some reaction of the support team to be honest.

as far as I can see, now 100329-0 has been released, it has the same issue:

ERROR-0: New VPS: 100329-0 (date: 29.03.2010) succesfully installed.

$ avastcmd -aic -tA /tmp
avastcmd: can not initialize avast! engine: Invalid argument

new version has been released:

$ avastcmd -V
avastcmd: avastcmd v3.0.1
VPS: 100329-1 (date: 29.03.2010)
Copyright(C) 2003-2007. ALWIL Software. All rights reserved.

but still not solved:

$ avastcmd -aic -tA /tmp
avastcmd: can not initialize avast! engine: Invalid argument

Is the development team aware of this issue?

hello,
please try the latest version:

http://www.avast.com/linux-unix-edition#tab4

Hello,

thanks for the reply. I am trying it.

I have no idea if I can manage it to install the new software on my systems in an acceptable period of time. Could you please make available the latest working vps file for the old version of the software resp. let me know where I could get it?

Hallo,
on my side it works OK:
zilog@sinclair:/mnt/storage/t/feb2010build$ ./stestik /etc/passwd
Status: 0 (Success)
VPS info: Structure 2147483659 Version 268642561 UncompressSize 55881907 Compiled 29.03.2010
here-init
STATUSzhandle: 0
I’m 0 running, variable at 0xbf863380, handle 0x85457f8.

/etc/passwd
FILE: /etc/passwd SIZE: 483 OFFSET: 0 SIZE: 483[ OK ]
Thread 0 has found 0 viruses.
Waiting on getchar(); all handles closed, reloading


on Mac, works OK, but indeed, avastcmd started to fail. With older 400.vps it works OK, with new one not. BUT, customised engine which doesn’t use SHM memory sharing, works still OK (used on Mac machines) - so here would be the cause. Checking the cause right now…

pc

Well, here’s the cure:

do as root: sysctl -w kernel.shmmax=100000000

reason? older kernels have an artificial limitations which dictates the maximum size of one SHM block in bytes. And, one block of our database exceeded this limit. so just, relax them to more reasonable values. that’s it.

sinclair:/mnt/storage/t/feb2010build# sysctl -a | grep shm
kernel.shmmni = 4096
kernel.shmall = 2097152
kernel.shmmax = 33554432

—> 0x6de86d68 8880136 zilog 600 33178972 3

just issue those upon system startup in /etc/init.d/rcS or similar system-wide initscript on your distribution (see /etc/inittab, the si:: line).

I have tested the new version of avast and found that it did not solve the problem:

dpkg -l |grep avast
ii avast4server 3.2.0 avast! Antivirus toolkit
ii libavastengine 4.7.6 avast! engine library

avastcmd -V
avastcmd: avastcmd v3.2.0
VPS: 100329-1 (date: 29.03.2010)
Copyright(C) 2003-2010. ALWIL Software. All rights reserved.

$ avastcmd -aic -tA /tmp
avastcmd: can not initialize avast! engine: Invalid argument

  1. Which changes were done in the versions
    avast4server-3.0.1-i586.deb to avast4server-3.2.0-i586.deb resp
    libavastengine-4.7.4-i586.deb to libavastengine-4.7.6-i586.deb

Were those versions just released to fix this bug or were there other changes?
Are there any release notes available?

  1. zilog, thanks for your investigations and suggestions. I have to study what exactly your command does and if it can harm my systems.

a) Could you please define “old kernel”? I can reproduce the problem on 2.6.31-20 which isn’t that old imho.

b) I cannot just execute some commands and hope that anything will still work, which brings me again to my question of my previous post:

  1. Could you please make available the latest working vps file for the old version of the software resp. let me know where I could get it?

Thanks.

This has nothing to do with avast versions. It’s just a low default value, determining the resource usage on your system - and avast’s database 400.vps has grown to the size where this limit is simply not sufficient anymore. That’s all. So, there’s no other solution than just relaxing this number. It’s just a variable after all…

regards,
pc

  1. won’t harm your system. what harms your system is that nonsensually-low value. it’s just an artificial sysctl-limit.
    2a) there are also customised kernels that have those limits relaxed already, etc. it’s just a default value in the sources, fortunately runtime-tunable.
    2b) you can, and in this case, you really should. there’s no sideeffect - loading kernel.shmmax with bigger value is harmless.
  2. it’s not wise to use old vps - this has no sense. rather adjust your system to be able to run the latest one :).

regards,
pc

hello zilog,

thanks, but, I still don’t know if i have to upgrade to the new version of avast or not. Since I was asked in this thread to upgrade my avast and to try if it solves the issue, I thought maybe this release was made to fix the bug described in this thread. Obviously it was not, so, what is this new version good for? It would be nice if somebody could say which improvements have been done so that I can decide if an update is urgent or not.

In your example, you have increased the max shared memory by about 300%. What is the acutal amount of shared memory required by avast? Is this value expected to even grow? I am asking this because you wrote

And, one block of our database exceeded this limit.

This sounds to me that the required amount of shared memory won’t increase with increasing file/database size of the vps, until a new big block comes in, am I right?

BUT, customised engine which doesn't use SHM memory sharing

Why is shared memory used anyway then? Does it make sense to add some command line parmeter to disable usage of shared memory? Or disable it at all?

Thanks.

the release was built by me, fixes some minor bugs, but NOT this one. because it’s about kernel limitation versus 400.vps size.

the value will grow, so 300% is good estimate for the 400.vps lifetime (we’d like to move to avast5 style too, for Linux). the block which exceeded the limit is the one which is growing fastest - macro-block. Shared memory was used in Windows world, and when porting it to Linux, this principle was kept (bad decision, from my point of view - SHM is a problem on many platforms). It’s deep inside the whole engine, far below the level where cmdline-switch can change the system-wide functionality. In other words, you need customised libavastengine.so.

pc

Thanks all the same but that is a link to the server version. I’m trying to get the free home version working. Any ideas?

Cheers,

Michael in Melbourne, Australia.

read the entire thread :wink:

Again:

  1. it’s not a bug, don’t look for newer version - rather the VPS size has grown and reached the 32MB limit in linux kernel. This limit is rather artificial, conservative, ande could be changed using /proc or sysctl to more reasonable value. just change the limit. otherwise, virus database cannot fit into SHM. no way.

  2. details here: http://forum.avast.com/index.php?topic=57775.0

regards,
pc

Hi folks.

just keep the older version installed… http://www.avast.com/files/linux/avast4workstation_1.2.0-2_i386.deb
extracte the 400.vps file from the current version
paste that file in to your /.avast folder in your home folder.
and the database is up to date.

Which lines of code do I issue in the rcS file? Is it just sysctl -w kernel.shmmax=100000000?

or is the next lines?
sinclair:/mnt/storage/t/feb2010build# sysctl -a | grep shm
kernel.shmmni = 4096
kernel.shmall = 2097152
kernel.shmmax = 33554432

Thanks

Hallo,
grepping - just to get the limits (to check whether your system is affected by this limit-exhaustion).
Then, sysctl -w is a method how to set internal kernel variables without any dependence on the /proc filesystem (so, you can place it anywhere in your rcS script).

regards,
pc