Opened 3 years ago

Closed 12 months ago

#62369 closed defect (worksforme)

clamdscan segmentation fault in version

Reported by: essandess (Steve Smith) Owned by: danielluke (Daniel J. Luke)
Priority: Normal Milestone:
Component: ports Version: 2.6.4
Keywords: Cc:
Port: clamav

Description

sudo port -s install clamav
sudo clamdscan --multiscan --quiet --fdpass --move=/opt/Quarantine --log=/opt/local/var/log/clamav/ClamavScanSchedule.log "/"
Segmentation fault: 11
port -qv installed | grep clamav
  clamav @0.103.1_0 (active) platform='darwin 19' archs='x86_64' date='2021-02-28T08:44:59-0500'
macOS 10.15.7 19H524
Xcode 12.4 12D4e

Change History (10)

comment:1 Changed 3 years ago by essandess (Steve Smith)

Also, I have granted full disk access to clamdscan via System Preferences> Security & Privacy> Full Disk Access.

comment:2 Changed 3 years ago by essandess (Steve Smith)

This is also an issue without sudo on user files:

clamdscan --multiscan --quiet --fdpass --move=Downloads/Quarantine --log=Downloads/ClamavScanSchedule.log ~/Desktop/
Segmentation fault: 11

comment:3 Changed 3 years ago by mf2k (Frank Schima)

Cc: danielluke removed
Owner: set to danielluke
Status: newassigned

comment:4 Changed 3 years ago by jmroot (Joshua Root)

Please attach the crash log.

comment:5 Changed 3 years ago by essandess (Steve Smith)

Passing the flag --fdpass causes the issue.

Here's What I see from a core dump:

Enable core dumps:

ulimit -c unlimited
sudo launchctl limit core unlimited

Dump core:

sudo clamdscan --multiscan --quiet --fdpass --move=/opt/Quarantine/ --log=/opt/local/var/log/clamav/ClamavScanSchedule.log 
Segmentation fault: 11

Disable core dumps:

ulimit -c 0
sudo launchctl limit core 0 unlimited

Stack trace:

$ lldb `which clamdscan` -c /cores/core.67147 
(lldb) target create "/opt/local/bin/clamdscan" --core "/cores/core.67147"
Core file '/cores/core.67147' (x86_64) was loaded.

(lldb) bt all
* thread #1, stop reason = signal SIGSTOP
  * frame #0: 0x00007fff67ef8bb0 libsystem_platform.dylib`_platform_strncpy + 112
    frame #1: 0x000000010801c086 clamdscan`match_regex + 129
    frame #2: 0x0000000108018af0 clamdscan`chkpath + 64
    frame #3: 0x0000000108019205 clamdscan`parallel_callback + 110
    frame #4: 0x00000001081841c1 libclamav.9.dylib`cli_ftw + 271
    frame #5: 0x00000001080190d6 clamdscan`parallel_client_scan + 172
    frame #6: 0x000000010801a2d4 clamdscan`client_scan + 222
    frame #7: 0x000000010801a1b0 clamdscan`client + 940
    frame #8: 0x0000000108017f3c clamdscan`main + 728
    frame #9: 0x00007fff67d01cc9 libdyld.dylib`start + 1

comment:6 Changed 3 years ago by danielluke (Daniel J. Luke)

So, first can you upgrade to 0.103.2 and see if that bug is still present? If it is, can you report it upstream and then include the link to your report here? At first look, it doesn't appear to be related to the port - I'm happy to update MacPorts once upstream fixes it, though.

comment:7 Changed 3 years ago by essandess (Steve Smith)

I'm at:

$ clamdscan --version
ClamAV 0.103.2/26102/Mon Mar  8 07:03:13 2021

But this appears to be known and fixed: https://bugzilla.clamav.net/show_bug.cgi?id=12676

I'll try the most recent release and issue a PR.

Also, livecheck isn't working for this port. I'm not a livecheck expert, so I may defer this to the maintainer.

$ port livecheck clamav
Error: cannot check if clamav was updated (The requested URL returned error: 403 Forbidden)

comment:8 Changed 3 years ago by essandess (Steve Smith)

Nope, ClamAV 0.103.2 is the latest release, so this remains an active issue, at least on macOS. I've submitted a bug report:

https://bugzilla.clamav.net/show_bug.cgi?id=12727

comment:9 Changed 3 years ago by danielluke (Daniel J. Luke)

From the first bug report you linked, looks like it will be fixed in 0.104. We can update the port with a patch (although it looks like they made some additional related changes in the 0.104 branch) or wait for the 0.104 release.

The livecheck works for me (it's just pulling http://www.clamav.net/downloads and using a regex to look for version numbers).

comment:10 Changed 12 months ago by danielluke (Daniel J. Luke)

Resolution: worksforme
Status: assignedclosed
Note: See TracTickets for help on using tickets.