From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Felix Lechner via "Developers list for Guile, the GNU extensibility library" Newsgroups: gmane.lisp.guile.devel Subject: madvise failed: Invalid argument Date: Mon, 12 Aug 2024 19:01:42 -0700 Message-ID: <87sev9b2pl.fsf@lease-up.com> Reply-To: Felix Lechner Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25911"; mail-complaints-to="usenet@ciao.gmane.io" To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Tue Aug 13 04:02:29 2024 Return-path: Envelope-to: guile-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sdgrj-0006Y8-SV for guile-devel@m.gmane-mx.org; Tue, 13 Aug 2024 04:02:28 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sdgrA-00049y-GQ; Mon, 12 Aug 2024 22:01:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sdgr7-00049i-Uq for guile-devel@gnu.org; Mon, 12 Aug 2024 22:01:50 -0400 Original-Received: from sail-ipv4.us-core.com ([208.82.101.137]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1sdgr4-0002ay-CD for guile-devel@gnu.org; Mon, 12 Aug 2024 22:01:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=2017; bh=zJzYwuy34zjeY5i ECcLlepPdZBk+QLVGKa3VrEYatVE=; h=date:subject:to:from; d=lease-up.com; b=qv36HZlqrtm7hhrg9Vi4tEUwgYS8cIqun2+6KaLQ8Hz4eHJ8/AVxcA9MKhyv7HY3vwiF HEb6SZzwfo68hNYTaf+mGtPV6vge2YwR+yp5VF+6sjHvQDKndAxqzvZBA57fyN7ANvqplg dwO50MXIoBfA3n8N8XGHqxWdxpWATqFHw= Original-Received: by sail-ipv4.us-core.com (OpenSMTPD) with ESMTPSA id 22236deb (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for ; Tue, 13 Aug 2024 02:01:43 +0000 (UTC) Received-SPF: pass client-ip=208.82.101.137; envelope-from=felix.lechner@lease-up.com; helo=sail-ipv4.us-core.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.devel:22664 Archived-At: 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