maxmind / GeoIP2-perl

Perl API for MaxMind's GeoIP2 web services and databases
https://metacpan.org/release/GeoIP2/
Other
18 stars 11 forks source link

Inconsistent failures when opening GeoLite2-ASN.mmdb #82

Closed pprindeville closed 1 year ago

pprindeville commented 1 year ago

I'm trying to simultaneously use the GeoLite2-Country.mmdb and GeoLite2-ASN.mmdb databases as I migrate over from Geo::IP. If I run the following program locally it works fine:

#!/usr/bin/perl -w

use GeoIP2::Database::Reader;

use strict;
use warnings;

my $reader = GeoIP2::Database::Reader->new(
    file => '/usr/share/GeoIP/GeoLite2-Country.mmdb',
    locales => [ 'en' ]
);

my $record = $reader->country(ip => '24.116.100.90');

print $record->country()->iso_code(), "\n";

my $reader2 = GeoIP2::Database::Reader->new(
    file => '/usr/share/GeoIP/GeoLite2-ASN.mmdb',
    locales => [ 'en' ]
);

$record = $reader2->asn(ip => '24.116.100.90');

print $record->autonomous_system_organization(), "\n";

exit(0);

on a Fedora 37 system that's updated. I downloaded the .mmdb's earlier today.

I've also installed the XS reader for speed.

If I put the following extra lines into mimedefang-filter (just before filter_relay()) and restart the mimedefang.service it fails with:

Jul 03 20:53:56 mail.redfish-solutions.com mimedefang-wrapper[99720]: Couldn't create GeoIP2::Database::Reader object at /etc/mail/mimedefang-filter line 2907.
Jul 03 20:53:56 mail.redfish-solutions.com mimedefang-wrapper[99720]: Compilation failed in require at /usr/bin/mimedefang.pl line 351.

The code is this:

use GeoIP2::Database::Reader;

my $reader = GeoIP2::Database::Reader->new(
   file => '/usr/share/GeoIP/GeoLite2-Country.mmdb',
   locales => [ 'en' ]
);

die "Couldn't create GeoIP2::Database::Reader object" unless $reader;

my $reader2 => GeoIP2::Database::Reader->new(
    file => '/usr/share/GeoIP/GeoLite2-ASN.mmdb',
    locales => [ 'en' ]
);

die "Couldn't create GeoIP2::Database::Reader object" unless $reader2;

By line number it's the 2nd die that's triggering, not the first.

I don't understand why it works in my stub program but fails in mimedefang-filter. I tried to look at the source of GeoIP2::Database::Reader and try to figure out why new() is returning undef, but of course there's no sub new() and I don't yet know Moo so I can't figure out what gets called instead.

The pivot from using the Country database in Geo::IP to using the above GeoLite2-Country.mmdb database was simple enough. But I can't figure out why it works in the trivial PoC program but fails in mimedefang-filter when cutting over the the ASN database.

It's not a uid/gid issue as the owner and permissions on both databases are identical.

It's not an SElinux issue either because ausearch turned up no events. I noticed that geoipupdate doesn't restore the SElinux context on the files it downloads, so I forced that manually:

$ chcon system_u:object_r:usr_t:s0  /usr/share/GeoIP/GeoLite2-*.mmdb

but that makes no difference.

Only other thing I can think of is OOM, but it's not coredumping.

What would cause new() to fail? How do I get a smoking gun?

horgh commented 1 year ago

I noticed there's a => on one of the lines. Could that be doing it? my $reader2 => GeoIP2::[etc]

pprindeville commented 1 year ago

For giggles, and because I'm out of ideas, I ran memusage:

# memusage ./geolite2.pl 
US
CABLEONE

Memory usage summary: heap total: 39741317, heap peak: 18099301, stack peak: 24208
         total calls   total memory   failed calls
 malloc|     138702       18150899              0
realloc|      71125        5500384              0  (nomove:39361, dec:12927, free:0)
 calloc|      51772       16090034              0
   free|     120746       16072473
Histogram for block sizes:
    0-15          69477  26% ==================================================
   16-31          41400  15% =============================
   32-47          47711  18% ==================================
   48-63          34022  13% ========================
   64-79          12086   4% ========
   80-95          19186   7% =============
   96-111          3359   1% ==
  112-127          4463   1% ===
  128-143          3181   1% ==
  144-159          2072  <1% =
  160-175          1774  <1% =
  176-191          1607  <1% =
  192-207           466  <1% 
  208-223           960  <1% 
  224-239           338  <1% 
  240-255           242  <1% 
  256-271          1076  <1% 
  272-287           277  <1% 
  288-303           195  <1% 
  304-319           456  <1% 
  320-335           911  <1% 
  336-351           211  <1% 
  352-367           211  <1% 
  368-383           157  <1% 
  384-399           504  <1% 
  400-415           143  <1% 
  416-431           133  <1% 
  432-447            77  <1% 
  448-463            89  <1% 
  464-479           329  <1% 
  480-495            70  <1% 
  496-511            89  <1% 
  512-527           323  <1% 
  528-543            72  <1% 
  544-559          2835   1% ==
  560-575           246  <1% 
  576-591            41  <1% 
  592-607            46  <1% 
  608-623            69  <1% 
  624-639            45  <1% 
  640-655           348  <1% 
  656-671            58  <1% 
  672-687           182  <1% 
  688-703            40  <1% 
  704-719            21  <1% 
  720-735            22  <1% 
  736-751            23  <1% 
  752-767            42  <1% 
  768-783            48  <1% 
  784-799            34  <1% 
  800-815           144  <1% 
  816-831            19  <1% 
  832-847            36  <1% 
  848-863            27  <1% 
  864-879            39  <1% 
  880-895            20  <1% 
  896-911            19  <1% 
  912-927            22  <1% 
  928-943            23  <1% 
  944-959            16  <1% 
  960-975            18  <1% 
  976-991           122  <1% 
  992-1007          228  <1% 
 1008-1023          107  <1% 
 1024-1039          121  <1% 
 1040-1055           32  <1% 
 1056-1071         2573  <1% =
 1072-1087           28  <1% 
 1088-1103           34  <1% 
 1104-1119           15  <1% 
 1120-1135           29  <1% 
 1136-1151           11  <1% 
 1152-1167           24  <1% 
 1168-1183           85  <1% 
 1184-1199           31  <1% 
 1200-1215           15  <1% 
 1216-1231           20  <1% 
 1232-1247           18  <1% 
 1248-1263           16  <1% 
 1264-1279           24  <1% 
 1280-1295           15  <1% 
 1296-1311           18  <1% 
 1312-1327            8  <1% 
 1328-1343           18  <1% 
 1344-1359           20  <1% 
 1360-1375           19  <1% 
 1376-1391           12  <1% 
 1392-1407            9  <1% 
 1408-1423           61  <1% 
 1424-1439           23  <1% 
 1440-1455           17  <1% 
 1456-1471           27  <1% 
 1472-1487           28  <1% 
 1488-1503           30  <1% 
 1504-1519           14  <1% 
 1520-1535            6  <1% 
 1536-1551           12  <1% 
 1552-1567           12  <1% 
 1568-1583           13  <1% 
 1584-1599           12  <1% 
 1600-1615           20  <1% 
 1616-1631           11  <1% 
 1632-1647            5  <1% 
 1648-1663            6  <1% 
 1664-1679            7  <1% 
 1680-1695            6  <1% 
 1696-1711           34  <1% 
 1712-1727            8  <1% 
 1728-1743            8  <1% 
 1744-1759            4  <1% 
 1760-1775           13  <1% 
 1776-1791            4  <1% 
 1792-1807            8  <1% 
 1808-1823            5  <1% 
 1824-1839            7  <1% 
 1840-1855            9  <1% 
 1856-1871           14  <1% 
 1872-1887           26  <1% 
 1888-1903           13  <1% 
 1904-1919           10  <1% 
 1920-1935            6  <1% 
 1936-1951           11  <1% 
 1952-1967            9  <1% 
 1968-1983           11  <1% 
 1984-1999            3  <1% 
 2000-2015            8  <1% 
 2016-2031            5  <1% 
 2032-2047            9  <1% 
 2048-2063           71  <1% 
 2064-2079           10  <1% 
 2080-2095         1091  <1% 
 2096-2111            7  <1% 
 2112-2127           15  <1% 
 2128-2143            3  <1% 
 2144-2159            9  <1% 
 2160-2175            6  <1% 
 2176-2191            6  <1% 
 2192-2207            2  <1% 
 2208-2223            3  <1% 
 2224-2239            5  <1% 
 2240-2255            6  <1% 
 2256-2271            7  <1% 
 2272-2287           28  <1% 
 2288-2303           30  <1% 
 2304-2319           10  <1% 
 2320-2335            4  <1% 
 2336-2351            4  <1% 
 2352-2367            7  <1% 
 2368-2383            4  <1% 
 2384-2399            4  <1% 
 2400-2415            8  <1% 
 2416-2431            6  <1% 
 2432-2447            6  <1% 
 2448-2463            4  <1% 
 2464-2479           23  <1% 
 2480-2495            4  <1% 
 2496-2511            4  <1% 
 2512-2527            5  <1% 
 2528-2543           10  <1% 
 2544-2559            3  <1% 
 2560-2575            5  <1% 
 2576-2591            6  <1% 
 2592-2607            4  <1% 
 2608-2623            5  <1% 
 2624-2639            7  <1% 
 2640-2655            5  <1% 
 2656-2671            4  <1% 
 2672-2687            4  <1% 
 2688-2703            4  <1% 
 2704-2719           12  <1% 
 2720-2735            5  <1% 
 2736-2751            6  <1% 
 2752-2767            6  <1% 
 2768-2783            8  <1% 
 2784-2799            4  <1% 
 2800-2815            5  <1% 
 2816-2831            4  <1% 
 2832-2847            3  <1% 
 2848-2863            5  <1% 
 2864-2879            4  <1% 
 2880-2895            8  <1% 
 2896-2911            5  <1% 
 2912-2927            6  <1% 
 2928-2943            5  <1% 
 2944-2959            4  <1% 
 2960-2975           17  <1% 
 2976-2991            8  <1% 
 2992-3007            5  <1% 
 3008-3023            4  <1% 
 3024-3039            4  <1% 
 3040-3055            7  <1% 
 3056-3071            3  <1% 
 3072-3087            6  <1% 
 3088-3103            4  <1% 
 3104-3119            6  <1% 
 3120-3135            6  <1% 
 3136-3151            5  <1% 
 3152-3167            5  <1% 
 3168-3183            6  <1% 
 3184-3199            3  <1% 
 3200-3215            4  <1% 
 3216-3231            6  <1% 
 3232-3247            4  <1% 
 3248-3263            4  <1% 
 3264-3279            5  <1% 
 3280-3295            7  <1% 
 3296-3311            7  <1% 
 3312-3327            4  <1% 
 3328-3343            3  <1% 
 3344-3359            7  <1% 
 3360-3375            3  <1% 
 3376-3391            6  <1% 
 3392-3407            2  <1% 
 3408-3423            6  <1% 
 3424-3439            6  <1% 
 3440-3455            5  <1% 
 3456-3471            4  <1% 
 3472-3487            3  <1% 
 3488-3503            5  <1% 
 3504-3519            3  <1% 
 3520-3535            5  <1% 
 3536-3551           78  <1% 
 3552-3567           18  <1% 
 3568-3583            5  <1% 
 3584-3599            4  <1% 
 3600-3615            6  <1% 
 3616-3631            2  <1% 
 3632-3647            5  <1% 
 3648-3663            6  <1% 
 3664-3679            6  <1% 
 3680-3695            5  <1% 
 3696-3711            3  <1% 
 3712-3727            5  <1% 
 3728-3743            3  <1% 
 3760-3775            5  <1% 
 3776-3791            1  <1% 
 3824-3839            3  <1% 
 3840-3855            3  <1% 
 3856-3871            1  <1% 
 3872-3887            1  <1% 
 3888-3903            1  <1% 
 3904-3919            2  <1% 
 3936-3951            1  <1% 
 3952-3967            5  <1% 
 3968-3983            1  <1% 
 3984-3999            2  <1% 
 4000-4015            2  <1% 
 4016-4031            1  <1% 
 4032-4047           33  <1% 
 4048-4063          110  <1% 
 4064-4079           13  <1% 
 4080-4095          658  <1% 
 4096-4111           30  <1% 
 4112-4127            1  <1% 
 4128-4143          597  <1% 
 4144-4159            2  <1% 
 4160-4175            2  <1% 
 4176-4191            2  <1% 
 4192-4207            2  <1% 
 4208-4223            2  <1% 
 4224-4239            4  <1% 
 4256-4271            6  <1% 
 4272-4287            3  <1% 
 4288-4303            2  <1% 
 4304-4319            1  <1% 
 4320-4335            1  <1% 
 4336-4351            1  <1% 
 4352-4367            2  <1% 
 4368-4383            1  <1% 
 4384-4399            1  <1% 
 4400-4415            1  <1% 
 4432-4447            2  <1% 
 4448-4463            1  <1% 
 4480-4495            2  <1% 
 4512-4527            2  <1% 
 4544-4559            1  <1% 
 4560-4575            1  <1% 
 4576-4591            1  <1% 
 4592-4607            1  <1% 
 4608-4623            1  <1% 
 4640-4655            1  <1% 
 4656-4671            2  <1% 
 4672-4687            1  <1% 
 4704-4719            1  <1% 
 4720-4735            1  <1% 
 4752-4767            1  <1% 
 4768-4783            2  <1% 
 4784-4799            1  <1% 
 4800-4815          295  <1% 
 4816-4831            1  <1% 
 4832-4847            3  <1% 
 4880-4895            1  <1% 
 4928-4943            1  <1% 
 4944-4959            1  <1% 
 4960-4975            1  <1% 
 4992-5007            1  <1% 
 5024-5039            4  <1% 
 5040-5055            1  <1% 
 5056-5071            1  <1% 
 5072-5087            1  <1% 
 5120-5135            3  <1% 
 5136-5151            1  <1% 
 5152-5167            1  <1% 
 5168-5183            2  <1% 
 5184-5199            1  <1% 
 5200-5215            1  <1% 
 5216-5231            1  <1% 
 5264-5279            1  <1% 
 5280-5295            1  <1% 
 5296-5311            1  <1% 
 5312-5327            1  <1% 
 5344-5359            1  <1% 
 5376-5391            2  <1% 
 5408-5423            1  <1% 
 5424-5439            1  <1% 
 5440-5455            1  <1% 
 5456-5471            1  <1% 
 5488-5503            1  <1% 
 5504-5519            1  <1% 
 5568-5583            1  <1% 
 5584-5599            1  <1% 
 5600-5615            1  <1% 
 5632-5647            2  <1% 
 5680-5695            1  <1% 
 5744-5759            1  <1% 
 5776-5791            1  <1% 
 5792-5807            2  <1% 
 5824-5839            2  <1% 
 5840-5855            2  <1% 
 5856-5871            1  <1% 
 5904-5919            1  <1% 
 5936-5951            1  <1% 
 5952-5967            2  <1% 
 5968-5983            1  <1% 
 5984-5999            1  <1% 
 6000-6015            3  <1% 
 6016-6031            2  <1% 
 6032-6047            3  <1% 
 6064-6079            2  <1% 
 6112-6127            1  <1% 
 6176-6191            1  <1% 
 6192-6207            2  <1% 
 6240-6255            1  <1% 
 6320-6335            1  <1% 
 6336-6351            1  <1% 
 6352-6367            1  <1% 
 6400-6415            1  <1% 
 6416-6431            1  <1% 
 6432-6447            2  <1% 
 6512-6527            1  <1% 
 6528-6543            3  <1% 
 6560-6575            1  <1% 
 6592-6607            1  <1% 
 6624-6639            3  <1% 
 6784-6799            1  <1% 
 6848-6863            2  <1% 
 6880-6895            2  <1% 
 6912-6927            2  <1% 
 6928-6943            1  <1% 
 6944-6959            1  <1% 
 7008-7023            3  <1% 
 7056-7071            2  <1% 
 7072-7087            1  <1% 
 7088-7103            1  <1% 
 7184-7199            1  <1% 
 7216-7231            1  <1% 
 7248-7263            1  <1% 
 7296-7311            1  <1% 
 7312-7327            1  <1% 
 7392-7407            1  <1% 
 7424-7439            2  <1% 
 7472-7487            1  <1% 
 7504-7519            1  <1% 
 7520-7535            2  <1% 
 7536-7551            2  <1% 
 7552-7567            2  <1% 
 7584-7599            1  <1% 
 7664-7679            1  <1% 
 7696-7711            1  <1% 
 7744-7759            3  <1% 
 7760-7775            1  <1% 
 7776-7791            2  <1% 
 7792-7807            1  <1% 
 7808-7823            1  <1% 
 7888-7903            1  <1% 
 7920-7935            2  <1% 
 7936-7951            2  <1% 
 7952-7967            1  <1% 
 7968-7983            3  <1% 
 8000-8015            1  <1% 
 8016-8031            1  <1% 
 8032-8047            1  <1% 
 8048-8063            1  <1% 
 8096-8111            1  <1% 
 8112-8127            1  <1% 
 8128-8143            1  <1% 
 8144-8159            1  <1% 
 8160-8175            1  <1% 
 8176-8191            1  <1% 
 8192-8207          204  <1% 
 8208-8223            6  <1% 
 8224-8239          308  <1% 
 8240-8255            2  <1% 
 8256-8271            4  <1% 
 8272-8287            3  <1% 
 8288-8303            1  <1% 
 8304-8319            2  <1% 
 8320-8335            1  <1% 
 8336-8351            1  <1% 
 8352-8367            1  <1% 
 8400-8415            2  <1% 
 8464-8479            1  <1% 
 8528-8543            1  <1% 
 8544-8559            1  <1% 
 8624-8639            1  <1% 
 8640-8655            1  <1% 
 8656-8671            2  <1% 
 8736-8751            1  <1% 
 8768-8783            1  <1% 
 8848-8863            1  <1% 
 8960-8975            1  <1% 
 9040-9055            1  <1% 
 9072-9087            2  <1% 
 9120-9135            1  <1% 
 9152-9167            2  <1% 
 9168-9183            1  <1% 
 9264-9279            1  <1% 
 9280-9295            1  <1% 
 9296-9311            1  <1% 
 9344-9359            3  <1% 
 9360-9375            1  <1% 
 9392-9407            1  <1% 
 9408-9423            2  <1% 
 9424-9439            2  <1% 
 9472-9487            1  <1% 
 9504-9519            1  <1% 
 9520-9535            1  <1% 
 9536-9551            1  <1% 
 9616-9631            1  <1% 
 9648-9663            1  <1% 
 9664-9679            1  <1% 
 9696-9711            1  <1% 
 9712-9727            1  <1% 
 9728-9743            1  <1% 
 9744-9759            1  <1% 
 9776-9791            1  <1% 
 9808-9823            1  <1% 
 9840-9855            1  <1% 
 9856-9871            1  <1% 
 9872-9887            1  <1% 
 9984-9999            1  <1% 
10016-10031           1  <1% 
10048-10063           1  <1% 
10064-10079           1  <1% 
10080-10095           1  <1% 
10096-10111           1  <1% 
10112-10127           1  <1% 
10128-10143           1  <1% 
10160-10175           1  <1% 
10192-10207           1  <1% 
10320-10335           1  <1% 
10384-10399           2  <1% 
10448-10463           1  <1% 
10512-10527           1  <1% 
10560-10575           1  <1% 
10736-10751           1  <1% 
10864-10879           1  <1% 
11168-11183           1  <1% 
11200-11215           1  <1% 
11216-11231           2  <1% 
11232-11247           7  <1% 
11248-11263           1  <1% 
11312-11327           1  <1% 
11360-11375           1  <1% 
11472-11487           7  <1% 
11488-11503           2  <1% 
11520-11535           1  <1% 
11584-11599           1  <1% 
11600-11615           5  <1% 
11616-11631          11  <1% 
11632-11647          48  <1% 
11648-11663           1  <1% 
11696-11711           1  <1% 
11712-11727           2  <1% 
11808-11823           1  <1% 
11936-11951           1  <1% 
12000-12015          12  <1% 
12016-12031           2  <1% 
12064-12079          83  <1% 
12080-12095          59  <1% 
12096-12111          19  <1% 
12112-12127           1  <1% 
12128-12143           7  <1% 
12144-12159         134  <1% 
12160-12175         141  <1% 
12176-12191          66  <1% 
12192-12207           2  <1% 
12256-12271          41  <1% 
12880-12895           1  <1% 
13152-13167           3  <1% 
14352-14367           1  <1% 
14656-14671           1  <1% 
15024-15039           1  <1% 
16416-16431         131  <1% 
17280-17295           1  <1% 
18720-18735           1  <1% 
23392-23407           1  <1% 
29248-29263           1  <1% 
32768-32783           1  <1% 
36560-36575           1  <1% 
45696-45711           1  <1% 
51120-51135           3  <1% 
51136-51151           1  <1% 
52192-52207           1  <1% 
57120-57135           1  <1% 
65264-65279           1  <1% 
   large              2  <1% 

and:

# memusage /usr/bin/mimedefang --help
/usr/bin/memusage: line 252: 100195 Segmentation fault      (core dumped) LD_PRELOAD=/usr/\$LIB/libmemusage.so "$@"

so... that was a little inconclusive. So I shut down the VM, gave it another 4GB just to be sure (from 8GB), and repeated the test:

# memusage /usr/bin/mimedefang.pl

Memory usage summary: heap total: 65254, heap peak: 62233, stack peak: 4112
         total calls   total memory   failed calls
 malloc|        622          65221              0
realloc|          1              1              0  (nomove:1, dec:0, free:0)
 calloc|          1             32              0
   free|         71           3400
Histogram for block sizes:
    0-15            256  41% ==================================================
   16-31             98  15% ===================
   32-47            136  21% ==========================
   48-63             86  13% ================
   64-79              4  <1% 
   80-95              2  <1% 
   96-111             7   1% =
  112-127             6  <1% =
  160-175             1  <1% 
  176-191             3  <1% 
  208-223             3  <1% 
  224-239             1  <1% 
  256-271             1  <1% 
  288-303             1  <1% 
  416-431             1  <1% 
  496-511             1  <1% 
  592-607             2  <1% 
  784-799             1  <1% 
 1024-1039            3  <1% 
 1264-1279            1  <1% 
 1328-1343            1  <1% 
 1760-1775            3  <1% 
 2048-2063            1  <1% 
 4096-4111            2  <1% 
 8192-8207            3  <1% 
Usage: mimedefang.pl [-f filter] workdir | -server | -test | -features | -validate

Memory usage summary: heap total: 43149647, heap peak: 21534748, stack peak: 26000
         total calls   total memory   failed calls
 malloc|     138918       22289098              0
realloc|      70186        3324326              0  (nomove:42309, dec:17934, free:0)
 calloc|      46550       17536223              0
   free|     101824       19056567
Histogram for block sizes:
    0-15          61866  24% ==================================================
   16-31          40949  16% =================================
   32-47          48209  18% ======================================
   48-63          32327  12% ==========================
   64-79           7832   3% ======
   80-95          21197   8% =================
   96-111          3614   1% ==
  112-127          4993   1% ====
  128-143          4190   1% ===
  144-159          3152   1% ==
  160-175          3677   1% ==
  176-191          2015  <1% =
  192-207          1001  <1% 
  208-223          1196  <1% 
  224-239           288  <1% 
  240-255           185  <1% 
  256-271          1214  <1% 
  272-287           231  <1% 
  288-303           173  <1% 
  304-319           748  <1% 
  320-335           839  <1% 
  336-351           220  <1% 
  352-367           195  <1% 
  368-383           166  <1% 
  384-399           460  <1% 
  400-415           149  <1% 
  416-431            91  <1% 
  432-447            56  <1% 
  448-463            93  <1% 
  464-479           339  <1% 
  480-495            49  <1% 
  496-511            66  <1% 
  512-527           253  <1% 
  528-543            60  <1% 
  544-559          2687   1% ==
  560-575           269  <1% 
  576-591            26  <1% 
  592-607            42  <1% 
  608-623            44  <1% 
  624-639            27  <1% 
  640-655           232  <1% 
  656-671            34  <1% 
  672-687           205  <1% 
  688-703            25  <1% 
  704-719            16  <1% 
  720-735            27  <1% 
  736-751            31  <1% 
  752-767            25  <1% 
  768-783            12  <1% 
  784-799            21  <1% 
  800-815           177  <1% 
  816-831             9  <1% 
  832-847            21  <1% 
  848-863            11  <1% 
  864-879            17  <1% 
  880-895            16  <1% 
  896-911            23  <1% 
  912-927            12  <1% 
  928-943            11  <1% 
  944-959            20  <1% 
  960-975            12  <1% 
  976-991           163  <1% 
  992-1007          275  <1% 
 1008-1023          162  <1% 
 1024-1039          219  <1% 
 1040-1055           82  <1% 
 1056-1071         2381  <1% =
 1072-1087           34  <1% 
 1088-1103           16  <1% 
 1104-1119            9  <1% 
 1120-1135           10  <1% 
 1136-1151           11  <1% 
 1152-1167           14  <1% 
 1168-1183           90  <1% 
 1184-1199            7  <1% 
 1200-1215            7  <1% 
 1216-1231           13  <1% 
 1232-1247           19  <1% 
 1248-1263           13  <1% 
 1264-1279           18  <1% 
 1280-1295           10  <1% 
 1296-1311            6  <1% 
 1312-1327           13  <1% 
 1328-1343           14  <1% 
 1344-1359            8  <1% 
 1360-1375            7  <1% 
 1376-1391           10  <1% 
 1392-1407            6  <1% 
 1408-1423           70  <1% 
 1424-1439            9  <1% 
 1440-1455            8  <1% 
 1456-1471            6  <1% 
 1472-1487            7  <1% 
 1488-1503            4  <1% 
 1504-1519           10  <1% 
 1520-1535            7  <1% 
 1536-1551            8  <1% 
 1552-1567            7  <1% 
 1568-1583            7  <1% 
 1584-1599            9  <1% 
 1600-1615            9  <1% 
 1616-1631            9  <1% 
 1632-1647            4  <1% 
 1648-1663            7  <1% 
 1664-1679           11  <1% 
 1680-1695            5  <1% 
 1696-1711           50  <1% 
 1712-1727            7  <1% 
 1728-1743            6  <1% 
 1744-1759            5  <1% 
 1760-1775           10  <1% 
 1776-1791            4  <1% 
 1792-1807            3  <1% 
 1808-1823            6  <1% 
 1824-1839            5  <1% 
 1840-1855            4  <1% 
 1856-1871            5  <1% 
 1872-1887           17  <1% 
 1888-1903           10  <1% 
 1904-1919            7  <1% 
 1920-1935            8  <1% 
 1936-1951            6  <1% 
 1952-1967            3  <1% 
 1968-1983            5  <1% 
 1984-1999            5  <1% 
 2000-2015            7  <1% 
 2016-2031           11  <1% 
 2032-2047            7  <1% 
 2048-2063           85  <1% 
 2064-2079           11  <1% 
 2080-2095         1207  <1% 
 2096-2111            7  <1% 
 2112-2127            7  <1% 
 2128-2143           10  <1% 
 2144-2159            5  <1% 
 2160-2175            6  <1% 
 2176-2191           14  <1% 
 2192-2207            5  <1% 
 2208-2223            4  <1% 
 2224-2239            5  <1% 
 2240-2255            7  <1% 
 2256-2271            7  <1% 
 2272-2287           24  <1% 
 2288-2303           34  <1% 
 2304-2319           11  <1% 
 2320-2335            5  <1% 
 2336-2351            8  <1% 
 2352-2367            5  <1% 
 2368-2383            7  <1% 
 2384-2399            7  <1% 
 2400-2415           20  <1% 
 2416-2431            5  <1% 
 2432-2447           13  <1% 
 2448-2463            5  <1% 
 2464-2479           32  <1% 
 2480-2495           12  <1% 
 2496-2511            8  <1% 
 2512-2527            6  <1% 
 2528-2543           13  <1% 
 2544-2559            5  <1% 
 2560-2575            4  <1% 
 2576-2591            6  <1% 
 2592-2607            2  <1% 
 2608-2623            4  <1% 
 2624-2639            4  <1% 
 2640-2655            5  <1% 
 2656-2671            6  <1% 
 2672-2687            2  <1% 
 2688-2703            2  <1% 
 2704-2719            2  <1% 
 2720-2735            4  <1% 
 2736-2751            3  <1% 
 2752-2767            3  <1% 
 2784-2799            1  <1% 
 2800-2815            2  <1% 
 2880-2895            2  <1% 
 2896-2911            1  <1% 
 2912-2927            1  <1% 
 2928-2943            1  <1% 
 2960-2975           19  <1% 
 2976-2991            1  <1% 
 3024-3039            2  <1% 
 3040-3055            2  <1% 
 3056-3071            2  <1% 
 3088-3103            1  <1% 
 3120-3135            4  <1% 
 3136-3151            1  <1% 
 3152-3167            2  <1% 
 3168-3183            1  <1% 
 3184-3199            3  <1% 
 3200-3215            1  <1% 
 3216-3231            1  <1% 
 3232-3247            1  <1% 
 3248-3263            1  <1% 
 3264-3279            3  <1% 
 3280-3295            4  <1% 
 3296-3311            3  <1% 
 3312-3327            2  <1% 
 3360-3375            1  <1% 
 3376-3391            1  <1% 
 3392-3407            1  <1% 
 3424-3439            6  <1% 
 3440-3455            2  <1% 
 3456-3471            2  <1% 
 3520-3535            2  <1% 
 3536-3551           78  <1% 
 3552-3567           10  <1% 
 3600-3615            1  <1% 
 3632-3647            1  <1% 
 3648-3663            1  <1% 
 3664-3679            2  <1% 
 3712-3727            1  <1% 
 3760-3775            2  <1% 
 3776-3791            4  <1% 
 3808-3823            1  <1% 
 3824-3839            1  <1% 
 3952-3967            2  <1% 
 3968-3983            1  <1% 
 3984-3999            1  <1% 
 4000-4015            1  <1% 
 4032-4047           47  <1% 
 4048-4063           97  <1% 
 4064-4079            8  <1% 
 4080-4095          605  <1% 
 4096-4111           35  <1% 
 4128-4143          698  <1% 
 4144-4159            1  <1% 
 4176-4191            2  <1% 
 4240-4255            1  <1% 
 4256-4271           10  <1% 
 4272-4287            1  <1% 
 4320-4335            1  <1% 
 4336-4351            1  <1% 
 4368-4383            1  <1% 
 4400-4415            1  <1% 
 4624-4639            1  <1% 
 4672-4687            1  <1% 
 4688-4703            1  <1% 
 4720-4735            1  <1% 
 4736-4751            1  <1% 
 4784-4799            1  <1% 
 4800-4815          210  <1% 
 4832-4847            2  <1% 
 4848-4863            1  <1% 
 4880-4895            1  <1% 
 4912-4927            2  <1% 
 4976-4991            1  <1% 
 5040-5055            1  <1% 
 5056-5071            1  <1% 
 5120-5135            8  <1% 
 5248-5263            1  <1% 
 5280-5295            1  <1% 
 5296-5311            1  <1% 
 5312-5327            1  <1% 
 5440-5455            1  <1% 
 5504-5519            1  <1% 
 5616-5631            1  <1% 
 5632-5647            1  <1% 
 5696-5711            1  <1% 
 5952-5967            1  <1% 
 6048-6063            1  <1% 
 6064-6079            1  <1% 
 6128-6143            1  <1% 
 6144-6159            6  <1% 
 6304-6319            1  <1% 
 6336-6351            1  <1% 
 6432-6447            1  <1% 
 6480-6495            1  <1% 
 6528-6543            1  <1% 
 6624-6639            1  <1% 
 6640-6655            1  <1% 
 6784-6799            2  <1% 
 6832-6847            2  <1% 
 6944-6959            1  <1% 
 7008-7023            2  <1% 
 7184-7199            1  <1% 
 7376-7391            5  <1% 
 7440-7455            1  <1% 
 7456-7471            1  <1% 
 7520-7535            1  <1% 
 7552-7567            1  <1% 
 7568-7583            1  <1% 
 7632-7647            1  <1% 
 7664-7679            1  <1% 
 7760-7775            1  <1% 
 7856-7871            1  <1% 
 7904-7919            1  <1% 
 8000-8015            1  <1% 
 8048-8063            1  <1% 
 8192-8207          204  <1% 
 8208-8223            9  <1% 
 8224-8239          348  <1% 
 8240-8255           10  <1% 
 8256-8271            7  <1% 
 8272-8287            2  <1% 
 8288-8303            3  <1% 
 8304-8319            2  <1% 
 8608-8623            1  <1% 
 8848-8863            2  <1% 
 9536-9551            1  <1% 
 9728-9743            1  <1% 
 9824-9839            1  <1% 
10368-10383           1  <1% 
11200-11215           4  <1% 
11232-11247           2  <1% 
11248-11263          35  <1% 
11264-11279          34  <1% 
11280-11295           2  <1% 
11312-11327           1  <1% 
11936-11951           1  <1% 
12000-12015          14  <1% 
12016-12031           2  <1% 
12064-12079          68  <1% 
12080-12095         139  <1% 
12096-12111         111  <1% 
12112-12127          18  <1% 
12128-12143           6  <1% 
12144-12159         104  <1% 
12160-12175         208  <1% 
12176-12191         165  <1% 
12192-12207          25  <1% 
12208-12223           1  <1% 
12256-12271          27  <1% 
12272-12287          34  <1% 
12288-12303          34  <1% 
12304-12319           4  <1% 
12416-12431           2  <1% 
12880-12895           1  <1% 
12944-12959           1  <1% 
13152-13167           1  <1% 
13184-13199           1  <1% 
13248-13263           1  <1% 
14928-14943           1  <1% 
15024-15039           1  <1% 
15120-15135           4  <1% 
15184-15199           1  <1% 
16176-16191           1  <1% 
16384-16399           3  <1% 
16416-16431         191  <1% 
16944-16959           1  <1% 
17280-17295           1  <1% 
18608-18623           1  <1% 
18720-18735           1  <1% 
23264-23279           1  <1% 
23392-23407           1  <1% 
29088-29103           1  <1% 
29248-29263           1  <1% 
32768-32783           1  <1% 
32816-32831           8  <1% 
36368-36383           1  <1% 
36560-36575           1  <1% 
45456-45471           1  <1% 
45696-45711           1  <1% 
51120-51135           3  <1% 
51136-51151           1  <1% 
52192-52207           1  <1% 
56832-56847           1  <1% 
57120-57135           1  <1% 
65264-65279           1  <1% 
   large             11  <1% 
pprindeville commented 1 year ago

Even at 16GB I can't run a single instance of mimedefang.pl -features so I'm not sure what the issue is.

horgh commented 1 year ago

Did you see my comment? :-P

pprindeville commented 1 year ago

I noticed there's a => on one of the lines. Could that be doing it? my $reader2 => GeoIP2::[etc]

Mother of god I'm an idiot.

Or tired.

Or both.

pprindeville commented 1 year ago

Yup, that fixed it.

pprindeville commented 1 year ago

Out of curiosity, does the binary tree get cached/shared like what happened in Geo::IP?

horgh commented 1 year ago

I'm not sure how Geo::IP worked. This implementation memory maps the database. As well, when opening the database, it does some initialization work that gets shared for later lookups, so it's best to share a single reader if you're doing more than one lookup.

pprindeville commented 1 year ago

I'm not sure how Geo::IP worked. This implementation memory maps the database. As well, when opening the database, it does some initialization work that gets shared for later lookups, so it's best to share a single reader if you're doing more than one lookup.

You mean, keep it persistently as a global? Yeah, I was going to do that. mimedefang is a persistent daemon so there's no reason not to.

pprindeville commented 1 year ago

User error.