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

uninitialized variables - undefined behavior - exposed with GCC 8 #8

Open
pranavk opened this issue Nov 12, 2018 · 1 comment
Open

Comments

@pranavk
Copy link

pranavk commented Nov 12, 2018

The default configuration file (cache.cfg) when given as input to the cacti program compiled with GCC 8 crashes. Upon inspection, I found out that there are some uninitialized variables in InputParameter class; so, I fixed them like following.

diff --git a/io.cc b/io.cc
index 3a798aa..2983dfa 100644
--- a/io.cc
+++ b/io.cc
@@ -63,7 +63,10 @@ InputParameter::InputParameter()
  cl_power_gated(false),
  interconect_power_gated(false),
  power_gating(false),
- cl_vertical (true)
+ cl_vertical (true),
+ dram_ecc(NO_ECC),
+ io_type(DDR3),
+ dram_dimm(UDIMM)

This solves my assertion failures I was encountering earlier. However, the output with the default cache.cfg is still unexpected and different than what you would get if you compile it with older GCC versions like 4.8.

@pranavk pranavk changed the title assertion failures when compiled with GCC 8 uninitialized variables - undefined behavior - exposed with GCC 8 Nov 15, 2018
@pranavk
Copy link
Author

pranavk commented Nov 19, 2018

There are likely other uninitialized variables lying around; I found one more: num_se_rd_ports in InputParameter class doesn't get initialized when invoked with default cache.cfg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant