Bug 105226 - Instruction INTO results in faulty context record
Summary: Instruction INTO results in faulty context record
Status: REPORTED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-07 06:09 UTC by Geoff Smith
Modified: 2025-02-17 20:25 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Geoff Smith 2005-05-07 06:10:01 UTC
Version:           2.4.0 (using KDE KDE 3.4.0)
Installed from:    SuSE RPMs
OS:                Linux

The "INTO" instruction is not completely implemented.  If the overflow bit is set when INTO executes, a signal results (as expected), but the context.uc_mcontext.gregs(REG_TRAPNO) field is set to 0 when the signal handler examines it.  Linux sets this field to the trap number (4).

This causes the runtime of the IBM Rational Ada compiler to raise the wrong exception when run under valgrind.

Sample code:

  with Report;  -- used solely to get identity function
  use Report;
  procedure Mul_Test is
    X : Integer;
  begin
    X := Ident_Int (2#1#E30) * Ident_Int (2#1#E30);
  end Mul_Test;

which generates:

  X := Ident_Int (2#1#E30) * Ident_Int (2#1#E30);
      00044: imul_d    eax, -08[ebp]            ;eax := eax * [ebp-08]
      00048: into                               ;interrupt(4), if of = 1

valgrind --version :  valgrind-2.4.0
uname -a           :  Linux alpo 2.4.21-27.0.1ELcustom #2
Comment 1 Jeremy Fitzhardinge 2005-05-09 23:11:41 UTC
Geoff Smith wrote:

>The "INTO" instruction is not completely implemented.  If the overflow bit is set when INTO executes, a signal results (as expected), but the context.uc_mcontext.gregs(REG_TRAPNO) field is set to 0 when the signal handler examines it.  Linux sets this field to the trap number (4).
>

In general, Valgrind doesn't do anything with the TRAPNO in ucontext. 
It's a bit fiddly to fix, because the code currently assumes that
everything which is worth knowing about a signal is encoded in siginfo.
Comment 2 T I Z E N 2025-02-17 19:05:41 UTC
If the origin Members still active on this or have an Ticket, MR or PR (as in Invent or on the Kanban), can you insert it to the Bug Report?
Thank you for the bug report. Unfortunately we were not able to get to it yet. Can we ask you to please check if this is still an issue with either Plasma 5.27 (the current LTS version) or Plasma 6.3 (the latest released version).

Regards,

[Tizen](https://invent.kde.org/tizen)
Comment 3 Tom Hughes 2025-02-17 20:25:20 UTC
Valgrind is a guest in the KDE bug tracker but it does not use KDE development processes so please ignore that last comment.