Bug 205035

Summary: mail/dovecot2: Change default build options to prevent potential memory leak
Product: Ports & Packages Reporter: sebastian
Component: Individual Port(s)Assignee: Adam Weinberger <adamw>
Status: Closed FIXED    
Severity: Affects Only Me Flags: bugzilla: maintainer-feedback? (adamw)
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   

Description sebastian 2015-12-05 11:51:41 UTC
Hi,

I am on FreeBSD 10.1 and I keep seeing potential memory leaks with Dovecot 2.2.19. So /var/log/mail.log fills up with stuff like this (and this goes on and on):

Oct 24 10:45:28 server1 dovecot: imap: Error: GC Warning: Repeated allocation of very large block (appr. size 20480):
Oct 24 10:45:28 server1 dovecot: imap: Error: 	May lead to memory leak and poor performance.

From talking to the Dovecot author, I believe the issue is caused by the garbage collection with boehm-gc (see https://www.mail-archive.com/search?l=dovecot@dovecot.org&q=subject:%22Memory+leak+or+misconfiguration%5C%3A+Repeated+allocation+of+very+large%09block%22&o=newest&f=1). As such, I disabled the relevant lines in the Makefile of Dovecot 2 and since I recompiled with these options, the memory leaks are gone. 

May I therefore propose to take this option out of the standard Makefile of Dovecot2? Likewise, may I propose to add MySQL to the list of standard build options for Dovecot 2?

Thanks.

Best regards
Sebastian
Comment 1 Adam Weinberger freebsd_committer freebsd_triage 2015-12-05 12:26:18 UTC
Hi Sebastian. Thanks for the bug report.

For the record, GC is *not* a default option. You enabled it yourself at some point, and you can deselect it at any time.

    cd /usr/ports/mail/dovecot2 && make config

I'll remove the option with the upcoming update, given that you've clearly shown that all it does at this time is cause memory leaks and log spamming.

I don't want to add MySQL to the default list. In my opinion, ports should, by default, build and install with the common dependencies that *everyone* will need. MySQL is only useful for very large installations, from what I know of it.

Can you tell me why MySQL should be a default option?
Comment 2 sebastian 2015-12-05 12:58:02 UTC
Hi Adam,

thanks for your swift response. 

I suppose I did enable gc at some stage - thanks for removing it anyway so others won't run into the same issue.

Well with regards to MySQL I understand your point - it is typically used when you have like virtual users stored in a SQL database. But okay, adding it was just a suggestion.

Thanks anyway!

Best regards
Sebastian
Comment 3 Adam Weinberger freebsd_committer freebsd_triage 2015-12-09 15:40:04 UTC
Okay, I removed the GC option in r403426. Thanks for tracking down the problem and for the bug report, Sebastian!