Bug 126256 - (fnop) vex x86->IR: unhandled instruction bytes: 0xD9 0xD0 0x31 0xC0
Summary: (fnop) vex x86->IR: unhandled instruction bytes: 0xD9 0xD0 0x31 0xC0
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: vex (other bugs)
Version First Reported In: 3.2 SVN
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
: 253446 (view as bug list)
Depends on:
Blocks: 256630
  Show dependency treegraph
 
Reported: 2006-04-25 23:41 UTC by Thomas Kühne
Modified: 2026-01-17 16:59 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Add support for fnop instruction on x86 and amd64 (3.01 KB, patch)
2026-01-15 18:41 UTC, Mark
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Kühne 2006-04-25 23:41:44 UTC
3:   e8 fc ff ff ff          call   4 <_Dmain+0x4>
   8:   d9 d0                   fnop   
   a:   5d                      pop    ebp

(http://dstress.kuehne.cn/run/a/asm_fnop_01.d)
Comment 1 Mark 2026-01-15 18:40:23 UTC
I have a similar case that I reported on the users list together with a proposed fix (see https://sourceforge.net/p/valgrind/mailman/message/59283753/). The attached patch has a test for reproducing the issue and a fix for x86 and amd64 (that should also address bug 253446).
Comment 2 Mark 2026-01-15 18:41:36 UTC
Created attachment 188561 [details]
Add support for fnop instruction on x86 and amd64
Comment 3 Mark Wielaard 2026-01-16 12:08:00 UTC
*** Bug 253446 has been marked as a duplicate of this bug. ***
Comment 4 Mark Wielaard 2026-01-16 12:11:26 UTC
(In reply to Mark from comment #2)
> Created attachment 188561 [details]
> Add support for fnop instruction on x86 and amd64

Thanks, this looks good. Apologies this was never "implemented".
At first I was afraid this needed some subtle floating point exception signaling.
Which technically it does, but that is currently a known limitation according to the TODO
at the top of the file
- x87 FP Limitations:
  * no FP exceptions, except for handling stack over/underflow

So this seems good to go, thanks for the testcases.
Comment 5 Mark Wielaard 2026-01-17 16:59:09 UTC
commit a615e4daebe2b7289beb66019493285cfc58c2bc
Author: Mark <mark@zbuffer.de>
Date:   Sat Jan 17 17:22:59 2026 +0100

    Add support for fnop instruction on x86 and amd64
    
    This implements FNOP in guest_amd64_toIR.c and guest_x86_toIR.c by
    simply skipping the instruction. Which is OK for now since one of the
    x87 FP Limitations is no FP exceptions, except for handling stack
    over/underflow.
    
    Add fnop to none/tests/{amd64,x86}/insn_fpu.{def,stdout.exp}.
    
    Also update old 3_1_BUGSTATUS.txt to correct bug number.
    
    https://bugs.kde.org/show_bug.cgi?id=126256