guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

madvise failed: Invalid argument


From: Felix Lechner
Subject: madvise failed: Invalid argument
Date: Mon, 12 Aug 2024 19:01:42 -0700

Hi,

Would someone please help me understand the warning message

    madvise failed: Invalid argument

in my code?

In my newest project, I hope to offer users a more convenient way to
configure authentication tasks and partially reimplemented Linux-PAM in
GNU Guile. [1]

The online manual is the most convenient way to read about it. [2]

My code uses an ELF shared object called pam_guile.so to call Guile via
the interface described in the Tortoise tutorial.  [3] The warning
probably originates here:

    ret = madvise ((void *) lo, hi - lo, MADV_DONTNEED); [4]

>From my reading, that call is meant to return stack space back to the
operating system.  According to the madvise(2) manual page [5] the
variable 'lo' must be page-aligned, but apparently isn't.

Why would the 'stack_bottom' not be page aligned, please?  Could it be
mitigated by alignment instructions in my ELF shared object?

Thank you for looking!

Kind regards
Felix

P.S. Please copy me explicitly.  I do not subscribe to your list.

[1] https://codeberg.org/lechner/guile-pam
[2] https://juix.org/guile-pam/
[3] https://www.gnu.org/software/guile/docs/guile-tut/tutorial.html
[4] https://git.savannah.gnu.org/cgit/guile.git/tree/libguile/vm.c#n651
[5] https://www.man7.org/linux/man-pages/man2/madvise.2.html



reply via email to

[Prev in Thread] Current Thread [Next in Thread]