#82 dansguardian doesn't start on Mac OSX with malloc/mmap error


I've been successfully using dansguardian on Mac OSX for years through
the macports.org packaging project. Since I upgraded macports to v 2.1.0
and recompiled dansguardian it refuses to start. From the command line
dansguardian crashes with a mad mmap size value error message:

$ dansguardian
dansguardian(63116) malloc: mmap(size=1125728108154880) failed
(error code=12)
error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
Error parsing the dansguardian.conf file or other DansGuardian
configuration files

Note I'm using default configuration files and dansguardian shouldn't
fail to parse them.

I could narrow down the problem coming from line
int rc = dmpp->init(&lastplugin);
in the file src/OptionContainer.cpp

This error happens when the call to init in DownloadManager.cpp ends.

Does anyone have an idea why this init call fails ?


  • Aecio F. Neto

    Aecio F. Neto - 2012-06-01

    Which version of DG are you using, please?

  • Francois Claire

    Francois Claire - 2012-06-02

    The problem happens with both and

  • Comment has been marked as spam. 

    You can see all pending comments posted by this user  here

    Anonymous - 2012-06-03

    I last used DansGuardian a few years ago and was trying to get it going again today and ran into the same issues as fclaire.

    I'm using Mac OS X 10.7.3 and MacPorts version 2.1.1. I also tried downloading and installing directly from source with no success. I also tried version from source with no success.


    2012-11-03 update:
    On OS X 10.8.2, I have tried both DG from source, and DG from macports. The 2.12 from source runs but is useless, as it throws the mmap error whenever http traffic hits it. The macports version falls over and dies with a mmap error when you even just try to run it.

    Last edit: Anonymous 2012-11-03
  • Francois Herbert

    I'm having the same problem, except I'm not using mac ports, just downloaded the latest developer command line tools. Running 10.8.2 b12C60, dansguardian-

    Disabling the fancy plugin manager fixed this issue for me:
    (in dansguardian.conf):
    downloadmanager = '/usr/local/etc/dansguardian/downloadmanagers/fancy.conf'

    Edit - Actually out of three OS X.8.2 machines I've tried this on, I've only managed to get Dansguardian working on one of them by disabling the Fancy Plugin manager. The other two still give the malloc mmap error.

    The output of my gcc -v:
    Using built-in specs.
    Target: i686-apple-darwin11
    Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.11~28/src/configure --disable-checking --enable-werror --prefix=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.11~28/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
    Thread model: posix
    gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)

    Last edit: Francois Herbert 2012-11-15
  • Francois Herbert

    After some more investigation - compiling dansguardian in debug mode, it always gave the malloc error just after trying to parse the bannedregexpurl list:
    inRegExpURLList: http://www.apple.com
    inRegExpURLList (processed): www.apple.com
    dansguardian-debug(71578) malloc: mmap(size=17521522081366282240) failed (error code=12)
    error: can't allocate region
    *** set a breakpoint in malloc_error_break to debug
    57682 -connection handler caught an exception: std::bad_alloc

    This pointed me towards the pcre version I was running (and look at bug83) and realise that I was running pcre 8.31.
    Downgrading my version of pcre to 8.21 and recompiling dansguardian has fixed this malloc error for me.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks