microsoft / microsoft/mimalloc

Cygwin deadlock in override mode

Open
#169 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
13.4k
Forks
1.2k
Avg merge
4d 45m
Merged PRs (30d)
13

Description

I tried integrating mimalloc into our sequence search tool MMseqs2 for its Cygwin based Windows build. Cygwin's allocator is terrible at multi-threaded allocations, making multi-threaded execution slower than single-threaded due to excessive locking.

Since mimalloc offers an easy cmake-based integration, I tried getting it to run in our software. Indeed getting it to compile and link was amazingly easy. However the override based implementation immediately deadlocks.

The two test binaries in override mode also immediately deadlock. They work when override is not used.

I tried for an hour or so to get it to run myself. I tried to add a cygwin check to `MI_TLS_RECURSE_GUARD` in a similar fashion as #146 and a few other things, however unsuccessfully.

I also tried to include mimalloc in a Linux build. Regression tests run successfully, so it looks quite promising :)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the deadlock in the two override-mode test binaries on a Cygwin build, then read the MI_TLS_RECURSE_GUARD entry point and the related approach discussed in #146. Compare with the non-override tests and the successful Linux regression run; done means the Cygwin override tests complete without deadlocking.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, cmake
Domain
operating-systems, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.