From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 17 14:03:59 2024 Received: (at submit) by debbugs.gnu.org; 17 Mar 2024 18:03:59 +0000 Received: from localhost ([127.0.0.1]:33100 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rlurV-0008C3-UO for submit@debbugs.gnu.org; Sun, 17 Mar 2024 14:03:59 -0400 Received: from lists.gnu.org ([209.51.188.17]:57372) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rlurR-0008BU-9Y for submit@debbugs.gnu.org; Sun, 17 Mar 2024 14:03:53 -0400 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 1rlune-0006Xw-48 for bug-gnu-emacs@gnu.org; Sun, 17 Mar 2024 13:59:58 -0400 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rlunc-0001Bi-4C for bug-gnu-emacs@gnu.org; Sun, 17 Mar 2024 13:59:57 -0400 Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-56a2bb7d944so182004a12.3 for ; Sun, 17 Mar 2024 10:59:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710698393; x=1711303193; darn=gnu.org; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=T+qPiodBEjP46IxO7gH25OrJV8u8a/kHB69QiUNxcq0=; b=fhRRF4DXiwyGbr31Vp9i9BFFb/vzhRZ3zM89XXzw7huEFbKNBMOlfKkKCEwXlTktXS ZLZ4WxRGTo3o+FamfUhj0kLj4qjbKfVQg2n70fbyrZ8AV5JklImgsfIWzaQ7oxcFfJCv Ct6zj9ZT+RZOZhQhFhYuW+DqWyIWitQToEapmtoIW9LekgtIG3y7IBRh7HHG0qJIJeCU BfgIeeIlAhH/jahieVemtnXDLzBcsZxi0xsWvz0xQAxugJng3oHyc4I2wUC/c19wFHGA /rJANdIFNS4An0aAb+cwFuu0O+6MevYCtYQ0n/M9WPxlosc+Onzx4L4zxQP+tkNoVxFL n3fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710698393; x=1711303193; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=T+qPiodBEjP46IxO7gH25OrJV8u8a/kHB69QiUNxcq0=; b=jwVqW5Xath73IStPJMtk4o6bRvGngDwc/WUM+m8NWp5K1675Rd2xC52HRO/+9avRdE viC2iD5vg720ZSyOYWw+NLpTSm7ask0gG6Zfkp+iDjIFfaICXlQy68RwCEuXV8ciq3Hq p4CIYfJj4GV16SldFhu6v/c0bJn6I08FQZASji9ECrBir9Pf/Oom3+xBiWzls+Wl7uPa iz4DZ/ZUaFTyqjuQUV4oxexoIyv/1oJ+HjZsNETKGrOsPS5nNmHDwqAK1M5DmdTGfCQj iizE6Eh0DxWUKiUuYOgLAexpQdr+tLjjgNnELyh+Dee8/JXeOLc3EpuQW3azppojHjN0 /dFw== X-Gm-Message-State: AOJu0YzJbCtqDmRbxS/vHYg139sbfD9TgLKk8NJ1hP0OajtWA+wC9x7X cRldrDXJl8fiXcIhdH28JTkyu7J4YgSzQPiBYMPEfEsXnKEC5yp+azuNjQZt X-Google-Smtp-Source: AGHT+IHYpGqWkzvlMMmnob9IKGkoEcvxQRiTSM3d5dm3wXco2T7Kk9KQVzpwwiHalmjsNitAyF5neg== X-Received: by 2002:a17:906:2dd8:b0:a46:ab20:489d with SMTP id h24-20020a1709062dd800b00a46ab20489dmr2348800eji.1.1710698393222; Sun, 17 Mar 2024 10:59:53 -0700 (PDT) Received: from Pro.fritz.box (p4fe3a99d.dip0.t-ipconnect.de. [79.227.169.157]) by smtp.gmail.com with ESMTPSA id d10-20020a170907272a00b00a44ef54b6b6sm3989097ejl.58.2024.03.17.10.59.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Mar 2024 10:59:52 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: bug-gnu-emacs@gnu.org Subject: 30.0.50; Problem with equal hash tables X-Debbugs-Cc: Date: Sun, 17 Mar 2024 18:59:51 +0100 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2a00:1450:4864:20::529; envelope-from=gerd.moellmann@gmail.com; helo=mail-ed1-x529.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/plain This is in master, 562d9c9db56172c754a2556a996245145ae223f5 I suspect we have a problem with equal hash-tables in master. Apply the attached patch, configure with checking enabled, and build it. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-check_table.patch Content-Description: hash table checking diff --git a/src/fns.c b/src/fns.c index 0a64e515402..9467c806975 100644 --- a/src/fns.c +++ b/src/fns.c @@ -4506,6 +4506,31 @@ hashfn_user_defined (Lisp_Object key, struct Lisp_Hash_Table *h) hashtest_equal = { .name = LISPSYM_INITIALLY (Qequal), .cmpfn = cmpfn_equal, .hashfn = hashfn_equal }; +static ptrdiff_t hash_index_index (struct Lisp_Hash_Table *h, + hash_hash_t hash); + +static void +check_table (struct Lisp_Hash_Table *h) +{ + ptrdiff_t n = hash_table_index_size (h); + for (ptrdiff_t bucket = 0; bucket < n; ++bucket) + { + ptrdiff_t next; + for (ptrdiff_t i = HASH_INDEX (h, bucket); i >= 0; i = next) + { + next = HASH_NEXT (h, i); + eassert (i >= 0 && i < HASH_TABLE_SIZE (h)); + + Lisp_Object key = HASH_KEY (h, i); + eassert (!hash_unused_entry_key_p (key)); + hash_hash_t hash = hash_from_key (h, key); + eassert (hash == HASH_HASH (h, i)); + hash_idx_t bucket_now = hash_index_index (h, hash); + eassert (bucket_now == bucket); + } + } +} + /* Allocate basically initialized hash table. */ static struct Lisp_Hash_Table * @@ -4785,6 +4810,7 @@ hash_table_thaw (Lisp_Object hash_table) hash_lookup_with_hash (struct Lisp_Hash_Table *h, Lisp_Object key, hash_hash_t hash) { + check_table (h); ptrdiff_t start_of_bucket = hash_index_index (h, hash); for (ptrdiff_t i = HASH_INDEX (h, start_of_bucket); 0 <= i; i = HASH_NEXT (h, i)) --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable This adds a check that all collision lists of hash-tables are ok. I originally added something similar in my local Emacs because I'm changing the hash-table implementation, for reasons that have to do with changing the GC. The compilation will fail with=20 Loading /Users/gerd/emacs/savannah/master/lisp/emacs-lisp/cl-generic.el (= source)... fns.c:4527: Emacs fatal error: assertion failed: hash =3D=3D HASH_HASH (h= , i) Fatal error 6: Aborted I don't think I have an error in the checking code, but who knows. If there's no error in the checks, then we might have a problem with sxhash, I suspect. LLDB session: (lldb) r --batch -l loadup --temacs=3Dpbootstrap -dest /Users/gerd/emacs/s= avannah/master/nextstep/Emacs.app/Contents/MacOS/ --eln-dest /Users/gerd/em= acs/savannah/master/nextstep/Emacs.app/Contents/Frameworks/ Process 90778 launched: '/Users/gerd/emacs/savannah/master/src/temacs' (x86= _64) ... Loading /Users/gerd/emacs/savannah/master/lisp/emacs-lisp/cl-generic.el (so= urce)... fns.c:4527: Emacs fatal error: assertion failed: hash =3D=3D HASH_HASH (h, = i) Process 90778 stopped * thread #1, queue =3D 'com.apple.main-thread', stop reason =3D signal SIGA= BRT frame #0: 0x00007ff80a71414a libsystem_kernel.dylib`__pthread_kill + 10 libsystem_kernel.dylib`__pthread_kill: -> 0x7ff80a71414a <+10>: jae 0x7ff80a714154 ; <+20> 0x7ff80a71414c <+12>: movq %rax, %rdi 0x7ff80a71414f <+15>: jmp 0x7ff80a70db20 ; cerror_nocancel 0x7ff80a714154 <+20>: retq=20=20=20 (lldb) up 10 frame #10: 0x00000001002cc88c temacs`hash_lookup_with_hash(h=3D0x00007fb1f8= 9211a0, key=3D(struct Lisp_Cons *) $4 =3D 0x00007fb1fbab76c0, hash=3D133992= 3535) at fns.c:4813:3 (lldb) do frame #9: 0x00000001002d39f1 temacs`check_table(h=3D0x00007fb1f89211a0) at = fns.c:4527:4 (lldb) p hash=20 (hash_hash_t) 664518371 (lldb) p h->hash[i] (hash_hash_t) 26984166 (lldb) xdebug_print h->key_and_value[2*i] (#s(cl--generic cl-generic-generalizers ((0 #s(cl--generic-generalizer cl--= generic-t-generalizer 0 (closure (cl-struct-cl--generic-generalizer-tags t)= (_name &rest _) nil) (closure (cl-struct-cl--generic-generalizer-tags t) (= _tag &rest _) '(t))))) (#s(cl--generic-method (t) (:extra "head") curried (= closure (cl-struct-cl--generic-tags cl-struct-cl--generic-method-tags cl-st= ruct-cl--generic-generalizer-tags t) (cl--nm) (let ((cl--nmp (if (cl--gener= ic-isnot-nnm-p cl--nm) #'always #'ignore))) #'(lambda (&rest cl--args) "Sup= port for (head VAL) specializers. These match if the argument is a cons cell whose car is `eql' to VAL. (fn SPECIALIZER)" (let ((cl--cnm #'(lambda (&rest args) (apply cl--nm (or a= rgs cl--args))))) (apply #'(lambda (cl--cnm specializer) (progn (if (not (e= q (car-safe specializer) 'head)) (funcall cl--cnm) (let* ((v (car (cdr spec= ializer))) (v cl--generic-head-used)) (or (gethash v v) (let* ((val special= izer)) (progn (puthash v val v) val)))) (list cl--generic-head-generalizer)= ))) cl--cnm cl--args)))))) #s(cl--generic-method (t) nil nil (closure (cl-s= truct-cl--generic-tags cl-struct-cl--generic-method-tags cl-struct-cl--gene= ric-generalizer-tags t) (specializer) "Support for the catch-all t speciali= zer which always matches." (progn (if (eq specializer t) (list cl--generic-= t-generalizer) (error "Unknown specializer %S" specializer)))))) nil) #s(cl= --generic-method (t) nil nil (closure (cl-struct-cl--generic-tags cl-struct= -cl--generic-method-tags cl-struct-cl--generic-generalizer-tags t) (special= izer) "Support for the catch-all t specializer which always matches." (prog= n (if (eq specializer t) (list cl--generic-t-generalizer) (error "Unknown s= pecializer %S" specializer)))))) (lldb) p h->test (const hash_table_test *) 0x000000010049e7e8 (lldb) p h->frozen_test=20 (hash_table_std_test_t) Test_eq | Test_equal (lldb) p *h (Lisp_Hash_Table) { header =3D (size =3D 4611686018662301696) index =3D 0x0000600001cf41a0 hash =3D 0x0000600001cf4180 key_and_value =3D 0x00006000038f4060 (struct Lisp_Symbol *) $27 =3D 0x000= 060010439bcb0 test =3D 0x000000010049e7e8 next =3D 0x0000600001cf4160 count =3D 5 next_free =3D 5 table_size =3D 6 index_bits =3D '\x03' weakness =3D Weak_Value frozen_test =3D Test_eq | Test_equal purecopy =3D false mutable =3D true next_weak =3D NULL } (lldb) xbacktrace=20 (unsigned char *) data =3D 0x0000000100481d88 "gethash" (unsigned char *) data =3D 0x00000001004812d4 "or" (unsigned char *) data =3D 0x00000001004813af "let*" (unsigned char *) data =3D 0x00000001004813ab "let" (unsigned char *) data =3D 0x00000001004812db "if" (unsigned char *) data =3D 0x00007fb1f8a41978 "cl--generic-build-combined-m= ethod" (unsigned char *) data =3D 0x00000001004812db "if" (unsigned char *) data =3D 0x00000001004813af "let*" (unsigned char *) data =3D 0x00007fb1f8a41950 "cl--generic-make-next-functi= on" (unsigned char *) data =3D 0x00007fb1f8a40d58 "cl--generic-make-function" (unsigned char *) data =3D 0x00000001004813ab "let" (unsigned char *) data =3D 0x00000001004812e3 "progn" (unsigned char *) data =3D 0x00000001004813af "let*" (unsigned char *) data =3D 0x00000001004813ab "let" (unsigned char *) data =3D 0x00000001004813af "let*" (unsigned char *) data =3D 0x00000001004812e3 "progn" (unsigned char *) data =3D 0x00000001004813af "let*" (unsigned char *) data =3D 0x00007fb1f8a41478 "cl-generic-define-method" (unsigned char *) data =3D 0x0000000100487f58 "eval-buffer" (unsigned char *) data =3D 0x00000001004812db "if" (unsigned char *) data =3D 0x00000001004813ab "let" (unsigned char *) data =3D 0x00000001004813ab "let" (unsigned char *) data =3D 0x00000001004813ef "unwind-protect" (unsigned char *) data =3D 0x00000001004813ab "let" (unsigned char *) data =3D 0x00000001004812db "if" (unsigned char *) data =3D 0x00007fb1f883bb28 "load-with-code-conversion" (unsigned char *) data =3D 0x0000000100486664 "load" (unsigned char *) data =3D 0x0000000100486664 "load" --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 17 14:58:15 2024 Received: (at 69864) by debbugs.gnu.org; 17 Mar 2024 18:58:15 +0000 Received: from localhost ([127.0.0.1]:35633 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rlvi3-00025d-2U for submit@debbugs.gnu.org; Sun, 17 Mar 2024 14:58:15 -0400 Received: from mail-ej1-f54.google.com ([209.85.218.54]:55585) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rlvhx-00025A-B8 for 69864@debbugs.gnu.org; Sun, 17 Mar 2024 14:58:13 -0400 Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-a4644bde1d4so479721266b.3 for <69864@debbugs.gnu.org>; Sun, 17 Mar 2024 11:57:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710701786; x=1711306586; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ujjFd1TQyHF37u6azBJCeLXj6vU7Us5es6JjAqfYlYY=; b=VqRkApU4EapFkrskFezQpF+xZW0riAAhDHVKcp5RWxsIiXcmbnm+6KfITyJVRF1wbf 0RzcjSW6zYk5kB/NpuPydO/W90LAx3x84bQhIaVr7IrPyL87kMMtBnUfPFkpgZBfHFhi OQ8hSBw/67E1dP1FatrZZ/ZxzYDZ4URl59M9H1tOiYLMfRj/CbOQdh8PvgpMbtaexCvZ yZr1y/GPV+HSwJ/mX5m+/pI4U0zd2ojq3k9gwwYgomuMp6bLDeOX3pNCY8/rQ1uevc36 Y4sJaNJLf3Qoe9ARBZOimzwWhmQLP93YVTLMcBups/XoKdx29XETAv/PXZGaqmi1xB5B AArA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710701786; x=1711306586; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=ujjFd1TQyHF37u6azBJCeLXj6vU7Us5es6JjAqfYlYY=; b=cykoYl76LXKY8ZbAzoc+zmTipniXQwIRP/X0n+5BimwsoAtQIkwQEKOW4GC0BMpEy4 mYZG19SARWQC7im0aHAI0hoaiee6St8k6MJM7T5bAmuu1kNFC+rUTr/Ta9vL4HXc7D3A 6T82xY97Z96L8loSaRibyevo/n4u2Up6ZKAlAhXoblEuOHfqrEOv1xZxMDYAy3XyeKSO EMD6gi3v8roGDAAEPXMzdO3biegwopji604V9U94tQqK2GePu2x7JgUOsBu1ea0/F8fl Vebv61r5SVX1E/43YqpPon4FB33jGW7zEaA/4b5kx2TR3cBtBDMyODD1Yl2t03ju+Kfg Butg== X-Gm-Message-State: AOJu0Yx90Ar8DUqIp9scZ3DYmdpDm5h7YSp9WNRU1kPvnYnZeB8XQYOQ B58Di8qh05ooV37ThdPIllxJR/6NPNwDNQ0Y/HHGxwXQDeC4Wq+HsrevQZxw X-Google-Smtp-Source: AGHT+IHez1p1C0lGz/5VrLfjoKNf6EVzyFadUQUe35mZFnsnn4aDsDWt06zTw92ZMbNaAZtVyRxjKg== X-Received: by 2002:a17:907:968c:b0:a46:220c:a55 with SMTP id hd12-20020a170907968c00b00a46220c0a55mr7149848ejc.73.1710701785548; Sun, 17 Mar 2024 11:56:25 -0700 (PDT) Received: from Pro.fritz.box (p4fe3a99d.dip0.t-ipconnect.de. [79.227.169.157]) by smtp.gmail.com with ESMTPSA id m18-20020a1709060d9200b00a46ac55d8f5sm1509294eji.26.2024.03.17.11.56.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Mar 2024 11:56:25 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: 69864@debbugs.gnu.org Subject: Re: bug#69864: 30.0.50; Problem with equal hash tables In-Reply-To: ("Gerd =?utf-8?Q?M=C3=B6llmann?= =?utf-8?Q?=22's?= message of "Sun, 17 Mar 2024 18:59:51 +0100") References: Date: Sun, 17 Mar 2024 19:56:24 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 69864 Cc: Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Gerd M=C3=B6llmann writes: > (unsigned char *) data =3D 0x00007fb1f8a41978 "cl--generic-build-combined= -method" Or, and maybe more plausible, someone modifies the hash-table keys used in the function above... Stefan is in Cc. From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 17 16:39:13 2024 Received: (at 69864) by debbugs.gnu.org; 17 Mar 2024 20:39:13 +0000 Received: from localhost ([127.0.0.1]:40108 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rlxHl-0006qK-AT for submit@debbugs.gnu.org; Sun, 17 Mar 2024 16:39:13 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:36980) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rlxHj-0006q0-J6 for 69864@debbugs.gnu.org; Sun, 17 Mar 2024 16:39:12 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 8B989441609; Sun, 17 Mar 2024 16:38:27 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1710707902; bh=4J9kHZcLyYr7m96Ju2V5JtQE6Ek/uH0HYVyRGzwgOZQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=lQjxsXK8uv1JXUSmBWnTNqvmfeJCyWlZrXMPLAGZHAUCefmVGVtWspRkNd0HWpT6w edrgi1hRUWT8noFdSkSvvrPm0cYLkIA9MYDb8jaN1ndpzl39mLqqc9pBgZsOm3KEk0 YwUY25BhnApWvqdnoqO2+9IMeFd3kb4A1hJaf3UrbhnjM3K8cnLC1hNA3cK6kGCjIf av/NEZWA6+p0FIXhs4wHVxijb3cvGqzEfoNKa2DKCNUjkTqk/hYBYHPhPESJZVCgkr 2bzkZFRUPF2xmojTeUSbBBkvZsYmgfuIPIz7Aeh96aYUAg+Hs4JhdGoEhNKTylbcHs blROtOYMckMRg== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 0254E441607; Sun, 17 Mar 2024 16:38:21 -0400 (EDT) Received: from alfajor (unknown [104.247.238.200]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id C8B1012039E; Sun, 17 Mar 2024 16:38:21 -0400 (EDT) From: Stefan Monnier To: Gerd =?windows-1252?Q?M=F6llmann?= Subject: Re: bug#69864: 30.0.50; Problem with equal hash tables In-Reply-To: ("Gerd =?windows-1252?Q?M=F6ll?= =?windows-1252?Q?mann=22's?= message of "Sun, 17 Mar 2024 19:56:24 +0100") Message-ID: References: Date: Sun, 17 Mar 2024 16:38:19 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.490 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69864 Cc: 69864@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Gerd M=F6llmann [2024-03-17 19:56:24] wrote: > Gerd M=F6llmann writes: >> (unsigned char *) data =3D 0x00007fb1f8a41978 "cl--generic-build-combine= d-method" > Or, and maybe more plausible, someone modifies the hash-table keys used > in the function above... Lessee... (defun cl--generic-build-combined-method (generic methods) (let ((f (with-memoization ;; FIXME: Since the fields of `generic' are modified, this ;; hash-table won't work right, because the hashes will ch= ange! ;; It's not terribly serious, but reduces the effectivenes= s of ;; the table. (gethash (cons generic methods) cl--generic-combined-method-memoization) [...] I suspect The Right Way would involve flushing the elements of the cache when the generic is modified, or otherwise changing the hash-table index so it doesn't include `generic` at all, or only the part that does matter (as the code points out later on, currently this arg is not used for much). FWIW, I've never really measured the effectiveness of this cache. It'd be worthwhile to do it at some point, because there's a good chance its hit rater is very low (e.g. because its `:weakness` makes it lose its info before we need it). Stefan From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 18 03:47:03 2024 Received: (at 69864) by debbugs.gnu.org; 18 Mar 2024 07:47:03 +0000 Received: from localhost ([127.0.0.1]:42630 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rm7i2-0001jK-Lo for submit@debbugs.gnu.org; Mon, 18 Mar 2024 03:47:03 -0400 Received: from mail-ej1-f44.google.com ([209.85.218.44]:58696) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rm7hz-0001im-2t for 69864@debbugs.gnu.org; Mon, 18 Mar 2024 03:47:00 -0400 Received: by mail-ej1-f44.google.com with SMTP id a640c23a62f3a-a466e53f8c0so514692266b.1 for <69864@debbugs.gnu.org>; Mon, 18 Mar 2024 00:46:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710747915; x=1711352715; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0EwaW81xxrZhgU+qzujKFgWihuD3GhLFvTfeM4aKojc=; b=TcsgHD/C4YkKZu4a+0ZZcPL7ZPUCzWJFTMCSfcaP9qvNHGongrCrtsnFz6geQaqTQf Ueu4Sw3U7YhJr3Zu3lkOOW8WJxH8Bhd5Z4bCVZM2PoVwd7fd1jzJ8W6TcYXLwlZIq8pS LqUrLbmXZaAL1GUpkwTZxI7JeYZiY3smPDgKwRF7PlhDpM2D5WVXUpz5sgUuE5wvhJ7p LHR/Sz7mHhAnzplju0exCZLMAxvQKH8oJyDGrO8XR+wlLMpBAYWw+URHv+RPadQNu/Or KG2U3VtNaDM+ZyiMkuomZOPH0UKnYbCSJDOAH+Piklu8+0r+SQJrF+Yt7OBNDvwmUiZw gZBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710747915; x=1711352715; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=0EwaW81xxrZhgU+qzujKFgWihuD3GhLFvTfeM4aKojc=; b=Jn4ndxzXKPAfajRh1oPYJrXBLu8QN1spe9srRh0IDvmxI7h67lcP9HZfO+V5kn0zc1 4TW8AlXuHGTdFwWB8kjAQc+JIIrHjG0NcRtfU+KlA6MDZrRtyvHsnkKhijiaq+Cd1ZOZ mVBHzJ39f0rvT4ZkO0pZyVMW5mYNx708Rq9WYinT3Lc1mMrkQIqvwGRoHV2NMr2s8PWm 6GUftiw0qXwVaaV/Lo5chAv2jsQJJC3nLFqUSfyqECOnjD/MbzimRU9QUy7v3pzpX2f9 4vEWqDd4E6Rs2jP7VBcFCOzA0dFXxfIyX9498YNZIcjhhOloo5zUbEu3kS+78WS/r85D J1Mg== X-Gm-Message-State: AOJu0YwuxbB3mWvKf3rgFxnSicKFkzIuxDGm+4BeIOj6pJ4fJz+GlIgV wWPbj1CnlisSCpFdGZqyA+P3uZ/OlwXeyZvNUvkmTh1imrzAcHU7apfThOlM X-Google-Smtp-Source: AGHT+IEUqg8lnjy0lT0quajfW9nTW4r5un0XG9CCNTtN4R8PmwZacBLox1bJpMUwjsJBrgyjT4dozw== X-Received: by 2002:a17:906:6bd4:b0:a44:1e32:a503 with SMTP id t20-20020a1709066bd400b00a441e32a503mr7800449ejs.22.1710747914801; Mon, 18 Mar 2024 00:45:14 -0700 (PDT) Received: from Pro.fritz.box (pd9e36faa.dip0.t-ipconnect.de. [217.227.111.170]) by smtp.gmail.com with ESMTPSA id gq5-20020a170906e24500b00a46be5c78f4sm830891ejb.142.2024.03.18.00.45.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Mar 2024 00:45:14 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Stefan Monnier Subject: Re: bug#69864: 30.0.50; Problem with equal hash tables In-Reply-To: (Stefan Monnier's message of "Sun, 17 Mar 2024 16:38:19 -0400") References: Date: Mon, 18 Mar 2024 08:45:12 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 69864 Cc: 69864@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Monnier writes: > Gerd M=C3=B6llmann [2024-03-17 19:56:24] wrote: >> Gerd M=C3=B6llmann writes: >>> (unsigned char *) data =3D 0x00007fb1f8a41978 "cl--generic-build-combin= ed-method" >> Or, and maybe more plausible, someone modifies the hash-table keys used >> in the function above... > > Lessee... > > (defun cl--generic-build-combined-method (generic methods) > (let ((f > (with-memoization > ;; FIXME: Since the fields of `generic' are modified, th= is > ;; hash-table won't work right, because the hashes will = change! > ;; It's not terribly serious, but reduces the effectiven= ess of > ;; the table. Oh, I didn't read that comment, of course :-). Thanks! I guess I'll try to ignore that hash-table somehow in my checks. It seems it's the only one in Emacs making problems. And I think I'll close this report if it's a known problem anyway. From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 18 03:47:52 2024 Received: (at control) by debbugs.gnu.org; 18 Mar 2024 07:47:52 +0000 Received: from localhost ([127.0.0.1]:42642 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rm7iq-0001kb-5O for submit@debbugs.gnu.org; Mon, 18 Mar 2024 03:47:52 -0400 Received: from mail-ej1-f53.google.com ([209.85.218.53]:57383) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rm7io-0001kO-PK for control@debbugs.gnu.org; Mon, 18 Mar 2024 03:47:51 -0400 Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-a46aaf6081fso169949866b.2 for ; Mon, 18 Mar 2024 00:47:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710747966; x=1711352766; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:subject:from:to:message-id :date:from:to:cc:subject:date:message-id:reply-to; bh=X331yR7CMECpBCJlPxgX/qgnaLxwvhAHCX9148T9XxA=; b=jTX1fn17/NHVG9C1g1A19pXFvKKm3czZBAyXL/WyCQIpAK2oyVJjHu3tafz5GNr9l5 7MQF4Yk/2rFOWBhQMjhxUtpmh2zrCHmgOdPSFrXZDXizLxDJ3QevuILLDB5XkQWhC7pC gsq0TWH7Z+6lQKLHfbxW5S5JioYg72EKEh/3g6dSfJeRlTrWiRF6SM3tFN610JDPw5xI jdhez5HbWWoKm2r+KqpnVgVw4JJdud5GMHaEOHm2Ge6JCzQHCIbUsQANDSWWor5TUL7z AsLuqDBQ8Ne2K2qxTq4sGQwDHef2e412oYy0YGVtZGsB1nvRpxuNdIspCEpWaEDfxAQ5 iw7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710747966; x=1711352766; h=content-transfer-encoding:mime-version:subject:from:to:message-id :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=X331yR7CMECpBCJlPxgX/qgnaLxwvhAHCX9148T9XxA=; b=H6NN0xzgYygtRE1i888e4clb1vMR2e+3ZVfZC0SnmhJKf4hu+9HZZl7z4T95/YkU3w 2oPBFGFld84xT4rckyyHvNoHRL8hlBSU+4NMhnLdhcya3EakXGOYu0Fp53+QjBndvwhk v70OkUy/AVOTiL9v+CBk8j6gP1DbvPjdj2nd3bcGc2ekJzskxy0TcIYsl7a80jhabBJt lxK55CnTnKecfdortF2D7QPvJBLbUmZezWiw89db/ZQbvur5Nb5LPt1Yn1fxglejQl5r G9MecrNEun2KJsByCSbX1o0x7Biz/+TsC1HisSpoK9gNyn3b0ymJcb5GnEOQ2f4D6euM GoKA== X-Gm-Message-State: AOJu0Ywjsy6Ad0At+XpXeiMH41WKEcOx73X4CjesK/+MJ+i2gJwPMgpd P+UFwyccBP3by1RO9yDFNtQPQ2TYVQo/xChEYmIrrA3vuZ3zwpGusDEiybeu X-Google-Smtp-Source: AGHT+IF8yAg99b7cGL79UTRNcZW/M2YiyrePzsLWVP5+1MbgEmwMMtBxJbGleGRbGRiuX5xqNryDTQ== X-Received: by 2002:a17:906:7cc2:b0:a44:b9e0:8592 with SMTP id h2-20020a1709067cc200b00a44b9e08592mr7542483ejp.8.1710747966587; Mon, 18 Mar 2024 00:46:06 -0700 (PDT) Received: from Pro.fritz.box (pd9e36faa.dip0.t-ipconnect.de. [217.227.111.170]) by smtp.gmail.com with ESMTPSA id hj11-20020a170906874b00b00a46a04d7daesm2598471ejb.115.2024.03.18.00.46.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Mar 2024 00:46:06 -0700 (PDT) Date: Mon, 18 Mar 2024 08:46:05 +0100 Message-Id: To: control@debbugs.gnu.org From: =?utf-8?Q?Gerd_M=C3=B6llmann?= Subject: control message for bug #69864 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) close 69864 30.1 quit From unknown Sat Jun 21 03:25:10 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 15 Apr 2024 11:27:43 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator