This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug plugins/80094] GCC plugin hash table corruption on hash table expansion (>10 plugins) on GCC 4.5+
- From: "git at lerya dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 18 Mar 2017 20:07:18 +0000
- Subject: [Bug plugins/80094] GCC plugin hash table corruption on hash table expansion (>10 plugins) on GCC 4.5+
- Auto-submitted: auto-generated
- References: <bug-80094-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80094
--- Comment #1 from Vincent Brillault <git at lerya dot net> ---
I've added a patch on the gist
(https://gist.github.com/Feandil/55c104a4e9f5e6c72ce610b152ce37c3#file-gcc-debug-reproducer-patch)
that instrument plugin.c to show the hash map content.
Running the reproducer with a patched gcc should produce something similar to:
```
[...]
Testing known plugins Before insertion
1(basic_plugin_1): 0x169a6e0 (basic_plugin_1)
2(basic_plugin_2): 0x169a6e8 (basic_plugin_2)
3(basic_plugin_3): 0x169a6f0 (basic_plugin_3)
4(basic_plugin_4): 0x169a6f8 (basic_plugin_4)
5(basic_plugin_5): 0x169a700 (basic_plugin_5)
6(basic_plugin_6): 0x169a708 (basic_plugin_6)
7(basic_plugin_7): 0x169a710 (basic_plugin_7)
8(basic_plugin_8): 0x169a6b0 (basic_plugin_8)
9(basic_plugin_9): 0x169a6b8 (basic_plugin_9)
10(basic_plugin_10): 0x169a6c0 (basic_plugin_10)
11(basic_plugin_11): (nil)
Inserting basic_plugin_11
Testing known plugins After insertion
1(basic_plugin_1): (nil)
2(basic_plugin_2): (nil)
3(basic_plugin_3): (nil)
4(basic_plugin_4): (nil)
5(basic_plugin_5): (nil)
6(basic_plugin_6): (nil)
7(basic_plugin_7): (nil)
8(basic_plugin_8): (nil)
9(basic_plugin_9): (nil)
10(basic_plugin_10): (nil)
11(basic_plugin_11): 0x16a8048 (basic_plugin_11)
cc1: error: plugin basic_plugin_1 should be specified before
-fplugin-arg-basic_plugin_1-enable in the command line
(null):0: confused by earlier errors, bailing out
make: *** [Makefile:12: test] Error 1
```
Please note that depending on your system and your luck, you might actually be
able to have collisions in the hash...