From: "Martin Liška" <mliska@suse.cz>
To: Trevor Saunders <tbsaunde@tbsaunde.org>
Cc: gcc-patches@gcc.gnu.org, Nathan Sidwell <nathan@acm.org>,
Jason Merrill <jason@redhat.com>,
Jakub Jelinek <jakub@redhat.com>,
Paul Richard Thomas <paul.richard.thomas@gmail.com>,
Martin Jambor <mjambor@suse.cz>
Subject: Re: hash-table violation in gcc/fortran/trans-decl.c
Date: Wed, 31 Oct 2018 10:18:00 -0000 [thread overview]
Message-ID: <9e9480b0-26ed-5bef-5d46-b0bd85c99c1a@suse.cz> (raw)
In-Reply-To: <20181031094007.GB19800@chair>
On 10/31/18 10:40 AM, Trevor Saunders wrote:
> On Tue, Oct 30, 2018 at 11:07:16AM +0100, Martin Li??ka wrote:
>> On 10/29/18 12:04 PM, Martin Li??ka wrote:
>>> 2) gfc_find_module
>>>
>>> $ ./xgcc -B. /home/marxin/Programming/gcc/gcc/testsuite/gfortran.dg/coarray/alloc_comp_2.f90 -fcoarray=single -fchecking=3
>>> hash table checking failed: equal operator returns true for a pair of values with a different hash valuef951: internal compiler error: in find_slot_with_hash, at hash-table.h:905
>>> 0x8e5e86 hash_table<module_hasher, xcallocator>::find_slot_with_hash(char const* const&, unsigned int, insert_option)
>>> /home/marxin/Programming/gcc/gcc/hash-table.h:905
>>> 0x8e2c2c gfc_find_module(char const*)
>>> /home/marxin/Programming/gcc/gcc/fortran/trans-decl.c:4865
>>> 0x8e4f42 gfc_generate_module_vars(gfc_namespace*)
>>> /home/marxin/Programming/gcc/gcc/fortran/trans-decl.c:5475
>>> 0x8b8d7e gfc_generate_module_code(gfc_namespace*)
>>> /home/marxin/Programming/gcc/gcc/fortran/trans.c:2190
>>> 0x868427 translate_all_program_units
>>> /home/marxin/Programming/gcc/gcc/fortran/parse.c:6112
>>> 0x868427 gfc_parse_file()
>>> /home/marxin/Programming/gcc/gcc/fortran/parse.c:6328
>>> 0x8b19cb gfc_be_parse_file
>>> /home/marxin/Programming/gcc/gcc/fortran/f95-lang.c:204
>>
>> This one is real issue introduced in r216127, I'll post it to corresponding mailing list
>> after testing:
>
> Yeah, sorry and lgtm. I wonder if we could make htab_hash_string take a
> const char * to catch this sooner?
That happens.
Exactly my thoughts! The issue is that old C-style htab in libiberty expects
void *, so I can come up with a specific const char * specialization that
we can leverage in gcc internally (read with C++).
Martin
>
> Trev
>
>>
>> diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
>> index 88f9f570725..e8da9e11d22 100644
>> --- a/gcc/fortran/trans-decl.c
>> +++ b/gcc/fortran/trans-decl.c
>> @@ -4825,7 +4825,7 @@ struct module_hasher : ggc_ptr_hash<module_htab_entry>
>> {
>> typedef const char *compare_type;
>>
>> - static hashval_t hash (module_htab_entry *s) { return htab_hash_string (s); }
>> + static hashval_t hash (module_htab_entry *s) { return htab_hash_string (s->name); }
>> static bool
>> equal (module_htab_entry *a, const char *b)
>> {
>>
>> Martin
next prev parent reply other threads:[~2018-10-31 9:57 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-29 12:02 [PATCH][RFC] Sanitize equals and hash functions in hash-tables Martin Liška
2018-10-29 14:28 ` Alexander Monakov
2018-10-29 15:56 ` Martin Liška
2018-10-30 10:32 ` Jakub Jelinek
2018-10-30 14:17 ` Martin Liška
2018-11-07 22:24 ` Jeff Law
2018-11-07 22:44 ` Jakub Jelinek
2018-11-08 8:56 ` Martin Liška
2019-05-13 7:42 ` Martin Liška
2019-05-20 17:26 ` Jason Merrill
2019-05-20 22:07 ` Jeff Law
2019-05-21 9:38 ` Richard Biener
2019-05-21 11:02 ` Martin Liška
2019-05-21 11:52 ` Richard Biener
2019-05-22 9:13 ` Martin Liška
2019-05-31 13:23 ` Richard Biener
2019-05-31 13:35 ` Martin Liška
2019-05-31 22:10 ` Jeff Law
2019-06-03 13:35 ` Martin Liška
2019-06-07 8:57 ` Richard Biener
2019-06-07 12:04 ` Martin Liška
2019-06-07 12:09 ` Richard Biener
2019-06-07 12:13 ` Martin Liška
2019-06-07 14:48 ` Martin Sebor
2019-06-07 21:43 ` Jason Merrill
2019-06-10 7:08 ` Martin Liška
2019-06-10 18:22 ` Jason Merrill
2019-06-11 7:41 ` Martin Liška
2019-06-11 12:28 ` Jason Merrill
2019-06-11 13:16 ` Martin Liška
2019-06-11 19:02 ` Jason Merrill
2019-06-12 7:59 ` Richard Biener
2019-06-12 8:02 ` Martin Liška
2019-06-12 9:15 ` Martin Liška
2019-06-12 9:41 ` Richard Biener
2019-06-12 11:45 ` Martin Liška
2019-06-12 12:50 ` Richard Biener
2019-06-12 13:05 ` Martin Liška
2019-06-23 23:08 ` Ian Lance Taylor
2019-06-24 12:29 ` Richard Biener
2019-06-24 13:51 ` Martin Liška
2019-06-24 14:10 ` Richard Biener
2019-06-25 10:25 ` Martin Liška
2019-06-25 11:59 ` Martin Liška
2019-06-25 14:23 ` Richard Biener
2018-10-30 10:25 ` hash-table violation in cselib.c Martin Liška
2018-11-01 11:57 ` Martin Liška
2018-10-30 10:46 ` hash-table violation in gcc/fortran/trans-decl.c Martin Liška
2018-10-31 10:00 ` Trevor Saunders
2018-10-31 10:18 ` Martin Liška [this message]
2018-10-30 11:07 ` hash-table violation in gcc/cp/pt.c Martin Liška
2018-10-30 11:21 ` Martin Liška
2018-11-01 12:06 ` Martin Liška
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9e9480b0-26ed-5bef-5d46-b0bd85c99c1a@suse.cz \
--to=mliska@suse.cz \
--cc=gcc-patches@gcc.gnu.org \
--cc=jakub@redhat.com \
--cc=jason@redhat.com \
--cc=mjambor@suse.cz \
--cc=nathan@acm.org \
--cc=paul.richard.thomas@gmail.com \
--cc=tbsaunde@tbsaunde.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).