Thanks for the feedback Aditya.
I will check if it's ok to do this in our environment and test it.
Original Message:
Sent: Thu October 24, 2024 03:34 AM
From: Aditya Kamath
Subject: about Memory Error in ClamAV for AIX
@Hector Speight
I thought to spend some time on this issue. So I reproduced your error on AIX 7.3
# clamscan /opt/freeware/lib/python3.9/ensurepip/_bundled/pip-23.0.1-py3-none-any.whl
Loading: 8s, ETA: 0s [========================>] 2.05M/2.05M sigs
Compiling: 3s, ETA: 0s [========================>] 41/41 tasks
calloc_problem: Not enough space
LibClamAV Error: cli_calloc(): Can't allocate memory (66047232 bytes).
calloc_problem: Not enough space
LibClamAV Error: cli_calloc(): Can't allocate memory (66047232 bytes).
LibClamAV Error: cli_ac_init: Can't allocate memory for data->lsigsuboff_(last|first)[0]
/opt/freeware/lib/python3.9/ensurepip/_bundled/pip-23.0.1-py3-none-any.whl: Can't allocate memory ERROR
As
@Ayappan P mentioned if we do,
ulimit -d unlimited
ulimit -m unlimited
And then run clamscan we get,
# clamscan /opt/freeware/lib/python3.9/ensurepip/_bundled/pip-23.0.1-py3-none-any.whl
Loading: 9s, ETA: 0s [========================>] 2.05M/2.05M sigs
Compiling: 2s, ETA: 0s [========================>] 41/41 tasks
/opt/freeware/lib/python3.9/ensurepip/_bundled/pip-23.0.1-py3-none-any.whl: OK
----------- SCAN SUMMARY -----------
Known viruses: 2051912
Engine version: 1.0.7
Scanned directories: 0
Scanned files: 1
Infected files: 0
Data scanned: 11.87 MB
Data read: 1.96 MB (ratio 6.06:1)
Time: 17.614 sec (0 m 17 s)
Start Date: 2024:10:24 02:32:41
End Date: 2024:10:24 02:32:59
Kindly try.
------------------------------
Aditya Kamath
Original Message:
Sent: Fri October 18, 2024 10:24 AM
From: Hector Speight
Subject: about Memory Error in ClamAV for AIX
We have scanned much larger files successfully so I suspect the issue is due to the file contents.
------------------------------
Hector Speight
Original Message:
Sent: Fri October 18, 2024 10:01 AM
From: Ayappan P
Subject: about Memory Error in ClamAV for AIX
Clamav's memory requirement is huge. It's not only about the size of file which is scanned. Clamav loads the entire virus database definitions in memory for scanning. So the data segment has to be big enough.
------------------------------
Ayappan P
Original Message:
Sent: Fri October 18, 2024 05:52 AM
From: Hector Speight
Subject: about Memory Error in ClamAV for AIX
We get the issue running the latest version on a small file as you can see below.
$ ls -l /opt/freeware/lib/python3.9/ensurepip/_bundled/pip-23.0.1-py3-none-any.whl-rw-r--r-- 1 root system 2055563 05 Apr 2024 /opt/freeware/lib/python3.9/ensurepip/_bundled/pip-23.0.1-py3-none-any.whl$ /opt/freeware/bin/clamdscan /opt/freeware/lib/python3.9/ensurepip/_bundled/pip-23.0.1-py3-none-any.whl/opt/freeware/lib/python3.9/ensurepip/_bundled/pip-23.0.1-py3-none-any.whl: Can't allocate memory ERROR----------- SCAN SUMMARY -----------Infected files: 0Total errors: 1Time: 0.409 sec (0 m 0 s)Start Date: 2024:10:18 10:14:31End Date: 2024:10:18 10:14:31$ /opt/freeware/bin/clamscan /opt/freeware/lib/python3.9/ensurepip/_bundled/pip-23.0.1-py3-none-any.whlLoading: 19s, ETA: 0s [========================>] 8.70M/8.70M sigsCompiling: 5s, ETA: 0s [========================>] 41/41 taskscalloc_problem: Not enough spaceLibClamAV Error: cli_calloc(): Can't allocate memory (74802176 bytes).calloc_problem: Not enough spaceLibClamAV Error: cli_calloc(): Can't allocate memory (74802176 bytes).LibClamAV Error: cli_ac_init: Can't allocate memory for data->lsigsuboff_(last|first)[0]/opt/freeware/lib/python3.9/ensurepip/_bundled/pip-23.0.1-py3-none-any.whl: Can't allocate memory ERROR----------- SCAN SUMMARY -----------Known viruses: 8699039Engine version: 1.0.7Scanned directories: 0Scanned files: 0Infected files: 0Total errors: 1Data scanned: 4.20 MBData read: 1.96 MB (ratio 2.15:1)Time: 28.088 sec (0 m 28 s)Start Date: 2024:10:18 10:16:27End Date: 2024:10:18 10:16:56$ /opt/freeware/bin/clamscan -VClamAV 1.0.7$ oslevel -s7200-05-08-2420
Please can your team look into this issue again please
------------------------------
Hector Speight
Original Message:
Sent: Thu May 11, 2023 09:19 AM
From: Ayappan P
Subject: about Memory Error in ClamAV for AIX
Generally in AIX , the user ulimit values are at a lower level by default.
So when working with larger files, you may need to increase the data ulimit.
Try setting "ulimit -d unlimited" and check again.
------------------------------
Ayappan P
Original Message:
Sent: Tue May 09, 2023 11:06 AM
From: 力 小山田
Subject: about Memory Error in ClamAV for AIX
I will let you know the results of my trial with ClamAV 0.104.2 which I have in AIX toolbox.
# clamscan /home/cecuser/lwiservice.exe
Loading: 20s, ETA: 0s [========================>] 8.65M/8.65M sigs
Compiling: 5s, ETA: 0s [========================>] 41/41 tasks
calloc_problem: Not enough space
LibClamAV Error: cli_calloc(): Can't allocate memory (66256128 bytes).
calloc_problem: Not enough space
LibClamAV Error: cli_calloc(): Can't allocate memory (66256128 bytes).
LibClamAV Error: cli_ac_init: Can't allocate memory for data->lsigsuboff_(last|first)[0]
/home/cecuser/lwiservice.exe: Can't allocate memory ERROR
----------- SCAN SUMMARY -----------
Known viruses: 8652920
Engine version: 0.104.2
Scanned directories: 0
Scanned files: 0
Infected files: 0
Total errors: 1
Data scanned: 0.00 MB
Data read: 0.15 MB (ratio 0.00:1)
Time: 27.111 sec (0 m 27 s)
Start Date: 2023:02:16 07:35:28
End Date: 2023:02:16 07:35:55
# freshclam -V
ClamAV 0.104.2/26814/Thu Feb 16 03:40:04 2023
I put the error file at the following URL.
https://www.uinet.or.jp/~oyamada/error_files.zip
------------------------------
Tsutomu Oyamada
Original Message:
Sent: Tue May 09, 2023 02:49 AM
From: Ayappan P
Subject: about Memory Error in ClamAV for AIX
Please give more info on what is tried and what kind of memory errors are seen with ClamAV.
------------------------------
Ayappan P
Original Message:
Sent: Mon May 08, 2023 10:57 AM
From: 力 小山田
Subject: about Memory Error in ClamAV for AIX
Hi, all.
Can you give me some advice on memory errors that occur with ClamAV for AIX?
I also contacted ClamAV-users ML about 2 months ago, but it was said to be an AIX specific problem and a fixed version has not come out.
Comments in ClamAV-users ML:
In regard to the specific errors you're seeing, they appear to be when scanning EXE/DLL and JAR files, and appear to be specific to AIX, which I believe is a big-endian system. I suspect this represents 1 or 2 big endian compatibility bugs.
What I want to make sure is:
A) Will this bug be resolved in the next version?
B) When will the next version be released?
Thank you for providing OSS for AIX with AIX Toolbox.
Let us know what the AIX OSS team thinks.
------------------------------
Tsutomu Oyamada
------------------------------