Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mimalloc: warning: unable to directly request hinted aligned OS memory #112027

Closed
furkanonder opened this issue Nov 13, 2023 · 9 comments
Closed
Labels
tests Tests in the Lib/test dir topic-free-threading type-bug An unexpected behavior, bug, or error

Comments

@furkanonder
Copy link
Contributor

furkanonder commented Nov 13, 2023

Bug report

Bug description:

Configuration:

./configure --disable-gil --with-pydebug

Test Output:

dietpi@DietPi:~/cpython$ ./python -m test test_cmd_line -v
======================================================================
FAIL: test_pythonmalloc (test.test_cmd_line.CmdLineTest.test_pythonmalloc) (env_var='mimalloc', name='mimalloc')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/dietpi/cpython/Lib/test/test_cmd_line.py", line 845, in test_pythonmalloc
    self.check_pythonmalloc(env_var, name)
  File "/home/dietpi/cpython/Lib/test/test_cmd_line.py", line 811, in check_pythonmalloc
    self.assertEqual(proc.stdout.rstrip(), name)
AssertionError: 'mimalloc: warning: unable to directly request hin[119 chars]lloc' != 'mimalloc'
- mimalloc: warning: unable to directly request hinted aligned OS memory (error: 2 (0x2), size: 0x40000000 bytes, alignment: 0x2000000, hint address: 0x20000000000)
  mimalloc


======================================================================
FAIL: test_pythonmalloc (test.test_cmd_line.CmdLineTest.test_pythonmalloc) (env_var='mimalloc_debug', name='mimalloc_debug')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/dietpi/cpython/Lib/test/test_cmd_line.py", line 845, in test_pythonmalloc
    self.check_pythonmalloc(env_var, name)
  File "/home/dietpi/cpython/Lib/test/test_cmd_line.py", line 811, in check_pythonmalloc
    self.assertEqual(proc.stdout.rstrip(), name)
AssertionError: 'mimalloc: warning: unable to directly request hin[125 chars]ebug' != 'mimalloc_debug'
- mimalloc: warning: unable to directly request hinted aligned OS memory (error: 2 (0x2), size: 0x40000000 bytes, alignment: 0x2000000, hint address: 0x20000000000)
  mimalloc_debug


----------------------------------------------------------------------
Ran 56 tests in 41.751s

FAILED (failures=2, skipped=2)
test test_cmd_line failed
test_cmd_line failed (2 failures) in 43.1 sec

== Tests result: FAILURE ==

1 test failed:
    test_cmd_line

Environment:

dietpi@DietPi:~/cpython$ uname -a
Linux DietPi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr  3 17:24:16 BST 2023 aarch64 GNU/Linux

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

@furkanonder furkanonder added type-bug An unexpected behavior, bug, or error tests Tests in the Lib/test dir labels Nov 13, 2023
@vstinner
Copy link
Member

cc @DinoV

@corona10
Copy link
Member

Can not reproduce the issue on macOS.

@furkanonder furkanonder changed the title AssertionError: 'mimalloc: warning: unable to directly request hin[119 chars]lloc' != 'mimalloc' mimalloc: warning: unable to directly request hinted aligned OS memory Dec 11, 2023
@furkanonder
Copy link
Contributor Author

The same issue occurs with the RISC-V architecture.

@vstinner
Copy link
Member

Linux DietPi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux

Is that Raspberry Pi hardware with 64-bit ARM CPU?

@furkanonder
Copy link
Contributor Author

Linux DietPi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux

Is that Raspberry Pi hardware with 64-bit ARM CPU?

Yes, Cortex-A53 (ARMv8) 64-bit SoC @ 1.4GHz
Board: Raspberry Pi 3 Model B Plus Rev 1.3

@colesbury
Copy link
Contributor

We should disable this warning. There's a few warnings from mimalloc that are emitted in debug mode that happen during normal operation and don't signify anything wrong. This is one of them.

colesbury added a commit to colesbury/cpython that referenced this issue Dec 21, 2023
This changes the warning to a "verbose"-level message in prim.c. The
address passed to mmap is only a hint -- it's normal for mmap() to
sometimes not respect the hint and return a different address.
@colesbury
Copy link
Contributor

I ran into this on Linux x86-64 today as well. It's not limited Raspberry Pi (arm64) or RSIC-V.

Most of the time mmap() will place the mapping at the suggested address, but not always. That's fine -- it doesn't lead to the allocation failing, mimalloc just falls back to a slightly slower path.

corona10 pushed a commit that referenced this issue Dec 22, 2023
gh-112027: Don't print mimalloc warning after mmap

This changes the warning to a "verbose"-level message in prim.c. The
address passed to mmap is only a hint -- it's normal for mmap() to
sometimes not respect the hint and return a different address.
@corona10
Copy link
Member

@furkanonder Please check that the issue is solved :)

@furkanonder
Copy link
Contributor Author

@corona10 I checked, the problem seems to be solved. So I am closing the issue. Thanks @corona10 @colesbury

ryan-duve pushed a commit to ryan-duve/cpython that referenced this issue Dec 26, 2023
…ongh-113372)

pythongh-112027: Don't print mimalloc warning after mmap

This changes the warning to a "verbose"-level message in prim.c. The
address passed to mmap is only a hint -- it's normal for mmap() to
sometimes not respect the hint and return a different address.
kulikjak pushed a commit to kulikjak/cpython that referenced this issue Jan 22, 2024
…ongh-113372)

pythongh-112027: Don't print mimalloc warning after mmap

This changes the warning to a "verbose"-level message in prim.c. The
address passed to mmap is only a hint -- it's normal for mmap() to
sometimes not respect the hint and return a different address.
aisk pushed a commit to aisk/cpython that referenced this issue Feb 11, 2024
…ongh-113372)

pythongh-112027: Don't print mimalloc warning after mmap

This changes the warning to a "verbose"-level message in prim.c. The
address passed to mmap is only a hint -- it's normal for mmap() to
sometimes not respect the hint and return a different address.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir topic-free-threading type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

5 participants