Increase or Eliminate BUFFER_MAX_SIZE in include/opensrf/utils.h
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenSRF |
New
|
Undecided
|
Unassigned |
Bug Description
While investigating bug 1835620, I got a segmentation fault from doing "introspect open-ils.storage" with srfsh.
The behavior is slightly different depending on distro. On Ubuntu Bionic, one gets "Segmentation fault (core dumped)" and srfsh exits immediately. On Debian Buster, "Buffer reached MAX_SIZE of 10485760Segment
In both cases, /openils/
Caught error from 'run' method: Exception: OpenSRF:
Something like the following appears in /var/log/syslog:
Jul 7 08:03:59 bionic kernel: [ 62.539299] srfsh[2824]: segfault at 55abf85de3d1 ip 00007f46705785e6 sp 00007ffc37bd3300 error 6 in libopensrf.
I did some experimentation on Buster and upped BUFFER_MAX_SIZE to 100MB. I was then able to dump the results of introspect open-ils.storage to a file. It was approximately 47MB in size.
I recommend that we either do away with the BUFFER_MAX_SIZE constant and let the O/S handle memory exhaustion, or that we increase it to a minimum of 50MB, though I think 100MB would be better.
A third option could be to find a better way to manage the data in the smaller buffer, such as passing it off to the client, though this may not be as easy as the previous two options.
description: | updated |
summary: |
- Increase BUFFER_MAX_SIZE in include/opensrf/utils.h + Increase or Eliminate BUFFER_MAX_SIZE in include/opensrf/utils.h |