• (GAWK) Persistent Memory only works on 64-bit systems?

    From Kenny McCormack@21:1/5 to All on Sat Apr 19 10:42:56 2025
    I recently compiled up a version of the latest GAWK (*), because I wanted
    to play with some of the new features (namespaces, persistent memory, etc)

    However, it looks like PMA didn't get compiled in. Here is the first line
    of --version (notice the absence of the word "Avon"):

    GNU Awk 5.3.2, API 4.0, (GNU MPFR 3.1.5, GNU MP 6.1.2)

    And I remembered reading somewhere that the PMA feature works on 64-bit
    systems (implying that it *only* works on 64-bit systems).

    So, I'm curious as to *why* this restriction? Could someone on the dev
    team (or other knowledgeable person) comment on this?

    (*) On a 32-bit Linux system.

    --
    Alice was something of a handful to her father, Theodore Roosevelt. He was once asked by a visiting dignitary about parenting his spitfire of a daughter and he replied, "I can be President of the United States, or I can control Alice. I cannot possibly do both."

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kenny McCormack@21:1/5 to luuk@invalid.lan on Sat Apr 19 11:48:43 2025
    In article <nnd$6f306746$6aa32925@4beb9900b52d6519>,
    Luuk <luuk@invalid.lan> wrote:
    ...
    Sorry no answer on why the restriction, but:

    I tested the build on my (64-bit) WSL, and followed instructions on: >https://www.gnu.org/software/gawk/manual/html_node/Persistent-Memory.html

    Meaning no offense (well, OK, maybe a little offense), but why bother
    poster all that (*)? What does it show (that I don't already know) ?

    (*) Essentially, a manual regurgitation.

    --
    The randomly chosen signature file that would have appeared here is more than 4 lines long. As such, it violates one or more Usenet RFCs. In order to remain in compliance with said RFCs, the actual sig can be found at the following URL:
    http://user.xmission.com/~gazelle/Sigs/Pearls

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Luuk@21:1/5 to Kenny McCormack on Sat Apr 19 13:36:44 2025
    On 19-4-2025 12:42, Kenny McCormack wrote:
    I recently compiled up a version of the latest GAWK (*), because I wanted
    to play with some of the new features (namespaces, persistent memory, etc)

    However, it looks like PMA didn't get compiled in. Here is the first line
    of --version (notice the absence of the word "Avon"):

    GNU Awk 5.3.2, API 4.0, (GNU MPFR 3.1.5, GNU MP 6.1.2)

    And I remembered reading somewhere that the PMA feature works on 64-bit systems (implying that it *only* works on 64-bit systems).

    So, I'm curious as to *why* this restriction? Could someone on the dev
    team (or other knowledgeable person) comment on this?

    (*) On a 32-bit Linux system.


    Sorry no answer on why the restriction, but:

    I tested the build on my (64-bit) WSL, and followed instructions on: https://www.gnu.org/software/gawk/manual/html_node/Persistent-Memory.html

    luuk@ZES:/mnt/d/TEMP/gawk/gawk$ ./gawk -V
    GNU Awk 5.3.60, API 4.0, PMA Avon 8-g1
    Copyright (C) 1989, 1991-2025 Free Software Foundation.

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program. If not, see http://www.gnu.org/licenses/. luuk@ZES:/mnt/d/TEMP/gawk/gawk$ cat /etc/os-release
    PRETTY_NAME="Ubuntu 22.04.5 LTS"
    NAME="Ubuntu"
    VERSION_ID="22.04"
    VERSION="22.04.5 LTS (Jammy Jellyfish)"
    VERSION_CODENAME=jammy
    ID=ubuntu
    ID_LIKE=debian
    HOME_URL="https://www.ubuntu.com/"
    SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
    UBUNTU_CODENAME=jammy

    luuk@ZES:/mnt/d/TEMP/gawk/gawk$ truncate -s 4G data.pma luuk@ZES:/mnt/d/TEMP/gawk/gawk$ chmod 0600 data.pma luuk@ZES:/mnt/d/TEMP/gawk/gawk$ GAWK_PERSIST_FILE=data.pma ./gawk 'BEGIN
    { print ++i }'
    1
    luuk@ZES:/mnt/d/TEMP/gawk/gawk$ GAWK_PERSIST_FILE=data.pma ./gawk 'BEGIN
    { print ++i }'
    2
    luuk@ZES:/mnt/d/TEMP/gawk/gawk$ GAWK_PERSIST_FILE=data.pma ./gawk 'BEGIN
    { print ++i }'
    3
    luuk@ZES:/mnt/d/TEMP/gawk/gawk$ GAWK_PERSIST_FILE=data.pma ./gawk -f
    test.gawk
    4
    luuk@ZES:/mnt/d/TEMP/gawk/gawk$ GAWK_PERSIST_FILE=data.pma ./gawk -f
    test.gawk
    5
    luuk@ZES:/mnt/d/TEMP/gawk/gawk$ GAWK_PERSIST_FILE=data.pma ./gawk -f
    test.gawk
    6
    luuk@ZES:/mnt/d/TEMP/gawk/gawk$ GAWK_PERSIST_FILE=data.pma ./gawk 'BEGIN
    { print ++i }'
    7
    luuk@ZES:/mnt/d/TEMP/gawk/gawk$ GAWK_PERSIST_FILE=data.pma ./gawk 'BEGIN
    { print ++i }'
    8
    luuk@ZES:/mnt/d/TEMP/gawk/gawk$

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kenny McCormack@21:1/5 to Kenny McCormack on Sat Apr 19 11:50:13 2025
    In article <vu02ir$1vb76$2@news.xmission.com>,
    Kenny McCormack <gazelle@shell.xmission.com> wrote:
    In article <nnd$6f306746$6aa32925@4beb9900b52d6519>,
    Luuk <luuk@invalid.lan> wrote:
    ...
    Sorry no answer on why the restriction, but:

    I tested the build on my (64-bit) WSL, and followed instructions on: >>https://www.gnu.org/software/gawk/manual/html_node/Persistent-Memory.html

    Oops - I got confused by my newsreader, and ended up posting this twice.
    Sorry.

    --
    A pervert, a racist, and a con man walk into a bar...

    Bartender says, "What will you have, Donald!"

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Luuk@21:1/5 to Kenny McCormack on Sat Apr 19 15:07:15 2025
    On 19-4-2025 13:50, Kenny McCormack wrote:
    In article <vu02ir$1vb76$2@news.xmission.com>,
    Kenny McCormack <gazelle@shell.xmission.com> wrote:
    In article <nnd$6f306746$6aa32925@4beb9900b52d6519>,
    Luuk <luuk@invalid.lan> wrote:
    ...
    Sorry no answer on why the restriction, but:

    I tested the build on my (64-bit) WSL, and followed instructions on:
    https://www.gnu.org/software/gawk/manual/html_node/Persistent-Memory.html

    Oops - I got confused by my newsreader, and ended up posting this twice. Sorry.


    Anyone using a 15 year old newsreader is allowed to do that,
    😉

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Christian Weisgerber@21:1/5 to Kenny McCormack on Sat Apr 19 14:04:22 2025
    On 2025-04-19, Kenny McCormack <gazelle@shell.xmission.com> wrote:

    And I remembered reading somewhere that the PMA feature works on 64-bit systems (implying that it *only* works on 64-bit systems).

    Yes, the README for PMA already says:
    "Requirements/assumptions include 64-bit machine words (longs and
    pointers) and reasonable page sizes."

    So, I'm curious as to *why* this restriction? Could someone on the dev
    team (or other knowledgeable person) comment on this?

    You'll need to read Terence Kelly's papers and/or the source code
    for a rationale. It's not really a gawk issue as gawk is simply a
    consumer and inherits the limitation from the PMA upstream.

    I.e., I tried to find a quick answer and didn't. Tagged pointers?
    *quickly looks over support/pma.c*
    Indeed, I see that the lowest three bits of allocated object pointers
    are used for flags.

    --
    Christian "naddy" Weisgerber naddy@mips.inka.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)