termux-pacman-bot 7a4ab56ecb bump(main/ghc): 9.12.2
Patched `rts` heap reservation logic on Android:

  * Need for patch

  - There seems to be a bug on Android. Sometimes simple commands like `ghc --help` usage 90% - 100% cpu and hangs.

  - It doesn't happen every time, but ~25% of the times (at least in my
    testing).

  * Cause of the bug

  - The function `osReserveHeapMemory` tries to allocate virtual space starting
    from `0x4200000000`. The allocated space has to start at an address >= this address.

  - If the kernel doesn't allocate inside this space, it keeps on repeating the
    `mmap` call with increasing starting point.

  - Now, on Android the kernel sometimes return an address above (as in counting)
    this `hint` address. It repeatedly returns the same address for subsequent calls.

  - Thus, an infinite loop occurs.

  References:
    - 383be28ffd/rts/posix/OSMem.c (L461)
    - https://github.com/termux/termux-packages/pull/22991#issuecomment-2759137291

  * Solution (proposed by Robert Kirkman):

  - It introduces a new helper function `osTryReserveHeapMemoryRecursive`.
    This transforms the heap reservation logic into a recursive one.

  - `osTryReserveHeapMemory()` is run multiple times without unmapping the
    undesired addresses. Thus, forcing the kernel to map subsequent calls of
    `mmap` to a new, unique address until an address above the `0x4200000000`
    mark is obtained.

  - After which each recursive call unmaps its undesired address before returning
    the desired address (in order from last mapped to first mapped).

  References:
    - https://gitlab.haskell.org/ghc/ghc/-/merge_requests/14164
    - https://github.com/termux/termux-packages/pull/22991#issuecomment-2761325484

Co-authored-by: Robert Kirkman <rkirkman@termux.dev>
Signed-off-by: Aditya Alok <alok@termux.dev>
2025-04-08 16:42:00 +00:00
2025-04-05 20:05:06 +00:00
2024-11-09 02:47:14 +00:00
2025-04-08 16:42:00 +00:00
2025-04-08 12:48:21 +00:00
2025-04-08 16:41:59 +00:00
2020-08-27 21:40:58 +03:00
2024-01-18 13:00:32 +03:00
2020-04-29 00:32:23 +02:00
2022-07-28 10:41:57 +00:00
2025-04-08 16:41:59 +00:00
2025-03-22 01:31:14 +00:00
2025-03-16 16:38:35 +00:00
2025-02-23 13:06:54 +00:00
2019-06-08 14:40:01 +03:00
2024-05-13 10:33:57 +03:00
2023-10-04 14:21:52 +03:00
2023-08-20 23:34:19 +03:00

Termux packages for pacman - official git repo mirror

GitHub repo size Packages last build status Repo last update status
More about the repository

Code for connecting repository:

main:

[main]
Server = https://service.termux-pacman.dev/main/$arch

x11:

[x11]
Server = https://service.termux-pacman.dev/x11/$arch

root:

[root]
Server = https://service.termux-pacman.dev/root/$arch

Other information:

  • Android support: 7+
  • Architecture support: all (aarch64, arm, x86_64, i686)
  • Signature: termux-pacman organization gpg key
  • Powered by aws
  • Root repository: https://github.com/termux/termux-packages
  • Organization maintaining the root repository: termux
Description
A build system and primary set of packages in format pacman for Termux.
Readme 107 MiB
Languages
Shell 79.8%
C 13.1%
C++ 2.7%
CMake 1.1%
Python 0.8%
Other 2.3%