Bug 21166 - FAIL: gdb.reverse/insn-reverse.exp: rdseed: x/i $pc
Summary: FAIL: gdb.reverse/insn-reverse.exp: rdseed: x/i $pc
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: gdb (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: ---
Assignee: Luis Machado
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-15 15:29 UTC by Pedro Alves
Modified: 2017-02-23 20:46 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pedro Alves 2017-02-15 15:29:17 UTC
On current master, on x86-64 Fedora 23, I'm seeing this:

+FAIL: gdb.reverse/insn-reverse.exp: rdseed: x/i $pc 
+FAIL: gdb.reverse/insn-reverse.exp: rdseed: x/i $pc 
+FAIL: gdb.reverse/insn-reverse.exp: rdseed: x/i $pc 
+FAIL: gdb.reverse/insn-reverse.exp: rdseed: x/i $pc 
+FAIL: gdb.reverse/insn-reverse.exp: rdseed: x/i $pc 
[... many more of the same ... ]
+FAIL: gdb.reverse/insn-reverse.exp: rdseed: compare registers on insn 0:mov    0x2008b7(%rip),%eax        # 0x601058 <supports_rdrand> 
+FAIL: gdb.reverse/insn-reverse.exp: rdseed: compare registers on insn 1:test   %eax,%eax 
+FAIL: gdb.reverse/insn-reverse.exp: rdseed: compare registers on insn 2:je     0x4008b3 <rdseed+284> 
+FAIL: gdb.reverse/insn-reverse.exp: rdseed: compare registers on insn 3:rdseed %ax 
+FAIL: gdb.reverse/insn-reverse.exp: rdseed: compare registers on insn 4:rdseed %ax 
+ERROR: tcl error sourcing /home/pedro/gdb/mygit/src/gdb/testsuite/gdb.reverse/insn-reverse.exp. 
+ERROR: can't read "insn_array(5)": no such element in array 
+    while executing
+"gdb_assert { [string compare $pre_regs($i) $post_regs($i)] == 0 }  "compare registers on insn $i:$insn_array($i)""
+    ("uplevel" body line 47)
+    invoked from within
+"uplevel 1 $body"
+    invoked from within
+"with_test_prefix "$func" {
+       gdb_breakpoint $func
+       gdb_test "continue"
+       set last_insn ""
+       set test "disassemble $func"
+       gdb_test_multiple $test $test ..."
+    (procedure "test" line 5)
+    invoked from within
+"test $testcase"
+    (file "/home/pedro/gdb/mygit/src/gdb/testsuite/gdb.reverse/insn-reverse.exp" line 128)
+    invoked from within
+"source /home/pedro/gdb/mygit/src/gdb/testsuite/gdb.reverse/insn-reverse.exp"
+    ("uplevel" body line 1)
+    invoked from within
+"uplevel #0 source /home/pedro/gdb/mygit/src/gdb/testsuite/gdb.reverse/insn-reverse.exp"
+    invoked from within
+"catch "uplevel #0 source $test_file_name""
 src/gdb/testsuite/gdb.reverse/machinestate.exp ...
Comment 1 Pedro Alves 2017-02-15 15:29:58 UTC
gdb.log shows:

(gdb) si

Program received signal SIGILL, Illegal instruction.
rdseed () at /home/pedro/gdb/mygit/src/gdb/testsuite/gdb.reverse/insn-reverse-x86.c:154
154       __asm__ volatile ("rdseed %%ax;" : "=r" (seed));
Comment 2 Pedro Alves 2017-02-15 15:30:45 UTC
$ cat /proc/cpuinfo 
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 60
model name      : Intel(R) Core(TM) i7-4810MQ CPU @ 2.80GHz
stepping        : 3
microcode       : 0x20
cpu MHz         : 3645.776
cache size      : 6144 KB
physical id     : 0
siblings        : 8
core id         : 0
cpu cores       : 4
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm epb tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dtherm ida arat pln pts
bugs            :
bogomips        : 5586.97
clflush size    : 64
cache_alignment : 64
address sizes   : 39 bits physical, 48 bits virtual
power management:
[....]
Comment 3 Luis Machado 2017-02-23 17:21:55 UTC
Odd. So this is getting past the feature test even though it doesn't support rdseed.

Is rdrand supported just fine?
Comment 4 Luis Machado 2017-02-23 17:25:16 UTC
Ah, that particular processor doesn't support rdseed, that's why.

Mine does:

processor	: 3
vendor_id	: GenuineIntel
cpu family	: 6
model		: 78
model name	: Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz
stepping	: 3
microcode	: 0x74
cpu MHz		: 1094.843
cache size	: 4096 KB
physical id	: 0
siblings	: 4
core id		: 1
cpu cores	: 2
apicid		: 3
initial apicid	: 3
fpu		: yes
fpu_exception	: yes
cpuid level	: 22
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch epb intel_pt tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt xsaveopt xsavec xgetbv1 dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp
bugs		:
bogomips	: 5615.80
clflush size	: 64
cache_alignment	: 64
address sizes	: 39 bits physical, 48 bits virtual
power management:


I guess i'll need a different mechanism to test rdrand and rdseed support separately.
Comment 5 Luis Machado 2017-02-23 19:31:11 UTC
Proposed fix sent to the mailing list.
Comment 6 Luis Machado 2017-02-23 20:46:28 UTC
Fix pushed as c26db3b33b7274946e42c6656ee1c0911cefb865