Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: ‘__chash’ may be used uninitialized when building on Fedora 39/gcc 13.2.1 #13

Open
alext-w opened this issue May 12, 2024 · 0 comments
Labels
needs-triage Needs triage to confirm and define the category

Comments

@alext-w
Copy link
Contributor

alext-w commented May 12, 2024

I haven't tested this on other OS/gcc versions, so the fact it has to do with gcc version is only a guess at this point that needs additional investigation. I don't remember seeing this on Fedora 38 though (don't recall the gcc version there, but can clarify if needed).

Full build log is attached at the end of this record, but the essence is:

inlined from ‘void Image(LEVEL_CORE::IMG, void*)’ at CECTraceTool.cpp:224:20:
/home/user/dev/pin_cec/pin-3.30-98830-g1d7b601b3-gcc-linux/extras/cxx/include/memory:1872:26: error: ‘__chash’ may be used uninitialized [-Werror=maybe-uninitialized]
 1872 |     return __ptr_.first()[__i];
      |            ~~~~~~~~~~~~~~^
In file included from /home/user/dev/pin_cec/pin-3.30-98830-g1d7b601b3-gcc-linux/extras/cxx/include/unordered_map:435,
                 from CECTraceTool.cpp:13:
/home/user/dev/pin_cec/pin-3.30-98830-g1d7b601b3-gcc-linux/extras/cxx/include/__hash_table: In function ‘void Image(LEVEL_CORE::IMG, void*)’:
/home/user/dev/pin_cec/pin-3.30-98830-g1d7b601b3-gcc-linux/extras/cxx/include/__hash_table:2076:12: note: ‘__chash’ was declared here
 2076 |     size_t __chash;
      |            ^~~~~~~
cc1plus: all warnings being treated as errors

A simple workaround to make it build is to use the "ignore" GCC pragma before the line in question. It of course is not a solution but just to illustrate the way to make it build again for debugging purposes.

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
  gImageMap->insert(std::make_pair(imgName, (uint64_t)IMG_LoadOffset(img)));
#pragma GCC diagnostic pop

Full build log:
maybe-uninitialized-err.txt

@alext-w alext-w added the needs-triage Needs triage to confirm and define the category label Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage Needs triage to confirm and define the category
Projects
None yet
Development

No branches or pull requests

1 participant