Bug 47495 - Improve error message when listener/cache/mdb/maxsize is too large for 32bit system
Improve error message when listener/cache/mdb/maxsize is too large for 32bit ...
Status: RESOLVED DUPLICATE of bug 49709
Product: UCS
Classification: Unclassified
Component: Listener (univention-directory-listener)
UCS 4.2
Other Linux
: P5 normal (vote)
: ---
Assigned To: UCS maintainers
UCS maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-08-08 10:52 CEST by Sönke Schwardt-Krummrich
Modified: 2019-06-25 13:27 CEST (History)
2 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 5: Major Usability: Impairs usability in key scenarios
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 5: Blocking further progress on the daily work
User Pain: 0.143
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments
improve_log_message_on_32bit.patch (921 bytes, patch)
2019-06-24 12:41 CEST, Arvid Requate
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sönke Schwardt-Krummrich univentionstaff 2018-08-08 10:52:31 CEST
08.08.18 09:38:31.737  LISTENER    ( INFO    ) : cache_init: using default mapsize: 1992294400
[...]
08.08.18 09:52:51.314  LISTENER    ( INFO    ) : dntree_lookup_id4ldapdn: found id=307151
08.08.18 09:52:51.314  LISTENER    ( INFO    ) : dntree_lookup_id4ldapdn: found id=307152
08.08.18 09:52:51.314  LISTENER    ( ERROR   ) : cache_update_entry: storing entry in database failed: cn=USERNAME,cn=unique-usernames,cn=ucsschool,cn=univention,dc=school,dc=customer,dc=intra
08.08.18 09:52:51.314  LISTENER    ( ERROR   ) : cache.c:469:cache_update_entry_in_transaction mdb_put: failed: MDB_MAP_FULL: Environment mapsize limit reached (-30792)
08.08.18 09:52:51.314  LISTENER    ( WARN    ) : received signal 6

ucr set listener/cache/mdb/maxsize='2192294400'
service univention-directory-listener restart

Now, the listener does not start:
08.08.18 10:06:26.876  LISTENER    ( ERROR   ) : cache_init: Error parsing value of UCR variable listener/cache/mdb/maxsize as number: Numerical result out of range

The affected system is a UCS 4.2-4 32bit slave system.

mapsize = strtol(mapsize_str, &endptr, 10);
if ((errno == ERANGE && (mapsize == LONG_MAX || mapsize == LONG_MIN)) || (errno != 0 && mapsize == 0)) {
            univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "cache_init: Error parsing value of UCR variable %s as number: %s", ucr_var_mapsize, strerror(errno));

strtol ==> 32bit signed integer ==> 2147483648

mapsize ist unsigned:          size_t mapsize;

Maybe we should use "strtoul"?

2192294400 is only slightly larger than the default of 1992294400. So on a 32bit system, this UCR variable is nearly useless.
Comment 1 Philipp Hahn univentionstaff 2018-08-08 11:10:17 CEST
(In reply to Sönke Schwardt-Krummrich from comment #0)
> ucr set listener/cache/mdb/maxsize='2192294400'
> service univention-directory-listener restart
> 
> Now, the listener does not start:
> 08.08.18 10:06:26.876  LISTENER    ( ERROR   ) : cache_init: Error parsing
> value of UCR variable listener/cache/mdb/maxsize as number: Numerical result
> out of range
...
> 2192294400 is only slightly larger than the default of 1992294400. So on a
> 32bit system, this UCR variable is nearly useless.

For 32 bit systems the given default value is already the maximum value; determined by experiments (Bug #33993 comment 3)

# ucr info listener/cache/mdb/maxsize
listener/cache/mdb/maxsize: <empty>
 The maximum size of the cache database in bytes. On 64 bit systems the default is 2 GiB. On 32 bit systems the default is 1.9 GiB.

CANNOT-FIX: the DB is memory-mapped *completely* into user space and the 32-bit user space cannot guarantee that such a linear space is available as additional space is needed for the executable and its libraries.

Switch to 64 bit if you need a bigger DB.
Comment 2 Arvid Requate univentionstaff 2019-06-24 12:41:51 CEST
Created attachment 10079 [details]
improve_log_message_on_32bit.patch

We should improve the error message here, see attached patch proposal.
Comment 3 Arvid Requate univentionstaff 2019-06-25 13:27:14 CEST
This patch should be considered when addressing Bug 49709.

*** This bug has been marked as a duplicate of bug 49709 ***