[valgrind] [Bug 417238] Test memcheck/tests/vbit-test fails on mips64 BE

2020-02-24 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=417238

--- Comment #3 from Aleksandar Rikalo  ---
In fact, in most cases of the Ity_I1 operations, the u32 field is used (e.g.,
vbits.c: 51). The u1 field is used only in few places (removed by the patch).
That isn't a problem on LE since unit8_t overlaps with LSB of uint32_t, but it
is a problem on BE.
Ity_I8, ..., Ity_I64 operations don't require any overlaps.

The other possible way to fix the test is to keep u1 field and replace all
usages of u32 for Ity_I1 purpose into u1. It seems like it would be more
complicated, especially because valgrind_[set|get]_vbits() functions (see
valgrind.c) have to be modified.

I'm looking at vbits.c and I'm not sure how much logic would be simplified by
eliminating the u8, ..., u32 fields (e.g., concat_vbits() function). I would
put that option aside.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 415516] Can't cross compile on openwrt

2020-02-24 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=415516

Aleksandar Rikalo  changed:

   What|Removed |Added

 CC||aleksandar.rik...@rt-rk.com

--- Comment #3 from Aleksandar Rikalo  ---
Created attachment 126374
  --> https://bugs.kde.org/attachment.cgi?id=126374=edit
Fix OpenWRT build [WIP]

Hi, this patch fixes the "msa" issue with "mipsel-openwrt-linux-uclibc-gcc.bin
(OpenWrt/Linaro GCC 4.8-2014.04 r47072) 4.8.3"
Please let me know is it helpful.

However, there is another problem during linkage of vgdb:

/work/toolchain/iDetect-839d28effb806ce37c6c85b0da3de22bd6255450/OpenWrt-Toolchain-ramips-mt7688_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/bin/../lib/gcc/mipsel-openwrt-linux-uclibc/4.8.3/../../../../mipsel-openwrt-linux-uclibc/lib/libpthread.so.0:
undefined reference to `dlopen'
/work/toolchain/iDetect-839d28effb806ce37c6c85b0da3de22bd6255450/OpenWrt-Toolchain-ramips-mt7688_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/bin/../lib/gcc/mipsel-openwrt-linux-uclibc/4.8.3/../../../../mipsel-openwrt-linux-uclibc/lib/libpthread.so.0:
undefined reference to `dlsym'
collect2: error: ld returned 1 exit status
Makefile:2883: recipe for target 'vgdb' failed

It seems that dlopen/dlsym functions are missing in provided version of uClibc.
Have you ever encountered this situation (using this particular version of
toolchain) ?

Best wishes,
Aleksandar

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 417238] Test memcheck/tests/vbit-test fails on mips64 BE

2020-02-14 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=417238

Aleksandar Rikalo  changed:

   What|Removed |Added

 CC||aleksandar.rik...@rt-rk.com
   ||, m...@klomp.org

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 400162] Patch: Guard against __GLIBC_PREREQ for musl libc

2019-12-20 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=400162

Aleksandar Rikalo  changed:

   What|Removed |Added

 CC||mips3...@gmail.com

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 400162] Patch: Guard against __GLIBC_PREREQ for musl libc

2019-12-20 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=400162

--- Comment #4 from Aleksandar Rikalo  ---
Created attachment 124625
  --> https://bugs.kde.org/attachment.cgi?id=124625=edit
Fix none/tests/pth_atfork1 musl compilation error

Tested on nanoMIPS/musl/linux and x86/glibc.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 400162] Patch: Guard against __GLIBC_PREREQ for musl libc

2019-12-20 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=400162

Aleksandar Rikalo  changed:

   What|Removed |Added

 CC||aleksandar.rik...@rt-rk.com

--- Comment #3 from Aleksandar Rikalo  ---
(In reply to Randy MacLeod from comment #2)
> Created attachment 115831 [details]
> This is the correct patch for this bug

Hi Randy,
There is no  on musl, struct statx is in  which is
already included. So, you need to remove the last #else branch.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 400872] Add nanoMIPS support to Valgrind

2019-12-13 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=400872

Aleksandar Rikalo  changed:

   What|Removed |Added

 Attachment #122264|0   |1
is obsolete||

--- Comment #20 from Aleksandar Rikalo  ---
Created attachment 124469
  --> https://bugs.kde.org/attachment.cgi?id=124469=edit
Add tests for nanoMIPS instruction set

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 400872] Add nanoMIPS support to Valgrind

2019-12-13 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=400872

Aleksandar Rikalo  changed:

   What|Removed |Added

 Attachment #122263|0   |1
is obsolete||

--- Comment #19 from Aleksandar Rikalo  ---
Created attachment 124468
  --> https://bugs.kde.org/attachment.cgi?id=124468=edit
Fix some tests so they can be compiled for nanoMIPS

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 400872] Add nanoMIPS support to Valgrind

2019-12-13 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=400872

Aleksandar Rikalo  changed:

   What|Removed |Added

 Attachment #122262|0   |1
is obsolete||

--- Comment #18 from Aleksandar Rikalo  ---
Created attachment 124467
  --> https://bugs.kde.org/attachment.cgi?id=124467=edit
Add nanoMIPS support to Valgrind 4/4

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 400872] Add nanoMIPS support to Valgrind

2019-12-13 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=400872

Aleksandar Rikalo  changed:

   What|Removed |Added

 Attachment #122259|0   |1
is obsolete||
 Attachment #122260|0   |1
is obsolete||
 Attachment #122261|0   |1
is obsolete||

--- Comment #17 from Aleksandar Rikalo  ---
Created attachment 124466
  --> https://bugs.kde.org/attachment.cgi?id=124466=edit
Add nanoMIPS support to Valgrind 3/4

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 400872] Add nanoMIPS support to Valgrind

2019-08-20 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=400872

Aleksandar Rikalo  changed:

   What|Removed |Added

 Attachment #116211|0   |1
is obsolete||

--- Comment #15 from Aleksandar Rikalo  ---
Created attachment 122264
  --> https://bugs.kde.org/attachment.cgi?id=122264=edit
Add tests for nanoMIPS instruction set

Re-based onto current master branch.
There are no regressions on x86 and MIPS platforms.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 400872] Add nanoMIPS support to Valgrind

2019-08-20 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=400872

Aleksandar Rikalo  changed:

   What|Removed |Added

 Attachment #116204|0   |1
is obsolete||
 Attachment #116210|0   |1
is obsolete||

--- Comment #14 from Aleksandar Rikalo  ---
Created attachment 122263
  --> https://bugs.kde.org/attachment.cgi?id=122263=edit
Fix some tests so they can be compiled for nanoMIPS

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 400872] Add nanoMIPS support to Valgrind

2019-08-20 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=400872

Aleksandar Rikalo  changed:

   What|Removed |Added

 Attachment #116208|0   |1
is obsolete||

--- Comment #12 from Aleksandar Rikalo  ---
Created attachment 122261
  --> https://bugs.kde.org/attachment.cgi?id=122261=edit
Add nanoMIPS support to Valgrind 3/4

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 400872] Add nanoMIPS support to Valgrind

2019-08-20 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=400872

Aleksandar Rikalo  changed:

   What|Removed |Added

 Attachment #116209|0   |1
is obsolete||

--- Comment #13 from Aleksandar Rikalo  ---
Created attachment 122262
  --> https://bugs.kde.org/attachment.cgi?id=122262=edit
Add nanoMIPS support to Valgrind 4/4

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 400872] Add nanoMIPS support to Valgrind

2019-08-20 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=400872

Aleksandar Rikalo  changed:

   What|Removed |Added

 Attachment #116207|0   |1
is obsolete||

--- Comment #11 from Aleksandar Rikalo  ---
Created attachment 122260
  --> https://bugs.kde.org/attachment.cgi?id=122260=edit
Add nanoMIPS support to Valgrind 2/4

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 400872] Add nanoMIPS support to Valgrind

2019-08-20 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=400872

Aleksandar Rikalo  changed:

   What|Removed |Added

 Attachment #116206|0   |1
is obsolete||

--- Comment #10 from Aleksandar Rikalo  ---
Created attachment 122259
  --> https://bugs.kde.org/attachment.cgi?id=122259=edit
Add nanoMIPS support to Valgrind 1/4

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 400593] In Coregrind, use statx for some internal syscalls if [f]stat[64] fail

2019-08-16 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=400593

Aleksandar Rikalo  changed:

   What|Removed |Added

 Attachment #116054|0   |1
is obsolete||

--- Comment #3 from Aleksandar Rikalo  ---
Created attachment 122180
  --> https://bugs.kde.org/attachment.cgi?id=122180=edit
Use statx in Coregrind

The patch is re-based and `Device ID` conversion is fixed.
There is no more regressions on x86 and MIPS systems which support statx.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 400872] Add nanoMIPS support to Valgrind

2018-11-09 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=400872

Aleksandar Rikalo  changed:

   What|Removed |Added

 CC||mips3...@gmail.com

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 400872] Add nanoMIPS support to Valgrind

2018-11-09 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=400872

--- Comment #7 from Aleksandar Rikalo  ---
Here are few patches which implement nanoMIPS support:

* Mips specific code refactor - there is no functional impact but it is
necessary in order apply other patches.

* nanoMIPS support to Valgrind */4 - Add full support for nanoMIPS
architecture, including VEX, Coregrind, makefiles, VKI, ..., README. These
patches can be merged into one.

* Fix some tests so they can be compiled for nanoMIPS - improve problematic
tests so they can be compiled for nanoMIPS.

* Add tests for nanoMIPS instruction set - adds nanoMIPS tests.

Regression tests are done on x86, AMD64, mips32 and mips64.

This issue also depends on #400593.

Regards,
Aleksandar

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 400872] Add nanoMIPS support to Valgrind

2018-11-09 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=400872

--- Comment #6 from Aleksandar Rikalo  ---
Created attachment 116211
  --> https://bugs.kde.org/attachment.cgi?id=116211=edit
Add tests for nanoMIPS instruction set

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 400872] Add nanoMIPS support to Valgrind

2018-11-09 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=400872

--- Comment #5 from Aleksandar Rikalo  ---
Created attachment 116210
  --> https://bugs.kde.org/attachment.cgi?id=116210=edit
Fix some tests so they can be compiled for nanoMIPS

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 400872] Add nanoMIPS support to Valgrind

2018-11-09 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=400872

--- Comment #4 from Aleksandar Rikalo  ---
Created attachment 116209
  --> https://bugs.kde.org/attachment.cgi?id=116209=edit
Add nanoMIPS support to Valgrind 4/4

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 400872] Add nanoMIPS support to Valgrind

2018-11-09 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=400872

--- Comment #3 from Aleksandar Rikalo  ---
Created attachment 116208
  --> https://bugs.kde.org/attachment.cgi?id=116208=edit
Add nanoMIPS support to Valgrind 3/4

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 400872] Add nanoMIPS support to Valgrind

2018-11-09 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=400872

--- Comment #2 from Aleksandar Rikalo  ---
Created attachment 116207
  --> https://bugs.kde.org/attachment.cgi?id=116207=edit
Add nanoMIPS support to Valgrind 2/4

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 400872] Add nanoMIPS support to Valgrind

2018-11-09 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=400872

--- Comment #1 from Aleksandar Rikalo  ---
Created attachment 116206
  --> https://bugs.kde.org/attachment.cgi?id=116206=edit
Add nanoMIPS support to Valgrind 1/4

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 400872] New: Add nanoMIPS support to Valgrind

2018-11-09 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=400872

Bug ID: 400872
   Summary: Add nanoMIPS support to Valgrind
   Product: valgrind
   Version: unspecified
  Platform: Other
OS: Linux
Status: REPORTED
  Severity: normal
  Priority: NOR
 Component: general
  Assignee: jsew...@acm.org
  Reporter: aleksandar.rik...@rt-rk.com
  Target Milestone: ---

Created attachment 116204
  --> https://bugs.kde.org/attachment.cgi?id=116204=edit
Mips specific code refactor

Here are few patches which implement nanoMIPS support.
This issue depends on #400593.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 400593] Statx in Coregrind

2018-11-02 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=400593

Aleksandar Rikalo  changed:

   What|Removed |Added

 CC||mips3...@gmail.com,
   ||philippe.waroquiers@skynet.
   ||be

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 400593] Statx in Coregrind

2018-11-02 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=400593

Aleksandar Rikalo  changed:

   What|Removed |Added

Summary|Statx   |Statx in Coregrind

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 400593] New: Statx

2018-11-02 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=400593

Bug ID: 400593
   Summary: Statx
   Product: valgrind
   Version: unspecified
  Platform: Other
OS: Linux
Status: REPORTED
  Severity: normal
  Priority: NOR
 Component: general
  Assignee: jsew...@acm.org
  Reporter: aleksandar.rik...@rt-rk.com
  Target Milestone: ---

Created attachment 116054
  --> https://bugs.kde.org/attachment.cgi?id=116054=edit
Use statx in Coregrind

Hello everyone,

We are going to implement support for nanoMIPS architecture - patches will be
ready soon.
nanoMIPS has no support for [f]stat[64] syscalls, there is only statx and
support for Linux 4.11+.
In order to support nanoMIPS, we need Valgrind (Coregrind) to use statx (as one
of candidates) for internal purposes.

I'm suggesting this patch for the purpose, but it needs to be tested on all
architectures/platforms.
It is tested on AMD64/Linux and MIPS{32,64}/Linux.

Aleksandar

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 396905] compile tests failure on mips32-linux: Error: opcode not supported on this processor: mips1 (mips1)

2018-09-04 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=396905

Aleksandar Rikalo  changed:

   What|Removed |Added

 CC||aleksandar.rik...@rt-rk.com

--- Comment #2 from Aleksandar Rikalo  ---
Hi,

Unfortunately, this kind of fix makes troubles in case of specific CFLAGS are
passed.
However, build whole Valgrind for the "mips1" isn't good idea at all.

>From `README.mips`:

>> The build system expects that native GCC is configured correctly and 
>> optimized for the platform.
Yet, this may not be the case with some Debian distributions which configure
GCC to compile to "mips1" by default. Depending on a target platform, using
CFLAGS="-mips32r2", CFLAGS="-mips32" or CFLAGS="-mips64" or
CFLAGS="-mips64 -mabi=64" will do the trick and compile Valgrind correctly. <<

Please let us know if ./configure CFLAGS="-mips32" doesn't work for you.

Regards,
Aleksandar

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 345763] MIPS N32 ABI support

2018-04-19 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=345763

Aleksandar Rikalo <aleksandar.rik...@rt-rk.com> changed:

   What|Removed |Added

 Attachment #112104|0   |1
is obsolete||

--- Comment #37 from Aleksandar Rikalo <aleksandar.rik...@rt-rk.com> ---
Created attachment 112117
  --> https://bugs.kde.org/attachment.cgi?id=112117=edit
Fix tests

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 345763] MIPS N32 ABI support

2018-04-19 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=345763

Aleksandar Rikalo <aleksandar.rik...@rt-rk.com> changed:

   What|Removed |Added

 Attachment #112103|0   |1
is obsolete||

--- Comment #36 from Aleksandar Rikalo <aleksandar.rik...@rt-rk.com> ---
Created attachment 112116
  --> https://bugs.kde.org/attachment.cgi?id=112116=edit
Add mips N32 ABI support

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 345763] MIPS N32 ABI support

2018-04-18 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=345763

Aleksandar Rikalo <aleksandar.rik...@rt-rk.com> changed:

   What|Removed |Added

 Attachment #111846|0   |1
is obsolete||

--- Comment #35 from Aleksandar Rikalo <aleksandar.rik...@rt-rk.com> ---
Created attachment 112104
  --> https://bugs.kde.org/attachment.cgi?id=112104=edit
Fix tests

Re-based & arranged patch.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 345763] MIPS N32 ABI support

2018-04-18 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=345763

Aleksandar Rikalo <aleksandar.rik...@rt-rk.com> changed:

   What|Removed |Added

 Attachment #111845|0   |1
is obsolete||

--- Comment #34 from Aleksandar Rikalo <aleksandar.rik...@rt-rk.com> ---
Created attachment 112103
  --> https://bugs.kde.org/attachment.cgi?id=112103=edit
Add mips N32 ABI suupport

Re-based & arranged patch.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 345763] MIPS N32 ABI support

2018-04-05 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=345763

--- Comment #33 from Aleksandar Rikalo <aleksandar.rik...@rt-rk.com> ---
Created attachment 111846
  --> https://bugs.kde.org/attachment.cgi?id=111846=edit
Fix tests

With the last three changes, there are no failing tests on mips N32.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 345763] MIPS N32 ABI support

2018-04-05 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=345763

Aleksandar Rikalo <aleksandar.rik...@rt-rk.com> changed:

   What|Removed |Added

  Attachment #92187|0   |1
is obsolete||
  Attachment #95761|0   |1
is obsolete||
  Attachment #95762|0   |1
is obsolete||
 Attachment #106892|0   |1
is obsolete||
 Attachment #106893|0   |1
is obsolete||
 Attachment #106894|0   |1
is obsolete||
 Attachment #106895|0   |1
is obsolete||

--- Comment #32 from Aleksandar Rikalo <aleksandar.rik...@rt-rk.com> ---
Created attachment 111845
  --> https://bugs.kde.org/attachment.cgi?id=111845=edit
Add mips N32 ABI suupport

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 345763] MIPS N32 ABI support

2018-04-05 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=345763

Aleksandar Rikalo <aleksandar.rik...@rt-rk.com> changed:

   What|Removed |Added

 CC||aleksandar.rik...@rt-rk.com

--- Comment #31 from Aleksandar Rikalo <aleksandar.rik...@rt-rk.com> ---
Created attachment 111844
  --> https://bugs.kde.org/attachment.cgi?id=111844=edit
Introduce RegWord type

On all other architectures size of long matches register width. On mips n32
size of long is 32 bits and register width is 64 bits.
Valgrind is written with assumption that long size matches register width. This
is reason why both UWord for valgrind and HWord for VEX match size of long.
Long size differs from register size on mips n32 ABI.

This causes problems in several cases:
- For do_syscall arguments is used UWord type. This may cause that 64-bit
values lost 32 higher bits.
- In several places where Valgrind needs to check size of registers, using long
based types, would give incorrect value.

There are two possible solutions for these problems:
- Change size of HWord or UWord for mips n32 abi- Problem with this solution is
that they are already used on great number of places where it is assumed that
they match long size. Changing their size would require changes in great number
of places, and require new type which matches size of long. Change of this
proportion would potentially introduce a great deal of new bugs.
- Introduce a new type which will match size of registers on all platforms and
use it where necessary, which is implemented in provided patch.

This patch has no effect on Valgrind's behavior.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 382563] MIPS MSA ASE support

2017-10-27 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=382563

Aleksandar Rikalo <aleksandar.rik...@imgtec.com> changed:

   What|Removed |Added

 Attachment #108545|0   |1
is obsolete||

--- Comment #18 from Aleksandar Rikalo <aleksandar.rik...@imgtec.com> ---
Created attachment 108585
  --> https://bugs.kde.org/attachment.cgi?id=108585=edit
MIPS MSA 5/5 - MSA regression tests

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 382563] MIPS MSA ASE support

2017-10-24 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=382563

--- Comment #17 from Aleksandar Rikalo <aleksandar.rik...@imgtec.com> ---
Hi Petar,

Slightly reorganized, refactored and re-based patches are ready.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 382563] MIPS MSA ASE support

2017-10-24 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=382563

--- Comment #16 from Aleksandar Rikalo <aleksandar.rik...@imgtec.com> ---
Created attachment 108545
  --> https://bugs.kde.org/attachment.cgi?id=108545=edit
MIPS MSA 5/5 - MSA regression tests

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 382563] MIPS MSA ASE support

2017-10-24 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=382563

--- Comment #15 from Aleksandar Rikalo <aleksandar.rik...@imgtec.com> ---
Created attachment 108543
  --> https://bugs.kde.org/attachment.cgi?id=108543=edit
MIPS MSA 4/5 - Adds support for guest V128 registers on MIPS in Memcheck

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 382563] MIPS MSA ASE support

2017-10-24 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=382563

--- Comment #14 from Aleksandar Rikalo <aleksandar.rik...@imgtec.com> ---
Created attachment 108542
  --> https://bugs.kde.org/attachment.cgi?id=108542=edit
MIPS MSA 3/5 - Detecting presence of MSA capabilities

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 382563] MIPS MSA ASE support

2017-10-24 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=382563

--- Comment #13 from Aleksandar Rikalo <aleksandar.rik...@imgtec.com> ---
Created attachment 108541
  --> https://bugs.kde.org/attachment.cgi?id=108541=edit
MIPS MSA 2/5 - Full support of MIPS SIMD Architecture Module (MSA) instruction
set for VEX

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 382563] MIPS MSA ASE support

2017-10-24 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=382563

Aleksandar Rikalo <aleksandar.rik...@imgtec.com> changed:

   What|Removed |Added

 CC||aleksandar.rik...@imgtec.co
   ||m

--- Comment #12 from Aleksandar Rikalo <aleksandar.rik...@imgtec.com> ---
Created attachment 108540
  --> https://bugs.kde.org/attachment.cgi?id=108540=edit
MIPS MSA 1/5 - Introduces new Iops in VEX necessary for implementing
some MSA V128 operations

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 345307] Warning about "still reachable" memory when using libstdc++ from gcc 5

2017-09-18 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=345307

Aleksandar Rikalo <aleksandar.rik...@imgtec.com> changed:

   What|Removed |Added

 Attachment #102559|0   |1
is obsolete||

--- Comment #31 from Aleksandar Rikalo <aleksandar.rik...@imgtec.com> ---
Created attachment 107894
  --> https://bugs.kde.org/attachment.cgi?id=107894=edit
leak_cpp_interior additional .exps

Re-based patch.

Can someone take a look ?

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 370028] Reduce the number of compiler warnings on MIPS platforms

2017-05-10 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=370028

Aleksandar Rikalo <aleksandar.rik...@imgtec.com> changed:

   What|Removed |Added

 Attachment #101431|0   |1
is obsolete||

--- Comment #33 from Aleksandar Rikalo <aleksandar.rik...@imgtec.com> ---
Created attachment 105429
  --> https://bugs.kde.org/attachment.cgi?id=105429=edit
Slightly modified patch for syswrap-generic.c

Nothing special here, just use UInt* instead UChar*.

Tested on mips32/64-linux and amd64-linux.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 370028] Reduce the number of compiler warnings on MIPS platforms

2017-05-10 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=370028

--- Comment #32 from Aleksandar Rikalo <aleksandar.rik...@imgtec.com> ---
(In reply to Ivo Raisr from comment #31)
> Another patch committed in SVN r16348.

Thank You! Please take a look at Tamara's patch for mc_main.c.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 370028] Reduce the number of compiler warnings on MIPS platforms

2017-05-08 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=370028

Aleksandar Rikalo <aleksandar.rik...@imgtec.com> changed:

   What|Removed |Added

 CC||aleksandar.rik...@imgtec.co
   ||m

--- Comment #27 from Aleksandar Rikalo <aleksandar.rik...@imgtec.com> ---
Created attachment 105392
  --> https://bugs.kde.org/attachment.cgi?id=105392=edit
m_libcbase_warnings.diff: Suppress warnings from coregrind/m_libcbase.c

(In reply to Ivo Raisr from comment #26)
> Aleksandar, do you have another patch ready?

Hi Ivo,

Acctualy, I have.

m_libcbase_warnings.diff: Suppress warnings from coregrind/m_libcbase.c.

Function VG_(memset)() - after "while ((!VG_IS_4_ALIGNED(d)))" pointer d is
4-byte aligned, so it is safe to use ASSUME_ALIGNED for UInt* casting.

QSORT - According to swaptype variable initialization (m_libcbase.c:817),
condition (swaptype <= 1) implies "elements are Word-aligned", so we can use
ASSUME_ALIGNED in parts under the above condition ( in BM_SWAP(), BM_PVINIT()
and bm_swapfunc() ).

This is tested on mips32/64-linux and amd64-linux.


Aleksandar

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 345307] Warning about "still reachable" memory when using libstdc++ from gcc 5

2017-03-15 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=345307

--- Comment #30 from Aleksandar Rikalo <aleksandar.rik...@imgtec.com> ---
Patch from #373069 has been committed.
Now we need just https://bugs.kde.org/attachment.cgi?id=102559 to make
memcheck/leak_cpp_interior pass with gcc-6.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 370028] Reduce the number of compiler warnings on MIPS platforms

2017-03-07 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=370028

--- Comment #25 from Aleksandar Rikalo <aleksandar.rik...@imgtec.com> ---
(In reply to Julian Seward from comment #23)
> What's the status of this now?  Can it be closed?

No, it shouldn't. This is just the beginning. I'll prepare next few patches
soon.
Also, there are patches 2 and 3 which are still uncommitted.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 370028] Reduce the number of compiler warnings on MIPS platforms

2017-02-23 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=370028

--- Comment #19 from Aleksandar Rikalo <aleksandar.rik...@imgtec.com> ---
(In reply to Ivo Raisr from comment #17)
> I was also wondering of the impact on other architectures.
> Please could you conduct a quick test to see how the compiler resolves
> ASSUME_ALIGNED on amd64/ppc, for example? And mips/arm for comparison?

I have used following code to see how the GCC resolves ASSUME_ALIGNED on
MIPS32/64, ARM32, S390, PPC32/64 and AMD64:

char *a;

int f1() {
   return *ASSUME_ALIGNED(int*, a);
}

int f2() {
   return *((int*)a);
}

With -O1 (or higher) generated code for f1() and f2() are identical.

Without optimizations (-O0), f1() has few instructions more than f2(), more
precisely:
- AMD64: 2 additional mov instructions
- PPC32: additional stw/lwz pair
- PPC64: additional std/ld pair
- S390: additional st/l pair
- ARM32: additional str/ldr pair + two instructions for stack arrangement
- MIPS32: additional sw/lw pair
- MIPS64: additional sd/ld pair

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 370028] Reduce the number of compiler warnings on MIPS platforms

2017-02-23 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=370028

Aleksandar Rikalo <aleksandar.rik...@imgtec.com> changed:

   What|Removed |Added

 Attachment #101429|0   |1
is obsolete||

--- Comment #18 from Aleksandar Rikalo <aleksandar.rik...@imgtec.com> ---
Created attachment 104189
  --> https://bugs.kde.org/attachment.cgi?id=104189=edit
Patch 1/4

Fixed patch, after comment 17.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 370028] Reduce the number of compiler warnings on MIPS platforms

2017-02-14 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=370028

--- Comment #16 from Aleksandar Rikalo <aleksandar.rik...@imgtec.com> ---
Thank You for review.
I agree with changes in comment and also You are right about name.
I vote for ASSUME_ALIGNED, in that case, it is clear that there is a
assumption.

(In reply to Ivo Raisr from comment #15)
> I am quite happy with the first patch (1/4).
> That particular expression in vki-linux.h has been extensively studied and
> found to be benign with regards to potential misaligned access.
> 
> I'd reword the comment for PTR_CAST slightly:
> // Some architectures (eg. mips, arm) do not support unaligned memory access
> // by hardware, so GCC warn about suspicious situations. This macro could
> // be used to avoid these warnings but only after careful examination.
> 
> Also why did you chose name 'PTR_CAST'? Perhaps ALIGN_CAST or ASSUME_ALIGNED
> would be more self explanatory?

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 370028] Reduce the number of compiler warnings on MIPS platforms

2017-02-14 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=370028

--- Comment #14 from Aleksandar Rikalo <aleksandar.rik...@imgtec.com> ---
Ivo, Julian,

Can we do something about this? It would be nice if we could define the
strategy and start to eliminate false warnings. Please take a look on Patch
1/4, if proposed concept is acceptable to you, I will continue to use PTR_CAST.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 375514] valgrind_get_tls_addr() does not work in case of static TLS

2017-01-27 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=375514

Aleksandar Rikalo <aleksandar.rik...@imgtec.com> changed:

   What|Removed |Added

 Attachment #103619|0   |1
is obsolete||

--- Comment #4 from Aleksandar Rikalo <aleksandar.rik...@imgtec.com> ---
Created attachment 103665
  --> https://bugs.kde.org/attachment.cgi?id=103665=edit
GDB server - valgrind_get_tls_addr() fix for MIPS v2

Suggested comments and dlog(...) are added.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 370028] Reduce the number of compiler warnings on MIPS platforms

2017-01-25 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=370028

--- Comment #13 from Aleksandar Rikalo <aleksandar.rik...@imgtec.com> ---
(In reply to Julian Seward from comment #9)
> This feels to me like hiding misalignment problems.  I'd prefer to remove
> misaligned
> accesses where possible.  Building with --enable-usban at least makes it
> possible
> to see, on any platform, where the run-time misaligned accesses are.

Hi Julian,

My idea is not to hide all warnings, but to hide "false" ones.
There are situations (eg. vki-linux.h:677) where we know (for sure) that
address is aligned. Macro introduced in Patch 1/4 should be used to silence
compiler in these cases.

With -O2, there are no differences in object codes with or without using
PTR_CAST macro.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 375514] New: valgrind_get_tls_addr() does not work in case of static TLS

2017-01-24 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=375514

Bug ID: 375514
   Summary: valgrind_get_tls_addr() does not work in case of
static TLS
   Product: valgrind
   Version: unspecified
  Platform: Other
OS: Linux
Status: UNCONFIRMED
  Severity: normal
  Priority: NOR
 Component: general
  Assignee: jsew...@acm.org
  Reporter: aleksandar.rik...@imgtec.com
CC: mips3...@gmail.com
  Target Milestone: ---

Created attachment 103619
  --> https://bugs.kde.org/attachment.cgi?id=103619=edit
GDB server - valgrind_get_tls_addr() fix for MIPS

This is about valgrind_get_tls_addr() from m_gdbserver/target.c.
valgrind_get_tls_addr() fails on MIPS (and maybe on some other platforms) when
given module uses static TLS. Proposed patch fixes problem for MIPS.
Changes are made according to td_thr_tlsbase() function from
GLIBC/nptl_db/td_thr_tlsbase.c.
Related test is gdbserver_tests/hgtls.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 345307] Warning about "still reachable" memory when using libstdc++ from gcc 5

2017-01-19 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=345307

--- Comment #29 from Aleksandar Rikalo <aleksandar.rik...@imgtec.com> ---
Can anyone take a look on this?

Thank you in advance!
Aleksandar

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 370028] Reduce the number of compiler warnings on MIPS platforms

2016-12-20 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=370028

--- Comment #11 from Aleksandar Rikalo <aleksandar.rik...@imgtec.com> ---

> Can we simplify the patch #4 just to
> #  define DO(n)  (*fpu)[n] = arch->vex.guest_f##n
> ?
> Would that work? (Check the attached patch.)

Hi Petar,

It wouldn't work - (*fpu)[n] are doubles, but arch->vex.guest_f##n are ULongs.
In this case we need raw memory move, without long2double conversions.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 345307] Warning about "still reachable" memory when using libstdc++ from gcc 5

2016-12-01 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=345307

Aleksandar Rikalo <aleksandar.rik...@imgtec.com> changed:

   What|Removed |Added

 CC||aleksandar.rik...@imgtec.co
   ||m

--- Comment #28 from Aleksandar Rikalo <aleksandar.rik...@imgtec.com> ---
Created attachment 102559
  --> https://bugs.kde.org/attachment.cgi?id=102559=edit
leak_cpp_interior additional .exps

memcheck/tests/leak_cpp_interior fails consistently on systems with gcc 5.0+
and it would be good if we could find some solution for it.

This patch adds additional .exp files for gcc6 case.
Together with https://bugsfiles.kde.org/attachment.cgi?id=102518 it makes test
pass with gcc 6.0+.

Please, see: https://bugs.kde.org/show_bug.cgi?id=373069

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 373069] memcheck/tests/leak_cpp_interior fails with GCC 5.1+

2016-11-29 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=373069

Aleksandar Rikalo <aleksandar.rik...@imgtec.com> changed:

   What|Removed |Added

 CC||mips3...@gmail.com

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 373069] memcheck/tests/leak_cpp_interior fails with GCC 5.1+

2016-11-29 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=373069

--- Comment #3 from Aleksandar Rikalo <aleksandar.rik...@imgtec.com> ---
(In reply to Ivo Raisr from comment #1)
> I cannot comment anything about std::string implementation.
> However for your second query have a look at bug:
> https://bugs.kde.org/show_bug.cgi?id=345307

Thank You for quick response.
I've suggested patch for the first problem.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 373069] memcheck/tests/leak_cpp_interior fails with GCC 5.1+

2016-11-29 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=373069

--- Comment #2 from Aleksandar Rikalo <aleksandar.rik...@imgtec.com> ---
Created attachment 102518
  --> https://bugs.kde.org/attachment.cgi?id=102518=edit
Turn off CXX11_ABI

This patch forces leak_cpp_interior to be compiled using old implementation of
std::string.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 373069] New: memcheck/tests/leak_cpp_interior fails with GCC 5.1+

2016-11-29 Thread Aleksandar Rikalo
https://bugs.kde.org/show_bug.cgi?id=373069

Bug ID: 373069
   Summary: memcheck/tests/leak_cpp_interior fails with GCC 5.1+
   Product: valgrind
   Version: unspecified
  Platform: unspecified
OS: Linux
Status: UNCONFIRMED
  Severity: normal
  Priority: NOR
 Component: memcheck
  Assignee: jsew...@acm.org
  Reporter: aleksandar.rik...@imgtec.com
  Target Milestone: ---

Memcheck's leak_cpp_interior test has purpose to test heuristics for detecting
some common cases, where the pointer is pointing in the middle of the block,
but the chunk is not lost. One of such cases is old implementation of string
that has format:

 [_Rep] 
*_M_length 
*   [basic_string]_M_capacity 
*   _M_dataplus  _M_refcount 
*   _M_p >   unnamed array of char_type

New library ABI introduced in GCC 5.1 includes new implementation of
std::string. In new implementation pointer is no longer displaced from the
beginning of the chunk. This causes failing of leak_cpp_interior test.

>From GCC version 5.1.0, allocation of exceptions in libstdc++ is changed.
Before GCC version 5.1.0 emergency buffer was statically allocated. In version
5.1.0 it is swapped with object of class poll with dynamically allocated arena.
This change also causes failing of leak_cpp_interior test. Memcheck detects
dynamically allocated block of 72,704 bytes for 64bit architectures or 18,688
bytes for 32bit architectures, that is not visible when using older versions of
libstdc++.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 370028] Reduce the number of compiler warnings on MIPS platforms

2016-10-06 Thread Aleksandar Rikalo via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=370028

--- Comment #7 from Aleksandar Rikalo <aleksandar.rik...@imgtec.com> ---
Patch 1/4 (warn01.diff) removes 98 "cast-align" warnings caused by including
vki-linux.h from various sources.
PTR_CAST macro from this patch can be used in future, to avoid "cast-align"
warnings.

Patch 2/4 (warn02.diff) removes few "cast-align" warnings from
coregrind/launcher-linux.c.
Patch 3/4 (warn03.diff) removes "cast-align" warning from
coregrind/m_syswrap/syswrap-generic.c.
Patch 4/4 (warn04.diff) is MIPS specific and removes 32 "cast-equal" warnings
from coregrind/m_coredump/coredump-elf.c.

These numbers are relevant for MIPS build.

-- 
You are receiving this mail because:
You are watching all bug changes.


[valgrind] [Bug 370028] Reduce the number of compiler warnings on MIPS platforms

2016-10-05 Thread Aleksandar Rikalo via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=370028

Aleksandar Rikalo <aleksandar.rik...@imgtec.com> changed:

   What|Removed |Added

 CC||mips3...@gmail.com

-- 
You are receiving this mail because:
You are watching all bug changes.


[valgrind] [Bug 370028] Reduce the number of compiler warnings on MIPS platforms

2016-10-05 Thread Aleksandar Rikalo via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=370028

--- Comment #5 from Aleksandar Rikalo <aleksandar.rik...@imgtec.com> ---
I propose these four independent patches that reduce number of warnings by
~50%.

Applying patches:

patch -p1 < warn0x.diff

-- 
You are receiving this mail because:
You are watching all bug changes.


[valgrind] [Bug 370028] Reduce the number of compiler warnings on MIPS platforms

2016-10-05 Thread Aleksandar Rikalo via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=370028

--- Comment #4 from Aleksandar Rikalo <aleksandar.rik...@imgtec.com> ---
Created attachment 101432
  --> https://bugs.kde.org/attachment.cgi?id=101432=edit
Patch 4/4

-- 
You are receiving this mail because:
You are watching all bug changes.


[valgrind] [Bug 370028] Reduce the number of compiler warnings on MIPS platforms

2016-10-05 Thread Aleksandar Rikalo via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=370028

--- Comment #3 from Aleksandar Rikalo <aleksandar.rik...@imgtec.com> ---
Created attachment 101431
  --> https://bugs.kde.org/attachment.cgi?id=101431=edit
Patch 3/4

-- 
You are receiving this mail because:
You are watching all bug changes.


[valgrind] [Bug 370028] Reduce the number of compiler warnings on MIPS platforms

2016-10-05 Thread Aleksandar Rikalo via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=370028

--- Comment #1 from Aleksandar Rikalo <aleksandar.rik...@imgtec.com> ---
Created attachment 101429
  --> https://bugs.kde.org/attachment.cgi?id=101429=edit
Patch 1/4

-- 
You are receiving this mail because:
You are watching all bug changes.


[valgrind] [Bug 370028] Reduce the number of compiler warnings on MIPS platforms

2016-10-05 Thread Aleksandar Rikalo via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=370028

--- Comment #2 from Aleksandar Rikalo <aleksandar.rik...@imgtec.com> ---
Created attachment 101430
  --> https://bugs.kde.org/attachment.cgi?id=101430=edit
Patch 2/4

-- 
You are receiving this mail because:
You are watching all bug changes.


[valgrind] [Bug 370028] New: Reduce the number of compiler warnings on MIPS platforms

2016-10-05 Thread Aleksandar Rikalo via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=370028

Bug ID: 370028
   Summary: Reduce the number of compiler warnings on MIPS
platforms
   Product: valgrind
   Version: unspecified
  Platform: unspecified
OS: Linux
Status: UNCONFIRMED
  Severity: minor
  Priority: NOR
 Component: general
  Assignee: jsew...@acm.org
  Reporter: aleksandar.rik...@imgtec.com

During compilation on MIPS, GCC issues a lot of "cast-align" and other types of
warnings.

Reproducible: Always

Steps to Reproduce:
1. Regular build


Actual Results:  
GCC issues a lot of warnings.

Expected Results:  
Reasonable number of warnings.

-- 
You are receiving this mail because:
You are watching all bug changes.


[valgrind] [Bug 366079] FPXX Support for MIPS32 Valgrind

2016-08-19 Thread Aleksandar Rikalo via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=366079

--- Comment #6 from Aleksandar Rikalo <aleksandar.rik...@imgtec.com> ---
Created attachment 100684
  --> https://bugs.kde.org/attachment.cgi?id=100684=edit
MIPS64 version of test

-- 
You are receiving this mail because:
You are watching all bug changes.


[valgrind] [Bug 366079] FPXX Support for MIPS32 Valgrind

2016-08-19 Thread Aleksandar Rikalo via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=366079

--- Comment #5 from Aleksandar Rikalo <aleksandar.rik...@imgtec.com> ---
Created attachment 100683
  --> https://bugs.kde.org/attachment.cgi?id=100683=edit
FP32 support on MIPS64

Support for FP32 emulation on MIPS64 platforms (including
prctl(GET/SET_FP_MODE)  syscalls).

-- 
You are receiving this mail because:
You are watching all bug changes.


[valgrind] [Bug 366079] FPXX Support for MIPS32 Valgrind

2016-07-25 Thread Aleksandar Rikalo via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=366079

--- Comment #2 from Aleksandar Rikalo <aleksandar.rik...@imgtec.com> ---
Created attachment 100287
  --> https://bugs.kde.org/attachment.cgi?id=100287=edit
MIPS32 test for syscalls prctl(GET/SET_FP_MODE)

-- 
You are receiving this mail because:
You are watching all bug changes.


[valgrind] [Bug 366079] FPXX Support for MIPS32 Valgrind

2016-07-25 Thread Aleksandar Rikalo via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=366079

Aleksandar Rikalo <aleksandar.rik...@imgtec.com> changed:

   What|Removed |Added

 CC||aleksandar.rik...@imgtec.co
   ||m

--- Comment #1 from Aleksandar Rikalo <aleksandar.rik...@imgtec.com> ---
Created attachment 100286
  --> https://bugs.kde.org/attachment.cgi?id=100286=edit
Support for mips32 FPXX

With this patch, MIPS32 Valgrind compiled with -mfpxx can handle all types
(regarding FP_ABI flag) of MIPS32 ELFs.

- Functions arch_elf_pt_proc() and arch_check_elf() are added to elf reader
according to linux/fs/binfmt_elf.c from Linux 4.1;
- Processing .MIPS.abiflags section and initializing appropriate FPU mode for
MIPS32 are added;
- Emulation of prctl(GET/SET_FP_MODE) sys-calls are implemented for MIPS32.

Applying the patch:
patch -p1 < mips_fpxx_full_support.diff

The patch is tested on MIPS32 platforms with Linux 3.13 and 4.1.
Also, there are no regressions on MIPS64.

Regtests need to be performed on other architectures.

-- 
You are receiving this mail because:
You are watching all bug changes.


[valgrind] [Bug 366079] New: FPXX Support for MIPS32 Valgrind

2016-07-25 Thread Aleksandar Rikalo via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=366079

Bug ID: 366079
   Summary: FPXX Support for MIPS32 Valgrind
   Product: valgrind
   Version: unspecified
  Platform: Other
OS: Linux
Status: UNCONFIRMED
  Severity: major
  Priority: NOR
 Component: general
  Assignee: jsew...@acm.org
  Reporter: aleksandar.rik...@imgtec.com

Currently, support for MIPS32 FPXX ABI is incomplete. Programs compiled with
options -mfp64 or -mfpxx are not interpreted correctly on Valgrind which is
compiled with -mfpxx.


Reproducible: Always

Steps to Reproduce:
1. Build Valgrind with this configure: ./configure --host=mipsel-linux-gnu
CFLAGS="-march=mips32r2 -mabi=32 -mfpxx -EL"
2. Build FP test sample (eg. none/tests/mips32/round.c), with -mfp64
3. Run through the Valgrind on Linux 4.1+.

Actual Results:  
Illegal instruction / incorrect calculations.

Expected Results:  
Correctly executed test.

-- 
You are receiving this mail because:
You are watching all bug changes.


[valgrind] [Bug 360008] Contents of Power vr registers contents is not printed correctly when the --vgdb-shadow-registers=yes option is used.

2016-04-22 Thread Aleksandar Rikalo via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=360008

Aleksandar Rikalo <aleksandar.rik...@imgtec.com> changed:

   What|Removed |Added

 CC||aleksandar.rik...@imgtec.co
   ||m

--- Comment #13 from Aleksandar Rikalo <aleksandar.rik...@imgtec.com> ---
R15864/5 fails to build (tested on MIPS and x86) due to missing files:

m_gdbserver/power64-core2-valgrind-s1.xml
m_gdbserver/power64-core2-valgrind-s2.xml
m_gdbserver/power-vsx-valgrind-s1.xml
m_gdbserver/power-vsx-valgrind-s2.xml
m_gdbserver/power-vsx.xml

gcc -m64 -O2 -g -std=gnu99 -Wall -Wmissing-prototypes -Wshadow -Wpointer-arith
-Wstrict-prototypes -Wmissing-declarations -Wcast-align -Wcast-qual
-Wwrite-strings -Wempty-body -Wformat -Wformat-security -Wignored-qualifiers
-Wmissing-parameter-type -Wold-style-declaration -fno-stack-protector
-fno-strict-aliasing -fno-builtin  -O -g -fno-omit-frame-pointer
-fno-strict-aliasing -fpic -fno-builtin -fno-ipa-icf  -nodefaultlibs -shared
-Wl,-z,interpose,-z,initfirst  -m64   -o vgpreload_core-amd64-linux.so
vgpreload_core_amd64_linux_so-vg_preloaded.o  
make[3]: *** No rule to make target
`m_gdbserver/power64-core2-valgrind-s1.xml', needed by `all-am'.  Stop.
make[3]: Leaving directory `/home/aca/posao/valgrind/coregrind'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/aca/posao/valgrind/coregrind'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/aca/posao/valgrind'
make: *** [all] Error 2

-- 
You are receiving this mail because:
You are watching all bug changes.


[valgrind] [Bug 303877] valgrind doesn't support compressed debuginfo sections.

2016-04-13 Thread Aleksandar Rikalo via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=303877

--- Comment #34 from Aleksandar Rikalo <aleksandar.rik...@imgtec.com> ---
(In reply to Ivo Raisr from comment #31)

Thank You for reviewing.

I have fixed all things that you mention. The full patch is attached, and the
new version of tests is also attached.

> 2) When including "tinfl.c", do we want to define "TINFL_HEADER_FILE_ONLY"?
> 20) I don't see any coregrind/Makefile changes to build m_debuginfo/tinfl.c?

In case we use #include "tinfl.c" without defining TINFL_HEADER_FILE_ONLY, we
don't need tinfl.c in Makefile.
If we include header only (by defining TINFL_HEADER_FILE_ONLY before #include)
then tinfl.c needs to be compiled separately (this solution is applied in rev2
patch). 

> 5) CEnt.data has now non-fixed size. Why CACHE_ENTRY_SIZE is still used in
> various places
> around image.c; for example in alloc_CEnt() and realloc_CEnt()?

CACHE_ENTRY_SIZE is still in use as default (and minimal) size of cache entry.
Larger entries will be allocated in case size of the uncompressed data is
grater than CACHE_ENTRY_SIZE.

> However I don't have any system with toolchain supporting '-gz' at hand.
> I assume you tested on MIPS. Anyone can test on a different architecture or
> distribution?

It seems that nobody has GCC which supports -gz, so the test is useless for
now.

-- 
You are receiving this mail because:
You are watching all bug changes.


[valgrind] [Bug 303877] valgrind doesn't support compressed debuginfo sections.

2016-04-13 Thread Aleksandar Rikalo via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=303877

Aleksandar Rikalo <aleksandar.rik...@imgtec.com> changed:

   What|Removed |Added

  Attachment #98288|0   |1
is obsolete||

--- Comment #33 from Aleksandar Rikalo <aleksandar.rik...@imgtec.com> ---
Created attachment 98375
  --> https://bugs.kde.org/attachment.cgi?id=98375=edit
Test cases - rev2

-- 
You are receiving this mail because:
You are watching all bug changes.


[valgrind] [Bug 303877] valgrind doesn't support compressed debuginfo sections.

2016-04-08 Thread Aleksandar Rikalo via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=303877

--- Comment #30 from Aleksandar Rikalo <aleksandar.rik...@imgtec.com> ---
Thank you for suggestions.

I've prepared few patches:

ElfXX_Chdr-build-fixup.diff - tinfl is moved to m_debuginfo, checking for
Elf32/64_Chdr structs is placed into "configure" and line endings in tinfl.c
are converted to Unix style.

Elf32/64_Chdr, SHF_COMPRESSED and ELFCOMPRESS_ZLIB come from libc () and
exist only in newer versions of libc. These structures/constants are not
present in Kernel, so I didn't move them to vki. We can place them to separate
header or pub_tool_libcbase.h, if you think it's more appropriate.

zdebug-support.diff - support for .zdebug sections is added to readelf.c.

Three kinds of compressed debug sections are supported by Binutils 2.26 (zlib,
zlib-gnu and zlib-gabi) and I have tested Valgrind with all of them on MIPS/X86
Linux.

According to the manual
(https://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html), GCC should support
-gz=zlib and -gz=zlib-gnu options for generating compressed debug sections, but
I haven't succeeded to set up the environment in which it works. I've written
two simple Memchek tests (compressed_sections_test.diff) which use these
options, but they are not tested properly.

The order of applying patches (after applying compressed-dwarf-support.diff and
tinfl-modifications.diff) :

patch -p1 < ElfXX_Chdr-build-fixup.diff
patch -p1 < zdebug-support.diff
patch -p1 < compressed_sections_test.diff

-- 
You are receiving this mail because:
You are watching all bug changes.


[valgrind] [Bug 303877] valgrind doesn't support compressed debuginfo sections.

2016-04-08 Thread Aleksandar Rikalo via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=303877

--- Comment #29 from Aleksandar Rikalo <aleksandar.rik...@imgtec.com> ---
Created attachment 98288
  --> https://bugs.kde.org/attachment.cgi?id=98288=edit
Test cases

-- 
You are receiving this mail because:
You are watching all bug changes.


[valgrind] [Bug 303877] valgrind doesn't support compressed debuginfo sections.

2016-04-08 Thread Aleksandar Rikalo via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=303877

--- Comment #28 from Aleksandar Rikalo <aleksandar.rik...@imgtec.com> ---
Created attachment 98287
  --> https://bugs.kde.org/attachment.cgi?id=98287=edit
.zdebug sections support

-- 
You are receiving this mail because:
You are watching all bug changes.


[valgrind] [Bug 303877] valgrind doesn't support compressed debuginfo sections.

2016-04-08 Thread Aleksandar Rikalo via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=303877

--- Comment #27 from Aleksandar Rikalo <aleksandar.rik...@imgtec.com> ---
Created attachment 98286
  --> https://bugs.kde.org/attachment.cgi?id=98286=edit
Corrections according to comment #26

-- 
You are receiving this mail because:
You are watching all bug changes.


[valgrind] [Bug 303877] valgrind doesn't support compressed debuginfo sections.

2016-03-11 Thread Aleksandar Rikalo via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=303877

--- Comment #23 from Aleksandar Rikalo <aleksandar.rik...@imgtec.com> ---
It looks strange...
Have you run ./autogen.sh before compiling ?

I've tested the same configuration (amd64, linux) with trunk and
VALGRIND_3_11_0 revisions.
However, the patch is not tested on arm and ppc.

(In reply to Quanah Gibson-Mount from comment #22)
> These patches don't work with the current release:
> 
> ../coregrind/libcoregrind-amd64-linux.a(libcoregrind_amd64_linux_a-image.o):
> In function `get_slowcase':
> /tmp/valgrind/valgrind-3.11.0/coregrind/m_debuginfo/image.c:636: undefined
> reference to `tinfl_decompress_mem_to_mem'
> collect2: error: ld returned 1 exit status
> make[3]: *** [memcheck-amd64-linux] Error 1

-- 
You are receiving this mail because:
You are watching all bug changes.


[valgrind] [Bug 303877] valgrind doesn't support compressed debuginfo sections.

2016-03-07 Thread Aleksandar Rikalo via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=303877

--- Comment #21 from Aleksandar Rikalo <aleksandar.rik...@imgtec.com> ---
Created attachment 97742
  --> https://bugs.kde.org/attachment.cgi?id=97742=edit
Avoid warnings from tinfl.c

In order to avoid these warnings we need to modify tinfl.c in some way.
I suggest the attached solution.  MZ_MALLOC/REALLOC/FREE, memcpy, memset, etc.
are replaced with appropriate Valgrind functions. Tinfl is also added to
Makefile, so it can be used from other parts of project.

The patch can be applied after applying compressed-dwarf-support.diff.
To apply the patch use command:
patch -p1 < tinfl-modifications.diff

The alternative solution is to delete "High level decompression functions" from
tinfl.c.

-- 
You are receiving this mail because:
You are watching all bug changes.


[valgrind] [Bug 303877] valgrind doesn't support compressed debuginfo sections.

2016-02-29 Thread Aleksandar Rikalo via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=303877

Aleksandar Rikalo <aleksandar.rik...@imgtec.com> changed:

   What|Removed |Added

 CC||aleksandar.rik...@imgtec.co
   ||m

--- Comment #19 from Aleksandar Rikalo <aleksandar.rik...@imgtec.com> ---
Created attachment 97607
  --> https://bugs.kde.org/attachment.cgi?id=97607=edit
Compressed debug sections support for Valgrind - rev 1

I suggest the following solution. 

The patch has been tested on MIPS32/64.

Applying the patch:
patch -p1 < compressed-dwarf-support.diff

Note: tinfl.c from miniz project (https://github.com/richgel999/miniz) is used
without modifications.

-- 
You are receiving this mail because:
You are watching all bug changes.