Bug 24863 – DMD v2.109.0 on OpenBSD out of memory when attempting to compile OneDrive for Linux

Status
RESOLVED
Resolution
INVALID
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Other
Creation time
2024-11-16T18:37:42Z
Last change time
2024-11-17T14:06:31Z
Assigned to
No Owner
Creator
zf

Comments

Comment #0 by lfzamora81 — 2024-11-16T18:37:42Z
Overview: Attempting to build onedrive for linux (https://github.com/abraunegg/onedrive) from source on OpenBSD, receiving 'out of memory' errors early in the build on a system with 8GB of memory and swap. This is encountered as part of an earlier bug report to the project which can be seen here with many more details about the system and circumstances: https://github.com/abraunegg/onedrive/issues/2977 Steps to Reproduce: Details can be seen here: https://github.com/abraunegg/onedrive/issues/2977 But essentially starting from base OpenBSD 7.6 installation and following the instructions for onedrive on Linux project to install prerequisites which all pass OK during ./configure check. Actual Results: obsd$ gmake clean; gmake; rm -f onedrive onedrive.o version rm -rf autom4te.cache rm -f config.log config.status if [ -f .git/HEAD ] ; then \ git describe --tags > version ; \ else \ echo v2.5.3 > version ; \ fi dmd -w -J. -O -version=NoPragma -version=NoGdk -version=Notifications -L-L/usr/local/lib -L-lcurl -L-L/usr/local/lib -L-lsqlite3 -L-L/usr/local/lib -L-lnotify -L-lgdk_pixbuf-2.0 -L-lgio-2.0 -L-lgobject-2.0 -L-lglib-2.0 -L-lintl -L-ldl src/main.d src/config.d src/log.d src/util.d src/qxor.d src/curlEngine.d src/onedrive.d src/webhook.d src/sync.d src/itemdb.d src/sqlite.d src/clientSideFiltering.d src/monitor.d src/arsd/cgi.d src/notifications/notify.d src/notifications/dnotify.d -ofonedrive --- ERROR: This is a compiler bug. Please report it via https://issues.dlang.org/enter_bug.cgi with, preferably, a reduced, reproducible example and the information below. DustMite (https://github.com/CyberShadow/DustMite/wiki) can help with the reduction. --- DMD v2.109.0 predefs NoPragma NoGdk Notifications DigitalMars LittleEndian D_Version2 all D_SIMD Posix ELFv1 OpenBSD CppRuntime_Clang D_InlineAsm_X86_64 X86_64 D_LP64 D_PIC assert D_PreConditions D_PostConditions D_Invariants D_ModuleInfo D_Exceptions D_TypeInfo D_HardFloat D_Optimized binary dmd version v2.109.0 config /etc/dmd.conf DFLAGS -I/usr/local/include/dmd/phobos -I/usr/local/include/dmd/druntime/import -L-L/usr/lib -L-L/usr/local/lib -L--export-dynamic -fPIC --- core.exception.AssertError@src/dmd/common/outbuffer.d(190): OutBuffer: out of memory. ---------------- ??:? _d_assert_msg [0x83f9b8b5ff0] ??:? OutBuffer::reserve(unsigned long) [0x83f9b8a5502] ??:? pure nothrow @trusted void dmd.common.outbuffer.OutBuffer.write(scope const(void)[]) [0x83f9b8a576e] ??:? nothrow void dmd.backend.elfobj.ElfObj_term(const(char)[]) [0x83f9b87ba6e] ??:? nothrow void dmd.backend.obj.Obj.term(const(char)[]) [0x83f9b7811f1] ??:? void dmd.glue.obj_end(ref dmd.common.outbuffer.OutBuffer, dmd.lib.Library, const(char)[]) [0x83f9b75d5a3] ??:? void dmd.glue.generateCodeAndWrite(dmd.dmodule.Module[], const(char)*[], const(char)[], const(char)[], bool, bool, bool, bool, bool) [0x83f9b75c09c] ??:? int dmd.main.tryMain(ulong, const(char)**, ref dmd.globals.Param) [0x83f9b563de2] ??:? _Dmain [0x83f9b562540] gmake: *** [Makefile:106: onedrive] Error 1 Expected Results: Would expect 'onedrive' binary to be created and executable. Additional Builds and Platforms: Just OpenBSD. Apparently the FreeBSD port builds without issue but there are non-trivial differences between the systems. As we are seeing demonstrated here.
Comment #1 by alphaglosined — 2024-11-16T18:49:52Z
This may not be an OOM situation. I suspect the problem is that ``realloc`` cannot expand any further. https://github.com/dlang/dmd/blob/master/compiler/src/dmd/common/outbuffer.d#L190
Comment #2 by lfzamora81 — 2024-11-17T14:06:31Z
This has been resolved and was not an issue with DMD specifically but with the default system settings of OpenBSD itself. The 'datasize' parameter(s) for a given login class must be set high enough as not to run out of memory: https://man.openbsd.org/login.conf.5 By default, depending on the system memory, it may be set too low. Increasing the current and max values fixed the issue. Resolving.