Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 417679 - net-proxy/dansguardian with dev-libs/libpcre-8.30-r2 - dansguardian[11437]: Error parsing the dansguardian.conf file or other DansGuardian configuration files
Summary: net-proxy/dansguardian with dev-libs/libpcre-8.30-r2 - dansguardian[11437]: E...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Network Proxy Developers (OBSOLETE)
URL: http://sourceforge.net/p/dansguardian...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-26 18:48 UTC by Tomáš Mózes
Modified: 2013-04-09 18:35 UTC (History)
7 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch from debian sid developers (80_fix_libcre3_max_sub_expression_allocation,2.41 KB, patch)
2012-07-03 20:41 UTC, Zdenek Herman
Details | Diff
libpcre bug confirmed (file_417679.txt,525 bytes, text/plain)
2012-10-21 13:25 UTC, Aecio F. Neto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tomáš Mózes 2012-05-26 18:48:47 UTC
dansguardian-2.10.1.1-r1 works fine with libpcre-8.12 (with the pcre flag enabled), however it doesn't work with the newest libpcre.

Workaround: emerge without pcre
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2012-05-28 00:10:37 UTC
[There is a 2.12.0.0 version out since August 2011, too.]

Please describe this incompatibility. Attach a build log or syslog/console output if relevant.
Comment 2 thanasis 2012-05-29 08:50:41 UTC
(In reply to comment #0)
> dansguardian-2.10.1.1-r1 works fine with libpcre-8.12 (with the pcre flag
> enabled), however it doesn't work with the newest libpcre.
> 
> Workaround: emerge without pcre

Thanks Tomas, for reporting this :)
I was about to get crazy, not knowing what was wrong, and it didn't work...
Comment 3 thanasis 2012-05-29 08:52:28 UTC
I also confirm this bug.
All you have to do is try it.
Comment 4 thanasis 2012-05-29 08:54:27 UTC
(In reply to comment #2)
> (In reply to comment #0)
> > dansguardian-2.10.1.1-r1 works fine with libpcre-8.12 (with the pcre flag
> > enabled), however it doesn't work with the newest libpcre.
> > 
> > Workaround: emerge without pcre
> 
> Thanks Tomas, for reporting this :)
> I was about to get crazy, as I couldn't find why it stopped working ...
Comment 5 thanasis 2012-05-29 08:59:06 UTC
The stable version (2.10.0.3) has the same problem.
Comment 6 Jeroen Roovers (RETIRED) gentoo-dev 2012-05-29 20:19:18 UTC
What problem?

Please describe it properly and then reopen this bug report.
Comment 7 Tomáš Mózes 2012-05-30 16:09:07 UTC
Sorry, I was busy and didn't report correctly.

Gentoo stable, dansguardian 2.10.1.1-r1, libpcre-8.30-r2, hardened

# emerge --info
Portage 2.1.10.49 (hardened/linux/amd64, gcc-4.5.3, glibc-2.14.1-r3, 3.2.11-hardened x86_64)
=================================================================
System uname: Linux-3.2.11-hardened-x86_64-Intel-R-_Xeon-R-_CPU_X5680_@_3.33GHz-with-gentoo-2.1
Timestamp of tree: Wed, 30 May 2012 14:45:01 +0000
app-shells/bash:          4.2_p20
dev-lang/python:          2.7.3-r1, 3.2.3
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.1-r1
sys-apps/openrc:          0.9.8.4
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.68
sys-devel/automake:       1.11.1
sys-devel/binutils:       2.21.1-r1
sys-devel/gcc:            4.5.3-r2
sys-devel/gcc-config:     1.5-r2
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r1
sys-kernel/linux-headers: 3.1 (virtual/os-headers)
sys-libs/glibc:           2.14.1-r3
ACCEPT_KEYWORDS="amd64"
CFLAGS="-mtune=native -O2 -pipe"
CXXFLAGS="-mtune=native -O2 -pipe"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j4"

Without pcre it works:

# eix dansguardian
[I] net-proxy/dansguardian
     Available versions:  2.10.0.3 (~)2.10.1.1 (~)2.10.1.1-r1 {clamav debug kaspersky ntlm pcre}
     Installed versions:  2.10.1.1-r1(17:18:05 05/30/12)(clamav -debug -kaspersky -ntlm -pcre)	 


With pcre it fails to run:

# eix dansguardian
[I] net-proxy/dansguardian
     Available versions:  2.10.0.3 (~)2.10.1.1 (~)2.10.1.1-r1 {clamav debug kaspersky ntlm pcre}
     Installed versions:  2.10.1.1-r1(17:14:52 05/30/12)(clamav pcre -debug -kaspersky -ntlm)

# /etc/init.d/dansguardian start
 * Starting DansGuardian ...                                                                                                                                                                              [ !! ]
 * ERROR: dansguardian failed to start

# cat /var/log/debug
May 30 17:15:22 server dansguardian[11437]: Error parsing the dansguardian.conf file or other DansGuardian configuration files

strace:
execve("/usr/sbin/dansguardian", ["dansguardian"], [/* 23 vars */]) = 0
brk(0)                                  = 0x1575358690
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b045cae000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=38349, ...}) = 0
mmap(NULL, 38349, PROT_READ, MAP_PRIVATE, 3, 0) = 0x2b045ca4000
close(3)                                = 0
open("/usr/lib64/libpcreposix.so.0", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340\n\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=9992, ...}) = 0
mmap(NULL, 2105368, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x2b04588e000
mprotect(0x2b045890000, 2093056, PROT_NONE) = 0
mmap(0x2b045a8f000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0x2b045a8f000
close(3)                                = 0
open("/lib64/libz.so.1", O_RDONLY)      = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\220$\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=92112, ...}) = 0
mmap(NULL, 2187408, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x2b045677000
mprotect(0x2b04568d000, 2093056, PROT_NONE) = 0
mmap(0x2b04588c000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x15000) = 0x2b04588c000
close(3)                                = 0
open("/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/libstdc++.so.6", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360\305\5\0\0\0\0\0"..., 832) = 832
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b045ca3000
fstat(3, {st_mode=S_IFREG|0755, st_size=1125032, ...}) = 0
mmap(NULL, 3304792, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x2b045350000
mprotect(0x2b045459000, 2097152, PROT_NONE) = 0
mmap(0x2b045659000, 40960, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x109000) = 0x2b045659000
mmap(0x2b045663000, 81240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2b045663000
close(3)                                = 0
open("/lib64/libm.so.6", O_RDONLY)      = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260M\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=534480, ...}) = 0
mmap(NULL, 2629768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x2b0450cd000
mprotect(0x2b04514f000, 2093056, PROT_NONE) = 0
mmap(0x2b04534e000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x81000) = 0x2b04534e000
close(3)                                = 0
open("/lib64/libgcc_s.so.1", O_RDONLY)  = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P-\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=87848, ...}) = 0
mmap(NULL, 2183832, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x2b044eb7000
mprotect(0x2b044ecc000, 2093056, PROT_NONE) = 0
mmap(0x2b0450cb000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x14000) = 0x2b0450cb000
close(3)                                = 0
open("/lib64/libc.so.6", O_RDONLY)      = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\200#\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1621064, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b045ca2000
mmap(NULL, 3731208, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x2b044b28000
mprotect(0x2b044cad000, 2097152, PROT_NONE) = 0
mmap(0x2b044ead000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x185000) = 0x2b044ead000
mmap(0x2b044eb2000, 20232, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2b044eb2000
close(3)                                = 0
open("/lib64/libpcre.so.1", O_RDONLY)   = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\34\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=251688, ...}) = 0
mmap(NULL, 2347072, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x2b0448ea000
mprotect(0x2b044927000, 2093056, PROT_NONE) = 0
mmap(0x2b044b26000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3c000) = 0x2b044b26000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b045ca1000
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b045c9f000
arch_prctl(ARCH_SET_FS, 0x2b045c9f720)  = 0
mprotect(0x2b044b26000, 4096, PROT_READ) = 0
mprotect(0x2b044ead000, 16384, PROT_READ) = 0
mprotect(0x2b0450cb000, 4096, PROT_READ) = 0
mprotect(0x2b04534e000, 4096, PROT_READ) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b045c9e000
mprotect(0x2b045659000, 36864, PROT_READ) = 0
mprotect(0x2b04588c000, 4096, PROT_READ) = 0
mprotect(0x2b045a8f000, 4096, PROT_READ) = 0
mprotect(0x1575347000, 8192, PROT_READ) = 0
mprotect(0x2b045cb1000, 4096, PROT_READ) = 0
munmap(0x2b045ca4000, 38349)            = 0
brk(0)                                  = 0x1575358690
brk(0x1575379690)                       = 0x1575379690
brk(0x157537a000)                       = 0x157537a000
socket(PF_FILE, SOCK_STREAM, 0)         = 3
socket(PF_FILE, SOCK_STREAM, 0)         = 4
socket(PF_FILE, SOCK_STREAM, 0)         = 5
open("/etc/dansguardian/dansguardian.conf", O_RDONLY) = 6
close(6)                                = 0
open("/etc/dansguardian/dansguardian.conf", O_RDONLY) = 6
read(6, "# DansGuardian config file for v"..., 8191) = 8191
read(6, "n two instances on separate serv"..., 8191) = 8191
read(6, "iled !! contentscanner = '/etc/d"..., 8191) = 6744
read(6, "", 8191)                       = 0
close(6)                                = 0
open("/usr/share/dansguardian/transparent1x1.gif", O_RDONLY) = 6
lseek(6, 0, SEEK_END)                   = 55
lseek(6, 0, SEEK_CUR)                   = 55
lseek(6, 0, SEEK_SET)                   = 0
read(6, "GIF89a\20\0\20\0\200\377\0\300\300\300\0\0\0!\371\4\1\0\0\0\0,\0\0\0\0"..., 8191) = 55
close(6)                                = 0
open("/etc/dansguardian/downloadmanagers/fancy.conf", O_RDONLY) = 6
read(6, "# The 'fancy' download manager.\n"..., 8191) = 2003
read(6, "", 8191)                       = 0
close(6)                                = 0
stat("/etc/dansguardian/lists/downloadmanagers/managedextensionlist", {st_mode=S_IFREG|0644, st_size=558, ...}) = 0
stat("/etc/dansguardian/lists/downloadmanagers/managedextensionlist", {st_mode=S_IFREG|0644, st_size=558, ...}) = 0
stat("/etc/dansguardian/lists/downloadmanagers/managedextensionlist.processed", 0x3db98ab91c0) = -1 ENOENT (No such file or directory)
stat("/etc/dansguardian/lists/downloadmanagers/managedextensionlist", {st_mode=S_IFREG|0644, st_size=558, ...}) = 0
stat("/etc/dansguardian/lists/downloadmanagers/managedextensionlist", {st_mode=S_IFREG|0644, st_size=558, ...}) = 0
open("/etc/dansguardian/lists/downloadmanagers/managedextensionlist", O_RDONLY) = 6
read(6, "# Managed extension list\n# For u"..., 8191) = 558
read(6, "", 8191)                       = 0
close(6)                                = 0
open("/usr/share/dansguardian/languages/ukenglish/fancydmtemplate.html", O_RDONLY) = 6
read(6, "<html>\n\t<head>\n\t<title>Downloadi"..., 8191) = 6294
mmap(NULL, 23639500001280, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 ENOMEM (Cannot allocate memory)
brk(0x159575384000)                     = 0x157537a000
mmap(NULL, 23639500132352, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 ENOMEM (Cannot allocate memory)
mmap(NULL, 134217728, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x2b03c8ea000
munmap(0x2b03c8ea000, 57761792)         = 0
munmap(0x2b044000000, 9347072)          = 0
mprotect(0x2b040000000, 135168, PROT_READ|PROT_WRITE) = 0
mmap(NULL, 23639500001280, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 ENOMEM (Cannot allocate memory)
close(6)                                = 0
write(2, "std::bad_alloc", 14std::bad_alloc)          = 14
write(2, "\n", 1
)                       = 1
open("/etc/localtime", O_RDONLY)        = 6
fstat(6, {st_mode=S_IFREG|0644, st_size=2246, ...}) = 0
fstat(6, {st_mode=S_IFREG|0644, st_size=2246, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b045cad000
read(6, "TZif2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\6\0\0\0\6\0\0\0\0"..., 4096) = 2246
lseek(6, -1440, SEEK_CUR)               = 806
read(6, "TZif2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\10\0\0\0\10\0\0\0\0"..., 4096) = 1440
close(6)                                = 0
munmap(0x2b045cad000, 4096)             = 0
getpid()                                = 17730
socket(PF_FILE, SOCK_DGRAM|SOCK_CLOEXEC, 0) = 6
connect(6, {sa_family=AF_FILE, path="/dev/log"}, 110) = -1 EPROTOTYPE (Protocol wrong type for socket)
close(6)                                = 0
socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC, 0) = 6
connect(6, {sa_family=AF_FILE, path="/dev/log"}, 110) = 0
sendto(6, "<11>May 30 17:26:21 dansguardian"..., 124, MSG_NOSIGNAL, NULL, 0) = 124
write(2, "Error parsing the dansguardian.c"..., 82Error parsing the dansguardian.conf file or other DansGuardian configuration files) = 82
write(2, "\n", 1
)                       = 1
close(5)                                = 0
close(4)                                = 0
close(3)                                = 0
exit_group(1)                           = ?


# cat /usr/src/linux/.config

# Linux/x86_64 3.2.11-hardened Kernel Configuration
CONFIG_GRKERNSEC_HARDENED_SERVER=y



I also tested it on an other machine (stable, not hardened 3.2.12) and it works even with the newest libpcre. So it's probably something with the hardened profile and/or kernel.
Comment 8 Will B. 2012-06-01 06:54:40 UTC
On my x86_64 hosts, I have this issue using the desktop profile.  On my x86 host, it works fine using the server profile.
Comment 9 Aecio F. Neto 2012-07-03 12:41:26 UTC
The issue that I was able to identify seems to be related to pcre indeed.
re_nsub is holding a large number after regexp compiling and raises a memory allocation error in RegExp.cpp module.

The only solution to have dansguardian running is to downgrade libpcre.
Comment 10 Zdenek Herman 2012-07-03 20:41:40 UTC
Created attachment 317073 [details, diff]
patch from debian sid developers
Comment 11 Zdenek Herman 2012-07-03 20:44:03 UTC
I have same problem.
I found this patch in debian repository. 
Now dansguardian works with pcre 8.30 without problems.
Many thanks debian developers !
Comment 12 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2012-09-16 10:32:29 UTC
Fixed in dansguardian-2.10.1.1-r2 . I'm going to keep this bug open for a while as a reminder to get the fix to stable.
Comment 13 Aecio F. Neto 2012-10-21 13:25:42 UTC
Created attachment 327048 [details]
libpcre bug confirmed

This patch solves the issue with libpcre starting from version 8.30
It is not a bug in Dansguardian itself, besides adjustments can be made to avoid it.
I would suggest to fix the problem within libpcre itself, since it affects many other sources based on its API.
Comment 14 Fabian Groffen gentoo-dev 2012-10-21 13:30:33 UTC
That's just a patch from upstream:
http://vcs.pcre.org/viewvc?view=revision&revision=1024

So you might want to Cc base-system here, and make this a libpcre bug.
Comment 15 Tomáš Mózes 2013-03-31 10:28:42 UTC
I've tested 2.12.03 with pcre 8.32 and the error "std::bad_alloc" disappeared.
Comment 16 Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2013-04-09 18:35:35 UTC
+  09 Apr 2013; Tom Wijsman <TomWij@gentoo.org> +dansguardian-2.10.0.3-r1.ebuild,
+  +dansguardian-2.12.0.3-r2.ebuild, -dansguardian-2.10.1.1-r1.ebuild,
+  -dansguardian-2.10.1.1-r2.ebuild, -dansguardian-2.10.1.1.ebuild,
+  -dansguardian-2.12.0.3.ebuild:
+  Revision bump, force people that are not running stable to use >=dev-
+  libs/libpcre-8.32. Fixes bug #417679 reported by Tomas Mozes. Dropped old,
+  will drop current stable once future stabilization is done.