www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11788] New: [x86] Valgrind unhandled instruction bytes: 0xC8 0x8 0x0 0x0

reply d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11788

           Summary: [x86] Valgrind unhandled instruction bytes: 0xC8 0x8
                    0x0 0x0
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: bruno.deligny gmail.com


--- Comment #0 from Bruno Deligny <bruno.deligny gmail.com> 2013-12-21 06:33:22
PST ---
I have this error with valgrind with an very simple 32 bits exe generated with
dmd.

import std.stdio;

int    main()
{
    writeln("Hello world");
    return 0;
}

dmd -g main.d


==7091== Memcheck, a memory error detector
==7091== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==7091== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==7091== Command: ./main
==7091== 
vex x86->IR: unhandled instruction bytes: 0xC8 0x8 0x0 0x0
==7091== valgrind: Unrecognised instruction at address 0x8069b54.
==7091==    at 0x8069B54: ??? (in /home/bruno/main)
==7091== Your program just tried to execute an instruction that Valgrind
==7091== did not recognise.  There are two possible reasons for this.
==7091== 1. Your program has a bug and erroneously jumped to a non-code
==7091==    location.  If you are running Memcheck and you just saw a
==7091==    warning about a bad jump, it's probably your program's fault.
==7091== 2. The instruction is legitimate but Valgrind doesn't handle it,
==7091==    i.e. it's Valgrind's fault.  If you think this is the case or
==7091==    you are not sure, please let us know and we'll try to fix it.
==7091== Either way, Valgrind will now raise a SIGILL signal which will
==7091== probably kill your program.
==7091== 
==7091== Process terminating with default action of signal 4 (SIGILL)
==7091==  Illegal opcode at address 0x8069B54
==7091==    at 0x8069B54: ??? (in /home/bruno/main)
==7091== 
==7091== HEAP SUMMARY:
==7091==     in use at exit: 0 bytes in 0 blocks
==7091==   total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==7091== 
==7091== All heap blocks were freed -- no leaks are possible
==7091== 
==7091== For counts of detected and suppressed errors, rerun with: -v
==7091== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Instruction non permise

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 21 2013
next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11788


Maxim Fomin <maxim maxim-fomin.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |maxim maxim-fomin.ru


--- Comment #1 from Maxim Fomin <maxim maxim-fomin.ru> 2013-12-21 06:40:16 PST
---
This belongs to valgrind bugzilla.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 21 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11788



--- Comment #2 from Bruno Deligny <bruno.deligny gmail.com> 2013-12-21 09:19:48
PST ---
I know but it's already reported on valgrind bugtracker since a while:
https://bugs.kde.org/show_bug.cgi?id=272971
https://bugs.kde.org/show_bug.cgi?id=253433
https://bugs.kde.org/show_bug.cgi?id=317208
I tried with last Valgrind release and with Valgrind svn code.


Nobody seams to care because nobody uses this instruction (enter).

From Intel's Optimisation Reference Manual:
"Assembler/Compiler Coding Rule 40. (ML impact, M generality) Avoid using
complex instructions (for example, enter, leave, or loop) that have more than 4
uops and require multiple cycles to decode. Use sequences of simple
instructions instead.

Complex instructions may save architectural registers, but incur a penalty of 4
uops to set up parameters for the microcode ROM."


Maybe it would be wise for dmd to be more "standard" (do like gcc or llvm)
because good tool support is extremely important and Valgrind is a leader in
that domain.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 21 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11788



--- Comment #3 from Maxim Fomin <maxim maxim-fomin.ru> 2013-12-21 10:49:34 PST
---
I see. But AFAIK Walter is reluctant to change it. This is enhancement request
at best.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 21 2013
prev sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11788


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |yebblies gmail.com
         AssignedTo|nobody puremagic.com        |yebblies gmail.com


--- Comment #4 from yebblies <yebblies gmail.com> 2013-12-22 15:52:31 EST ---
IMO the optimization manual quote seals it.  I'll put it on my to-do list.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 21 2013