[Bug 48620] New: libmdbx (memory-mapped DB) fail on Wine

WineHQ Bugzilla wine-bugs at winehq.org
Mon Feb 17 11:42:40 CST 2020


https://bugs.winehq.org/show_bug.cgi?id=48620

            Bug ID: 48620
           Summary: libmdbx (memory-mapped DB) fail on Wine
           Product: Wine
           Version: unspecified
          Hardware: x86
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: ntdll
          Assignee: wine-bugs at winehq.org
          Reporter: leo at yuriev.ru
      Distribution: ---

The libmdbx provides an embedded key-value storage engine (i.e. a database
service) and map whole data into memory (i.e. uses a memory mapped file), and I
am the main developer of this project.
https://github.com/erthink/libmdbx

Native versions of libmdbx work fine on both Linux, Windows, MacOS, FreeBSD,
etc. 
However, the windows version does not work under Wine, for instance, as part of
the Miranda NG messenger. Therefore, some users ask me to fix libmdbx, but it
is difficult, since there are no such errors in libmdbx.

This is NOT a big problem, as there are relatively few affected users. However,
I think it would be better to fix this error as well. In addition, this fix is
likely to fix problems in other applications that are compelled to use the
Windows native API.

I am not familiar with Wine and do not use it. So I haven't tried debugging the
windows version of libmdbx on Wine yet, but decided it would be wise to fill
out this report first. I hope someone experienced can explain what's wrong on
by simply reading the description below or quickly reviewing the source code.

---

Presumably, the problem with libmdbx is using the Windows native API:
NtCreateSection(), NtMapViewOfSection(), NtExtendSection(),
NtUnmapViewOfSection(), NtClose(), NtAllocateVirtualMemory(),
NtFreeVirtualMemory(). In libmdbx, I am forced to use these functions to
increase the data file without unmap it from memory. In libmdbx, I am forced to
use these functions to increase the data file without unmap it from memory. It
is done by NtExtendSection() when a section created with SECTION_EXTEND_SIZE
access.

The next a potential cause of problems in using the functions:
NtFsControlFile(FSCTL_GET_EXTERNAL_BACKING),
GetFileInformationByHandleEx(FileRemoteProtocolInfo),
GetVolumeInformationByHandleW(), GetFinalPathNameByHandleW(). These functions
are used via GetProcAddress() to determine the placement of files on network
drives.

The last point the NtQuerySystemInformation(0x03 /* SystemTmeOfDayInformation
*/) is used to determine boot time.

Corresponding source code:
https://github.com/erthink/libmdbx/blob/master/src/elements/osal.c
https://github.com/erthink/libmdbx/blob/master/src/elements/lck-windows.c

Regards.

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list