<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>105227</bug_id>
          
          <creation_ts>2005-05-07 06:14:00 +0000</creation_ts>
          <short_desc>(bound) vex: x86-&gt;IR: unhandled instruction bytes: 0x62 0x75 0xF8 0xC7</short_desc>
          <delta_ts>2010-11-11 20:13:00 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>6</classification_id>
          <classification>Developer tools</classification>
          <product>valgrind</product>
          <component>vex</component>
          <version>unspecified</version>
          <rep_platform>openSUSE</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>UNCONFIRMED</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>crash</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>256630</blocked>
          <everconfirmed>0</everconfirmed>
          <reporter name="Geoff Smith">gsmith</reporter>
          <assigned_to name="Julian Seward">jseward</assigned_to>
          <cc>njn</cc>
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>340080</commentid>
    <comment_count>0</comment_count>
    <who name="Geoff Smith">gsmith</who>
    <bug_when>2005-05-07 06:14:00 +0000</bug_when>
    <thetext>Version:            (using KDE KDE 3.3.0)
Installed from:    SuSE RPMs
OS:                Linux

The &quot;BOUND&quot; (x86) instruction is not implemented.  The IBM Rational Ada compiler uses this instruction (albeit rarely) for bounds checking.

valgrind --version :  valgrind-2.4.0
uname -a           :  Linux alpo 2.4.21-27.0.1ELcustom #2</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>340740</commentid>
    <comment_count>1</comment_count>
    <who name="Jeremy Fitzhardinge">jeremy</who>
    <bug_when>2005-05-09 23:11:25 +0000</bug_when>
    <thetext>Geoff Smith wrote:

&gt;The &quot;BOUND&quot; (x86) instruction is not implemented.  The IBM Rational Ada compiler uses this instruction (albeit rarely) for bounds checking.
&gt;  
&gt;

I&apos;m astounded.  It has been a long while since that was a useful
instruction to use...  Shouldn&apos;t be too hard to implement as a helper
though.

    J
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>379465</commentid>
    <comment_count>2</comment_count>
    <who name="Tom Hughes">tom</who>
    <bug_when>2005-10-06 10:38:24 +0000</bug_when>
    <thetext>In answer to Julian&apos;s question on bug 112432 about what a bounds check failure should look like in userspace the answer (from a quick examination of the kernel source) is a SEGV of some sort.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>379599</commentid>
    <comment_count>3</comment_count>
    <who name="Julian Seward">jseward</who>
    <bug_when>2005-10-06 20:15:38 +0000</bug_when>
    <thetext>Geoff, is this still alive?  If yes, can you supply a test case
which checks that upon delivery of the resulting signal, you
have enough context (faulting address, or whatever) that the
compiler&apos;s code can recover in the way it wants.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>380821</commentid>
    <comment_count>4</comment_count>
    <who name="Dave Nomura">dcnomura</who>
    <bug_when>2005-10-12 01:10:00 +0000</bug_when>
    <thetext>Hi, I work for Geoff Smith (the originator of this bug report)
I have put together a simple test case (below)
When I run the program I get:
windfall-apex%  bound
in handler
info-&gt;si_signo = 11
info-&gt;si_errno = 0
info-&gt;si_code = 128
context.uc_mcontext.gregs[12] = 5

When I run it under valgrind 2.4:
windfall-apex% valgrind bound
==23121== Memcheck, a memory error detector for x86-linux.
==23121== Copyright (C) 2002-2005, and GNU GPL&apos;d, by Julian Seward et al.
==23121== Using valgrind-2.4.0, a program supervision framework for x86-linux.
==23121== Copyright (C) 2000-2005, and GNU GPL&apos;d, by Julian Seward et al.
==23121== For more details, rerun with: -v
==23121==
--23121-- disInstr: unhandled instruction bytes: 0x62 0x75 0xF8 0x83
--23121--           at 0x80485C1: main (bound.c:48)
==23121==
==23121== Process terminating with default action of signal 4 (SIGILL): dumping core
==23121==  Illegal operand at address 0xB007D056
==23121==    at 0x80485C1: main (bound.c:48)
==23121==
==23121== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 13 from 1)
==23121== malloc/free: in use at exit: 0 bytes in 0 blocks.
==23121== malloc/free: 0 allocs, 0 frees, 0 bytes allocated.
==23121== For counts of detected errors, rerun with: -v
==23121== No malloc&apos;d blocks -- no leaks are possible.
Illegal instruction

---------------------- bound.c ------------------------
#include &lt;signal.h&gt;
#include &lt;sys/signal.h&gt;
#include &lt;ucontext.h&gt;
#include &lt;stdio.h&gt;

char *p = 0;

void
handler(sig, info, context)
int sig;
siginfo_t *info;
ucontext_t *context;
{
        int i;
        printf(&quot;in handler\n&quot;);
        printf(&quot;info-&gt;si_signo = %d\n&quot;, info-&gt;si_signo);
        printf(&quot;info-&gt;si_errno = %d\n&quot;, info-&gt;si_errno);
        printf(&quot;info-&gt;si_code = %d\n&quot;, info-&gt;si_code);

        /* register 12 is REG_TRAPNO */
        printf(&quot;context.uc_mcontext.gregs[12] = %d\n&quot;,
                context-&gt;uc_mcontext.gregs[12]);
        exit(0);
}

int
intval()
{
        return 10;
}

int
main()
{
        int arr_bnd[2] = {1, 5};
        int arr[2];
        struct sigaction act, oact;
        register unsigned addr;
        register int ind = intval();

        bzero(&amp;act, sizeof(struct sigaction));
        bzero(&amp;oact, sizeof(struct sigaction));
        act.sa_sigaction = &amp;handler;
        act.sa_flags = SA_SIGINFO;
        sigaction(SIGSEGV, &amp;act, &amp;oact);

        addr = (unsigned)&amp;arr_bnd;
        asm(&quot;bound %esi, 0xfffffff8(%ebp)&quot;);
        printf(&quot;returned from handler\n&quot;);
}
</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>