jwmesa412 / i7z

Automatically exported from code.google.com/p/i7z
GNU General Public License v2.0
0 stars 0 forks source link

Segf with 0.27.1 on sandybridge single socket in print_i7z_single() #43

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
0.27 was fine 0.27.1 gives following segf:

Program received signal SIGSEGV, Segmentation fault.                            

0x00000000004053bc in print_i7z_single () at /usr/include/bits/string3.h:121    

121       return __builtin___strncpy_chk (__dest, __src, __len, __bos 
(__dest));                                           
(gdb) bt                                                                        

#0  0x00000000004053bc in print_i7z_single () at 
/usr/include/bits/string3.h:121                                           
#1  0x00000000004057f5 in Single_Socket () at i7z_Single_Socket.c:84            

#2  0x000000000040199c in main (argc=1, argv=<optimized out>) at i7z.c:398      

(gdb)                                                                           

# lscpu                                                                         

Architecture:          x86_64                                                   

CPU op-mode(s):        32-bit, 64-bit                                           

Byte Order:            Little Endian                                            

CPU(s):                8                                                        

On-line CPU(s) list:   0-7                                                      

Thread(s) per core:    2                                                        

Core(s) per socket:    4                                                        

Socket(s):             1                                                        

NUMA node(s):          1                                                        

Vendor ID:             GenuineIntel                                             

CPU family:            6                                                        

Model:                 42                                                       

Stepping:              7                                                        

CPU MHz:               1600.000                                                 

BogoMIPS:              6824.38                                                  

Virtualization:        VT-x                                                     

L1d cache:             32K                                                      

L1i cache:             32K                                                      

L2 cache:              256K                                                     

L3 cache:              8192K                                                    

NUMA node0 CPU(s):     0-7                               

Original issue reported on code.google.com by ju.lec...@googlemail.com on 28 Dec 2011 at 10:24

GoogleCodeExporter commented 8 years ago
This only happens with higher optimizations as -O0.

Original comment by ju.lec...@googlemail.com on 28 Dec 2011 at 10:27

GoogleCodeExporter commented 8 years ago
Hi, thanks for the bug report

so does -O0 give an error or is it for higher optimizations lik -O1 -O2?

i do know that -O1 or greater do have that issue. seems like some assembly code 
gets optimized causing errors.

Original comment by abhirana on 29 Dec 2011 at 12:02

GoogleCodeExporter commented 8 years ago
No, only with -O1/2. -O0 is fine.
On gentoo we like to leave the choice of optimisation to the user. So I removed 
the -O0 and hit the bug. THat is fixed now and i7z is bumped.

Could this problem fixed anyways? Do you need mor debugging?

Original comment by ju.lec...@googlemail.com on 29 Dec 2011 at 8:50

GoogleCodeExporter commented 8 years ago
Hi Ju

i think i found the issue after some trial and error. seems like -O2 and -O3 
uses -fschedule-insns and -insns2 which does some kind of reordering of 
instruction
 http://gcc.gnu.org/onlinedocs/gcc-4.2.3/gcc/Optimize-Options.html

the updated makefile in the svn explicitly disables those optimization (i still 
use -O0 in the makefile but i tested with -O3 and -O2) and it seems to run fine 

if everything works for you then i will bump up a version. 

thanks.

Original comment by abhirana on 30 Dec 2011 at 1:30

GoogleCodeExporter commented 8 years ago
Thanks, this version works perfect with my CFLAGS. Can be closed now.

Original comment by ju.lec...@googlemail.com on 31 Dec 2011 at 10:14

GoogleCodeExporter commented 8 years ago

Original comment by abhirana on 31 Mar 2012 at 8:34