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

Segmentation fault on Clear Linux #24

Open
bkdwt opened this issue Oct 5, 2019 · 0 comments
Open

Segmentation fault on Clear Linux #24

bkdwt opened this issue Oct 5, 2019 · 0 comments

Comments

@bkdwt
Copy link

bkdwt commented Oct 5, 2019

Hi. I'll trying to run i7z, but I get this error:

botnet@nsa~/i7z $ make -j8
rm -f .o i7z
gcc -g -O3 -feliminate-unused-debug-types -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=32 -Wformat -Wformat-security -m64 -fasynchronous-unwind-tables -Wp,-D_REENTRANT -ftree-loop-distribute-patterns -Wl,-z -Wl,now -Wl,-z -Wl,relro -fno-semantic-interposition -ffat-lto-objects -fno-trapping-math -Wl,-sort-common -Wl,--enable-new-dtags -mtune=skylake -fno-schedule-insns2 -fno-schedule-insns -fno-inline-small-functions -fno-caller-saves -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DBUILD_MAIN -Wimplicit-function-declaration -Dx64_BIT -c -o i7z.o i7z.c
gcc -g -O3 -feliminate-unused-debug-types -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=32 -Wformat -Wformat-security -m64 -fasynchronous-unwind-tables -Wp,-D_REENTRANT -ftree-loop-distribute-patterns -Wl,-z -Wl,now -Wl,-z -Wl,relro -fno-semantic-interposition -ffat-lto-objects -fno-trapping-math -Wl,-sort-common -Wl,--enable-new-dtags -mtune=skylake -fno-schedule-insns2 -fno-schedule-insns -fno-inline-small-functions -fno-caller-saves -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DBUILD_MAIN -Wimplicit-function-declaration -Dx64_BIT -c -o helper_functions.o helper_functions.c
gcc -g -O3 -feliminate-unused-debug-types -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=32 -Wformat -Wformat-security -m64 -fasynchronous-unwind-tables -Wp,-D_REENTRANT -ftree-loop-distribute-patterns -Wl,-z -Wl,now -Wl,-z -Wl,relro -fno-semantic-interposition -ffat-lto-objects -fno-trapping-math -Wl,-sort-common -Wl,--enable-new-dtags -mtune=skylake -fno-schedule-insns2 -fno-schedule-insns -fno-inline-small-functions -fno-caller-saves -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DBUILD_MAIN -Wimplicit-function-declaration -Dx64_BIT -c -o i7z_Single_Socket.o i7z_Single_Socket.c
gcc -g -O3 -feliminate-unused-debug-types -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=32 -Wformat -Wformat-security -m64 -fasynchronous-unwind-tables -Wp,-D_REENTRANT -ftree-loop-distribute-patterns -Wl,-z -Wl,now -Wl,-z -Wl,relro -fno-semantic-interposition -ffat-lto-objects -fno-trapping-math -Wl,-sort-common -Wl,--enable-new-dtags -mtune=skylake -fno-schedule-insns2 -fno-schedule-insns -fno-inline-small-functions -fno-caller-saves -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DBUILD_MAIN -Wimplicit-function-declaration -Dx64_BIT -c -o i7z_Dual_Socket.o i7z_Dual_Socket.c
If the compilation complains about not finding ncurses.h, install ncurses (libncurses5-dev on ubuntu/debian)
i7z.c: In function ‘logCpuFreq_single_ts’:
i7z.c:187:36: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘__time_t’ {aka ‘long int’} [-Wformat=]
187 | fprintf(fp_log_file_freq,"%d.%.9d\n",value->tv_sec,value->tv_nsec); //newline, replace \n with \t to get everything separated with tabs
| ~^ ~~~~~~~~~~~~~
| | |
| int __time_t {aka long int}
| %ld
i7z.c:187:41: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘__syscall_slong_t’ {aka ‘long int’} [-Wformat=]
187 | fprintf(fp_log_file_freq,"%d.%.9d\n",value->tv_sec,value->tv_nsec); //newline, replace \n with \t to get everything separated with tabs
| ~~~^ ~~~~~~~~~~~~~~
| | |
| int __syscall_slong_t {aka long int}
| %.9ld
i7z.c:191:36: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘__time_t’ {aka ‘long int’} [-Wformat=]
191 | fprintf(fp_log_file_freq,"%d.%.9d\t",value->tv_sec,value->tv_nsec);
| ~^ ~~~~~~~~~~~~~
| | |
| int __time_t {aka long int}
| %ld
i7z.c:191:41: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘__syscall_slong_t’ {aka ‘long int’} [-Wformat=]
191 | fprintf(fp_log_file_freq,"%d.%.9d\t",value->tv_sec,value->tv_nsec);
| ~~~^ ~~~~~~~~~~~~~~
| | |
| int __syscall_slong_t {aka long int}
| %.9ld
i7z.c: In function ‘logCpuFreq_dual_ts’:
i7z.c:267:42: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘__time_t’ {aka ‘long int’} [-Wformat=]
267 | fprintf(fp_log_file_freq_1,"%d.%.9d\n",value->tv_sec,value->tv_nsec); //newline, replace \n with \t to get everything separated with tabs
| ~^ ~~~~~~~~~~~~~
| | |
| int __time_t {aka long int}
| %ld
i7z.c:267:47: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘__syscall_slong_t’ {aka ‘long int’} [-Wformat=]
267 | fprintf(fp_log_file_freq_1,"%d.%.9d\n",value->tv_sec,value->tv_nsec); //newline, replace \n with \t to get everything separated with tabs
| ~~~^ ~~~~~~~~~~~~~~
| | |
| int __syscall_slong_t {aka long int}
| %.9ld
i7z.c:271:43: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘__time_t’ {aka ‘long int’} [-Wformat=]
271 | fprintf(fp_log_file_freq_1,"%d.%.9d\t",value->tv_sec,value->tv_nsec);
| ~^ ~~~~~~~~~~~~~
| | |
| int __time_t {aka long int}
| %ld
i7z.c:271:48: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘__syscall_slong_t’ {aka ‘long int’} [-Wformat=]
271 | fprintf(fp_log_file_freq_1,"%d.%.9d\t",value->tv_sec,value->tv_nsec);
| ~~~^ ~~~~~~~~~~~~~~
| | |
| int __syscall_slong_t {aka long int}
| %.9ld
i7z.c:276:42: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘__time_t’ {aka ‘long int’} [-Wformat=]
276 | fprintf(fp_log_file_freq_2,"%d.%.9d\n",value->tv_sec,value->tv_nsec); //newline, replace \n with \t to get everything separated with tabs
| ~^ ~~~~~~~~~~~~~
| | |
| int __time_t {aka long int}
| %ld
i7z.c:276:47: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘__syscall_slong_t’ {aka ‘long int’} [-Wformat=]
276 | fprintf(fp_log_file_freq_2,"%d.%.9d\n",value->tv_sec,value->tv_nsec); //newline, replace \n with \t to get everything separated with tabs
| ~~~^ ~~~~~~~~~~~~~~
| | |
| int __syscall_slong_t {aka long int}
| %.9ld
i7z.c:280:43: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘__time_t’ {aka ‘long int’} [-Wformat=]
280 | fprintf(fp_log_file_freq_2,"%d.%.9d\t",value->tv_sec,value->tv_nsec);
| ~^ ~~~~~~~~~~~~~
| | |
| int __time_t {aka long int}
| %ld
i7z.c:280:48: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘__syscall_slong_t’ {aka ‘long int’} [-Wformat=]
280 | fprintf(fp_log_file_freq_2,"%d.%.9d\t",value->tv_sec,value->tv_nsec);
| ~~~^ ~~~~~~~~~~~~~~
| | |
| int __syscall_slong_t {aka long int}
| %.9ld
i7z.c: In function ‘logCpuCstates_single_ts’:
i7z.c:318:39: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘__time_t’ {aka ‘long int’} [-Wformat=]
318 | fprintf(fp_log_file_Cstates,"%d.%.9d",value->tv_sec,value->tv_nsec); //newline, replace \n with \t to get everything separated with tabs
| ~^ ~~~~~~~~~~~~~
| | |
| int __time_t {aka long int}
| %ld
i7z.c:318:44: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘__syscall_slong_t’ {aka ‘long int’} [-Wformat=]
318 | fprintf(fp_log_file_Cstates,"%d.%.9d",value->tv_sec,value->tv_nsec); //newline, replace \n with \t to get everything separated with tabs
| ~~~^ ~~~~~~~~~~~~~~
| | |
| int __syscall_slong_t {aka long int}
| %.9ld
i7z.c: In function ‘logCpuCstates_dual_ts’:
i7z.c:369:45: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘__time_t’ {aka ‘long int’} [-Wformat=]
369 | fprintf(fp_log_file_Cstates_1,"%d.%.9d",value->tv_sec,value->tv_nsec); //newline, replace \n with \t to get everything separated with tabs
| ~^ ~~~~~~~~~~~~~
| | |
| int __time_t {aka long int}
| %ld
i7z.c:369:50: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘__syscall_slong_t’ {aka ‘long int’} [-Wformat=]
369 | fprintf(fp_log_file_Cstates_1,"%d.%.9d",value->tv_sec,value->tv_nsec); //newline, replace \n with \t to get everything separated with tabs
| ~~~^ ~~~~~~~~~~~~~~
| | |
| int __syscall_slong_t {aka long int}
| %.9ld
i7z.c:374:45: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘__time_t’ {aka ‘long int’} [-Wformat=]
374 | fprintf(fp_log_file_Cstates_2,"%d.%.9d",value->tv_sec,value->tv_nsec); //newline, replace \n with \t to get everything separated with tabs
| ~^ ~~~~~~~~~~~~~
| | |
| int __time_t {aka long int}
| %ld
i7z.c:374:50: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘__syscall_slong_t’ {aka ‘long int’} [-Wformat=]
374 | fprintf(fp_log_file_Cstates_2,"%d.%.9d",value->tv_sec,value->tv_nsec); //newline, replace \n with \t to get everything separated with tabs
| ~~~^ ~~~~~~~~~~~~~~
| | |
| int __syscall_slong_t {aka long int}
| %.9ld
i7z.c: In function ‘atexit_runsttysane’:
i7z.c:384:5: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result [-Wunused-result]
384 | system("stty sane");
| ^~~~~~~~~~~~~~~~~~~
i7z.c: In function ‘modprobing_msr’:
i7z.c:389:5: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result [-Wunused-result]
389 | system("modprobe msr");
| ^~~~~~~~~~~~~~~~~~~~~~
i7z_Dual_Socket.c: In function ‘print_i7z_socket’:
i7z_Dual_Socket.c:189:13: warning: variable ‘IA32_FIXED_CTR_CTL_Value’ set but not used [-Wunused-but-set-variable]
189 | int IA32_FIXED_CTR_CTL_Value = get_msr_value (CPU_NUM, IA32_FIXED_CTR_CTL, 63, 0, &error_indx);
| ^~~~~~~~~~~~~~~~~~~~~~~~
i7z_Dual_Socket.c:184:13: warning: variable ‘IA32_PERF_GLOBAL_CTRL_Value’ set but not used [-Wunused-but-set-variable]
184 | int IA32_PERF_GLOBAL_CTRL_Value = get_msr_value (CPU_NUM, IA32_PERF_GLOBAL_CTRL, 63, 0, &error_indx);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
i7z_Dual_Socket.c: In function ‘print_i7z’:
i7z_Dual_Socket.c:708:9: warning: variable ‘HT_ON’ set but not used [-Wunused-but-set-variable]
708 | int HT_ON;
| ^~~~~
i7z_Dual_Socket.c:664:9: warning: unused variable ‘i’ [-Wunused-variable]
664 | int i;
| ^
i7z_Single_Socket.c: In function ‘print_i7z_socket_single’:
i7z_Single_Socket.c:213:13: warning: variable ‘IA32_FIXED_CTR_CTL_Value’ set but not used [-Wunused-but-set-variable]
213 | int IA32_FIXED_CTR_CTL_Value;
| ^~~~~~~~~~~~~~~~~~~~~~~~
i7z_Single_Socket.c:207:13: warning: variable ‘IA32_PERF_GLOBAL_CTRL_Value’ set but not used [-Wunused-but-set-variable]
207 | int IA32_PERF_GLOBAL_CTRL_Value;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
i7z_Single_Socket.c: In function ‘print_i7z_single’:
i7z_Single_Socket.c:716:9: warning: variable ‘HT_ON’ set but not used [-Wunused-but-set-variable]
716 | int HT_ON;
| ^~~~~
i7z_Single_Socket.c:665:9: warning: unused variable ‘i’ [-Wunused-variable]
665 | int i;
| ^
helper_functions.c: In function ‘print_socket_information’:
helper_functions.c:683:21: warning: passing argument 1 to restrict-qualified parameter aliases with argument 3 [-Wrestrict]
683 | sprintf(socket_list,"%s%d,",socket_list,socket->processor_num[i]);
| ^~~~~~~~~~~ ~~~~~~~~~~~
helper_functions.c: In function ‘Test_Or_Make_MSR_DEVICE_FILES’:
helper_functions.c:527:13: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result [-Wunused-result]
527 | system ("msr_major=202;
| ^~~~~~~~~~~~~~~~~~~~~~~~~
528 | cpuid_major=203;
| ~~~~~~~~~~~~~~~~~~
529 | n=0;
| ~~~~~~
530 | while [ $n -lt 16 ]; do
| ~~~~~~~~~~~~~~~~~~~~~~~~~
531 | mkdir -m 0755 -p /dev/cpu/$n;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
532 | mknod /dev/cpu/$n/msr -m 0600 c $msr_major $n;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
533 | mknod /dev/cpu/$n/cpuid -m 0444 c $cpuid_major $n;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
534 | n=expr $n + 1;
| ~~~~~~~~~~~~~~~~~~
535 | done;
| ~~~~~~~
536 | ");
| ~~
helper_functions.c:538:13: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result [-Wunused-result]
538 | system ("modprobe msr");
| ^~~~~~~~~~~~~~~~~~~~~~~
helper_functions.c: In function ‘cpufreq_info’:
helper_functions.c:551:5: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result [-Wunused-result]
551 | system
| ^~~~~~
552 | ("cat /proc/cpuinfo |grep MHz|sed 's/cpu\sMHz\s
:\s//'|tail -n 1 > /tmp/cpufreq.txt");
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
helper_functions.c:559:5: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]
559 | fgets (tmp_str, 30, tmp_file);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
helper_functions.c: In function ‘print_socket_information’:
helper_functions.c:683:38: warning: ‘,’ directive writing 1 byte into a region of size between 0 and 199 [-Wformat-overflow=]
683 | sprintf(socket_list,"%s%d,",socket_list,socket->processor_num[i]);
| ^
In file included from /usr/include/stdio.h:867,
from helper_functions.c:25:
/usr/include/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 3 and 212 bytes into a destination of size 200
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc -g -O3 -feliminate-unused-debug-types -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=32 -Wformat -Wformat-security -m64 -fasynchronous-unwind-tables -Wp,-D_REENTRANT -ftree-loop-distribute-patterns -Wl,-z -Wl,now -Wl,-z -Wl,relro -fno-semantic-interposition -ffat-lto-objects -fno-trapping-math -Wl,-sort-common -Wl,--enable-new-dtags -mtune=skylake -fno-schedule-insns2 -fno-schedule-insns -fno-inline-small-functions -fno-caller-saves -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DBUILD_MAIN -Wimplicit-function-declaration -Dx64_BIT -o i7z i7z.o helper_functions.o i7z_Single_Socket.o i7z_Dual_Socket.o -lncurses -lpthread -lrt -lm
Succeeded, now run sudo ./i7z
botnet@nsa~/i7z $ sudo ./i7z
i7z DEBUG: i7z version: svn-r93-(27-MAY-2013)
i7z DEBUG: Found Intel Processor
i7z DEBUG: Stepping 3
i7z DEBUG: Model c
i7z DEBUG: Family 6
i7z DEBUG: Processor Type 0
i7z DEBUG: Extended Model 3
i7z DEBUG: msr = Model Specific Register
i7z DEBUG: Detected an i7 - 22nm (haswell)
Segmentation fault

Any ideas? Thanks in advance!

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