From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Richard Copley Newsgroups: gmane.emacs.bugs Subject: bug#59104: 28.2; Uninitialized field command_modes in Lisp_Module_Function Date: Mon, 7 Nov 2022 11:30:51 +0000 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34044"; mail-complaints-to="usenet@ciao.gmane.io" To: 59104@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 07 12:32:32 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1os0Mh-0008gd-TU for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 07 Nov 2022 12:32:32 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1os0MG-0007vy-GT; Mon, 07 Nov 2022 06:32:04 -0500 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 1os0ME-0007va-Ui for bug-gnu-emacs@gnu.org; Mon, 07 Nov 2022 06:32:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1os0ME-0008La-Mv for bug-gnu-emacs@gnu.org; Mon, 07 Nov 2022 06:32:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1os0ME-0005YF-5C for bug-gnu-emacs@gnu.org; Mon, 07 Nov 2022 06:32:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Richard Copley Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 07 Nov 2022 11:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 59104 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.166782069621302 (code B ref -1); Mon, 07 Nov 2022 11:32:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 7 Nov 2022 11:31:36 +0000 Original-Received: from localhost ([127.0.0.1]:33496 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1os0Ln-0005XU-TN for submit@debbugs.gnu.org; Mon, 07 Nov 2022 06:31:36 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:48824) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1os0Lm-0005XN-6U for submit@debbugs.gnu.org; Mon, 07 Nov 2022 06:31:34 -0500 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 1os0LY-0007nH-JG for bug-gnu-emacs@gnu.org; Mon, 07 Nov 2022 06:31:27 -0500 Original-Received: from mail-lj1-x22e.google.com ([2a00:1450:4864:20::22e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1os0LW-0008B9-Oa for bug-gnu-emacs@gnu.org; Mon, 07 Nov 2022 06:31:20 -0500 Original-Received: by mail-lj1-x22e.google.com with SMTP id u2so15775924ljl.3 for ; Mon, 07 Nov 2022 03:31:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=MNyCTi9H+Z98NRH76z3bnjWHe+97qc/yPXNyU+VAydk=; b=BmYy65mtggX3Kl5lHb9xE6Ynxoqz+QMk5nGa4K7+duo9+qgb6E0zR8VelbOixuMf0l saP0QKgi/DJ8z3iWWhsHEXh7fdnzOeQzc+Mu5oq6UXbalnxW5EiqaHfhlVJbrDx935fx BuzgROEqL8QucTwQ4O1pAARESrTFEM7kKMZfV84u8hOzQZ8fXPz97I2UufHPqCJcfkLR 4mY3NaC6qMgyB0ey1d3GHmuq016BAMyfssTEO8R/qrArPcgcJ1w1ZSapUYlZisGxcn+O TyWk2A4LAl/2NPhx5GiG56b9XMM744+q2fo+6lbA8EhkBgYxQOYPULE/it3CfBLT5BeG GPhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=MNyCTi9H+Z98NRH76z3bnjWHe+97qc/yPXNyU+VAydk=; b=k/ZfltJc8ZG0jmcuxs2qYL7KCQf8uvbbrvSQCdI4NmfJd53a0tOtZ/Y59WRtNqXha9 IiVnPtMP9bQ18BDTQ9FkKdE3qnn3BcWhpyRKKta7IOwjW23f/WBihJ9GXw1oGr4+TJF+ 4OQSMDBsZRRQmuvvF+3L0PlAEpgUZvNE9Q+p8iT4gsDp44xarWO31tQ/l9zl/8D3Q5Jf VSqxez4E7FYzidqWh2dE4rTRZ7B4OZhigx4hyzCZQL/KlW9dozSAJeWGaLtWbLejrLfl eSKY4hQxIsXokm7Nttl/gvjCl24QANIh4xSwgK7HG9AqsnhcUhpY2smDg7kZgpDFbSRJ T5OQ== X-Gm-Message-State: ACrzQf3zH8epGXDd2nBN4nKYRsRiBzft1T4XGygjUrsSADTwlPjhkAvh 5t0kRDxtm+L+uoFr6x5dRAP1JNCxxmFn7QpdxGF4HyEWiJQ= X-Google-Smtp-Source: AMsMyM7Mv5b0/jk8YDbzSAbi7ulSOniobvzfE+Gq6KH8W0/rirFa+IqbjWfQEyDXp6EFHPf6CjtoEy1zU1skHhx+7ug= X-Received: by 2002:a2e:9248:0:b0:277:5b:2212 with SMTP id v8-20020a2e9248000000b00277005b2212mr18556736ljg.299.1667820676350; Mon, 07 Nov 2022 03:31:16 -0800 (PST) Received-SPF: pass client-ip=2a00:1450:4864:20::22e; envelope-from=rcopley@gmail.com; helo=mail-lj1-x22e.google.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:247275 Archived-At: 1. Save the "next-prime" sample C program in section E.8.3 "Module Values" of the Elisp manual to file "sample.c" 2. Add these three lines before "return 0;" in function "emacs_module_init" at the end of the file: const char s[] = "nInteger: "; emacs_value spec = env->make_string(env, s, sizeof s - 1); env->make_interactive (env, func, spec); 3. Save and compile (compile-command: "gcc --shared -o ~/sample.so sample.c -lgmp"). 4. (Dangerous) Load the module and attempt to access the command_modes field of the Lisp_Module_Function object for the next-prime command. emacs --batch -eval "(load-library \"~/sample.so\")" -eval "(print (command-modes 'next-prime))" The command_modes field seems to be uninitialized. This might print a random integer, print a randomly selected lisp object from memory, or segfault. In GNU Emacs 28.2 (build 2, x86_64-w64-mingw32) of 2022-10-11 built on fv-az365-328 Repository revision: b35f9af313a5d5c42988eb5a7751209b4234a67e Repository branch: master Windowing system distributor 'Microsoft Corp.', version 10.0.19045 System Description: Microsoft Windows 10 Pro (v10.0.2009.19045.2130) Configured using: 'configure --prefix=/mingw64 --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --with-modules --without-dbus --without-compress-install --with-native-compilation 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe' CPPFLAGS=-D__USE_MINGW_ANSI_STDIO=1 LDFLAGS=-pipe' Configured features: ACL GIF GMP GNUTLS HARFBUZZ JPEG JSON LIBXML2 MODULES NATIVE_COMP NOTIFY W32NOTIFY PDUMPER PNG RSVG SOUND THREADS TIFF TOOLKIT_SCROLL_BARS XPM ZLIB Important settings: value of $LANG: ENG locale-coding-system: cp1252 Major mode: Fundamental Minor modes in effect: shell-dirtrack-mode: t tooltip-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util rmail rmail-loaddefs auth-source eieio eieio-core eieio-loaddefs password-cache json map mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils time-date misearch multi-isearch shell pcomplete compile text-property-search comint ansi-color ring vc-git diff-mode easy-mmode vc-dispatcher cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs dired-aux dired comp comp-cstr warnings subr-x rx cl-seq cl-macs cl-extra help-mode seq byte-opt gv cl-loaddefs cl-lib bytecomp byte-compile cconv dired-loaddefs iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel dos-w32 ls-lisp disp-table term/w32-win w32-win w32-vars term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads w32notify w32 multi-tty make-network-process native-compile emacs) Memory information: ((conses 16 166842 11642) (symbols 48 11063 1) (strings 32 38698 2749) (string-bytes 1 1480785) (vectors 16 24357) (vector-slots 8 430076 60478) (floats 8 42 269) (intervals 56 2483 0) (buffers 992 18))