[Bug 2033405] Re: Wrong sha256 sum on ppc64el (compiled with -O3)

2024-04-11 Thread Peter Bergner
A pull request of an upstream fix to the dcfldd project has been
submitted:

  https://github.com/resurrecting-open-source-projects/dcfldd/pull/24

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2033405

Title:
  Wrong sha256 sum on ppc64el (compiled with -O3)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu-power-systems/+bug/2033405/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 1640518] Re: MongoDB Memory corruption

2016-11-11 Thread Peter Bergner
...and possibly wrap the above in:

#ifdef __powerpc__
...
#endif

so it's only used on POWER?

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1640518

Title:
  MongoDB Memory corruption

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-5/+bug/1640518/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1640518] Re: MongoDB Memory corruption

2016-11-11 Thread Peter Bergner
I'll note that the LD_PRELOAD interposer library is only needed for
binaries that are already compiled and you want to override the
pthread_mutex_lock() routine.  If you can recompile your source, then
you can place the interposer directly into your source and there is no
need for LD_PRELOADing anything.  Ie, you could just add the following
to any of your source files:

#define PTHREAD_MUTEX_NO_ELISION_NP (512)

extern int __pthread_mutex_lock (pthread_mutex_t *);
int
pthread_mutex_lock (pthread_mutex_t *mutex)
{
  mutex->__data.__kind |= PTHREAD_MUTEX_NO_ELISION_NP;
  return __pthread_mutex_lock (mutex);
}

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1640518

Title:
  MongoDB Memory corruption

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-5/+bug/1640518/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1640518] Re: MongoDB Memory corruption

2016-11-10 Thread Peter Bergner
gdb shows the abort is from the shim library too:

bergner@ampere:~$ gdb -q ./a.out
Reading symbols from ./a.out...(no debugging symbols found)...done.
(gdb) set environment LD_PRELOAD=./libbar.so.1
(gdb) run
Starting program: /home/bergner/a.out 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/powerpc64le-linux-gnu/libthread_db.so.1".

Program received signal SIGABRT, Aborted.
0x3fffb7b3f27c in __GI_raise (sig=) at 
../sysdeps/unix/sysv/linux/raise.c:54
54  ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x3fffb7b3f27c in __GI_raise (sig=) at 
../sysdeps/unix/sysv/linux/raise.c:54
#1  0x3fffb7b418f4 in __GI_abort () at abort.c:89
#2  0x3fffb7f507e4 in pthread_mutex_lock () from ./libbar.so.1
#3  0x1954 in __gthread_mutex_lock(pthread_mutex_t*) ()
#4  0x1b10 in std::mutex::lock() ()
#5  0x1be8 in std::lock_guard::lock_guard(std::mutex&) 
()
#6  0x1a80 in main ()
(gdb)

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1640518

Title:
  MongoDB Memory corruption

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-5/+bug/1640518/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1640518] Re: MongoDB Memory corruption

2016-11-10 Thread Peter Bergner
When I add the abort and use your C++ test case, I see the abort:

bergner@ampere:~$ cat pthread_mutex_lock.c 
#include 
#include 

#define PTHREAD_MUTEX_NO_ELISION_NP 512
extern int __pthread_mutex_lock (pthread_mutex_t *);

int
pthread_mutex_lock (pthread_mutex_t *mutex)
{
  abort();
  mutex->__data.__kind |= PTHREAD_MUTEX_NO_ELISION_NP;
  return __pthread_mutex_lock (mutex);
}
bergner@ampere:~$ gcc -fPIC -c pthread_mutex_lock.c 
bergner@ampere:~$ gcc -shared -Wl,-soname,libbar.so.1 -o libbar.so.1 
pthread_mutex_lock.o 
bergner@ampere:~$ cat foo.cpp 
#include 

int main(int argc, char* argv[]) {
std::mutex m;
std::lock_guard guard(m);
return EXIT_SUCCESS;
}
bergner@ampere:~$ g++ -std=c++11 -pthread foo.cpp
bergner@ampere:~$ ./a.out 
bergner@ampere:~$ LD_PRELOAD=./libbar.so.1 ./a.out 
Aborted

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1640518

Title:
  MongoDB Memory corruption

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-5/+bug/1640518/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1640518] Re: MongoDB Memory corruption

2016-11-10 Thread Peter Bergner
The following might override the HTM lock elision.  Can someone try it
to see if it works?

bergner@ampere:~$ cat pthread_mutex_lock.c 
#include 

#define PTHREAD_MUTEX_NO_ELISION_NP 512
extern int __pthread_mutex_lock (pthread_mutex_t *);

int
pthread_mutex_lock (pthread_mutex_t *mutex)
{
  mutex->__data.__kind |= PTHREAD_MUTEX_NO_ELISION_NP;
  return __pthread_mutex_lock (mutex);
}
bergner@ampere:~$ gcc -c -fPIC pthread_mutex_lock.c 
bergner@ampere:~$ gcc -shared -Wl,-soname,libfoo.so.1 -o libfoo.so.1 
pthread_mutex_lock.o 
bergner@ampere:~$ LD_PRELOAD=./libfoo.so.1  ./a.out 

...replacing ./a.out with the binary you want to run without lock
elision.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1640518

Title:
  MongoDB Memory corruption

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-5/+bug/1640518/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1544053] Re: x11-apps fails to build on ppc64el when built with -O3

2016-02-10 Thread Peter Bergner
I minimized re.c down to a small test case and it looks like a false
positive on the array bounds check.  Talking with Jakub, he said that
-Warray-bounds has lots of false positives, so I think either removing
the use of -Werror=array-bounds or using -O2 as permanent fixes for this
is probably best.  Since you've already changed to using -O2, we might
as well stick with that.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1544053

Title:
  x11-apps fails to build on ppc64el when built with -O3

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/x11-apps/+bug/1544053/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1463836] Re: 4.0 kernel build failure on ppc64el

2015-06-11 Thread Peter Bergner
Here is a minimal test case extracted from swsusp_asm64.s:

bergner@genoa:~/binutils/BUGS$ cat tlbie.s 
.text
tlbie %r4

bergner@genoa:~/binutils/BUGS$ 
/home/bergner/binutils/build/binutils-2_25/gas/as-new -a64 -mpower7 tlbie.s 
tlbie.s: Assembler messages:
tlbie.s:2: Error: missing operand

In ISA 2.06 (ie, POWER7), the tlbie instruction was changed from:

tlbie RB,L # Where L = 0 or 1 and tlbie RB is an extended 
mnemonic for tlbie RB,0
to
tlbie RB,RS

The assembler was recently changed to accept the tlbie RB,RS variant
so that is why we are seeing the error now and not before, but I believe
it is correct that the assembler error out on this, as the tlbie
instruction really did change.  I believe the correct fix for this is
going to take a kernel source change.  Whether that is to setup and pass
RS to the tlbie or whether we should use tlbiel instead, I'm not sure.
I'll ping our kernel team and see what they say.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1463836

Title:
  4.0 kernel build failure on ppc64el

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/binutils/+bug/1463836/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1463836] Re: 4.0 kernel build failure on ppc64el

2015-06-10 Thread Peter Bergner
I have the problem recreated.  Debugging it now.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1463836

Title:
  4.0 kernel build failure on ppc64el

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/binutils/+bug/1463836/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1320292] Re: ABI incompatibility between POWER and Z HTM builtins and intrinsics

2015-06-03 Thread Peter Bergner
Verified in gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04) too.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1320292

Title:
  ABI incompatibility between POWER and Z HTM builtins and intrinsics

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.8/+bug/1320292/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1322287] Re: HTM __builtin_ttest rtl expansion uses wrong shift amount

2015-06-03 Thread Peter Bergner
Verified in gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04) too.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1322287

Title:
  HTM __builtin_ttest rtl expansion uses wrong shift amount

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.8/+bug/1322287/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1311128] Re: Please incorporate gcc 4.8 revision 209515

2015-06-03 Thread Peter Bergner
Verified fixed in gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04).

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1311128

Title:
  Please incorporate gcc 4.8 revision 209515

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.8/+bug/1311128/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1320292] Re: ABI incompatibility between POWER and Z HTM builtins and intrinsics

2015-06-02 Thread Peter Bergner
Sorry, verified with gcc version 4.9.1 (Ubuntu 4.9.1-16ubuntu6).

** Tags removed: verification-needed
** Tags added: verification-done

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1320292

Title:
  ABI incompatibility between POWER and Z HTM builtins and intrinsics

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.8/+bug/1320292/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1322287] Re: HTM __builtin_ttest rtl expansion uses wrong shift amount

2015-06-02 Thread Peter Bergner
I can verify this is fixed.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1322287

Title:
  HTM __builtin_ttest rtl expansion uses wrong shift amount

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.8/+bug/1322287/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1320292] Re: ABI incompatibility between POWER and Z HTM builtins and intrinsics

2015-06-02 Thread Peter Bergner
I can verify that this is fixed.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1320292

Title:
  ABI incompatibility between POWER and Z HTM builtins and intrinsics

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.8/+bug/1320292/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1322287] Re: HTM __builtin_ttest rtl expansion uses wrong shift amount

2015-06-02 Thread Peter Bergner
Sorry, verified with gcc version 4.9.1 (Ubuntu 4.9.1-16ubuntu6).

** Tags removed: verification-needed
** Tags added: verification-done

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1322287

Title:
  HTM __builtin_ttest rtl expansion uses wrong shift amount

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.8/+bug/1322287/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1322287] [NEW] HTM __builtin_ttest rtl expansion uses wrong shift amount

2014-05-22 Thread Peter Bergner
Public bug reported:

There is a semi-latent bug for the HTM ttest pattern used with the
__builtin_ttest() builtin.  This is supposed to expand to a tabortwci.
instruction which sets cr0 and then some code that copies the cr0 value
into a gpr and then shifts and masks it into the lowest 2 bits in the gpr.
The mfcr and mfocrf instructions which can be used to copy the CR0 value
into a gpr, both copy the value into bits 32-35 of the gpr.  The bug is
that we only shift the gpr 24 bits to get the CR value into the low
order bits of the gpr, when we should be shifting 28 bits.  This works
most of the time due to a peculiarity in how the mfocrf instruction
works, since it copies the CR value into bits 32-35 and duplicates
that value in bits 36-39.  Since newish -mcpu targets (eg, power8)
normally generate a mfocrf, we don't see the problem.  However, in some
cases, we will instead generate a mfcr instruction, which does expose
the bug.

This bug was reported upstream with a patch here:

https://gcc.gnu.org/ml/gcc-patches/2014-05/msg01667.html

...and has been fixed upstream in trunk and the FSF 4.9 and FSF 4.8
branches, as revisions 210815, 210817 and 210818 respectively.

** Affects: gcc-4.8 (Ubuntu)
 Importance: Undecided
 Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1322287

Title:
  HTM __builtin_ttest rtl expansion uses wrong shift amount

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.8/+bug/1322287/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1320292] [NEW] ABI incompatibility between POWER and Z HTM builtins and intrinsics

2014-05-16 Thread Peter Bergner
Public bug reported:

The IBM XL team defined a set of HTM intrinsic functions that were supposed
to be API compatible across the XL and GCC compilers on both Power and S390.
PR61193 describes an issue where the functions that begin a transaction
are incompatible.  The Power intrinsics return non-zero on success, while
the S390 intrinsics return zero on success.

After discussing this with the XL compiler team, the S390 GCC team and
the Power GCC team, we have decided to leave the incompatibility between
Power and S390.  However, the XL and GCC compilers will be compatible
with each other when targeting the same processor target.  To mitigate
the incompatibility somewhat, we have decided to add a macro to the
powerpc*-linux's htmintrin.h file that defines what the successful
return status value of the __TM_simple_begin() and __TM_begin() intrinsic
function is.  This macro is already defined in the S390's htmintrin.h
header file and is used by the S390 to determine whether the transaction
was successfully started or not.  By adding the same macro on Power, we
allow users to write common code between Power and S390, even though our
successful return status values are different.

For example, the following code can be used on Power and S390, even
though the actual value returned by __TM_simple_begin() is different.

  if ((tx_state = __TM_simple_begin ()) == _HTM_TBEGIN_STARTED)
{
  /* Transaction State Initiated.  */
  ...
}
  else
{
  /* Transaction State Failed.  */
  ...
}

David approved this offline, so I'm committing this to GCC mainline as
revision 210486, as well as the 4.9 (210487) and 4.8 (210488) branches.

Peter

PR target/61193
* config/rs6000/htmxlintrin.h (_HTM_TBEGIN_STARTED): New define.
(__TM_simple_begin): Use it.
(__TM_begin): Likewise.

Index: gcc/config/rs6000/htmxlintrin.h
===
--- gcc/config/rs6000/htmxlintrin.h (revision 210485)
+++ gcc/config/rs6000/htmxlintrin.h (working copy)
@@ -46,12 +46,17 @@ extern C {

 typedef char TM_buff_type[16];

+/* Compatibility macro with s390.  This macro can be used to determine
+   whether a transaction was successfully started from the __TM_begin()
+   and __TM_simple_begin() intrinsic functions below.  */
+#define _HTM_TBEGIN_STARTED 1
+
 extern __inline long
 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
 __TM_simple_begin (void)
 {
   if (__builtin_expect (__builtin_tbegin (0), 1))
-return 1;
+return _HTM_TBEGIN_STARTED;
   return 0;
 }

@@ -61,7 +66,7 @@ __TM_begin (void* const TM_buff)
 {
   *_TEXASRL_PTR (TM_buff) = 0;
   if (__builtin_expect (__builtin_tbegin (0), 1))
-return 1;
+return _HTM_TBEGIN_STARTED;
 #ifdef __powerpc64__
   *_TEXASR_PTR (TM_buff) = __builtin_get_texasr ();
 #else

** Affects: gcc-defaults (Ubuntu)
 Importance: Undecided
 Status: New


** Tags: api

** Patch added: Patch to mitigate API incompatibility between Power and S390
   
https://bugs.launchpad.net/bugs/1320292/+attachment/4113990/+files/gcc-fsf-mainline-htm-compat.diff

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1320292

Title:
  ABI incompatibility between POWER and Z HTM builtins and intrinsics

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-defaults/+bug/1320292/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1276262] Re: Many tests of Boost v1.54 fail

2014-02-19 Thread Peter Bergner
How does this compare to the test results on BE?

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1276262

Title:
  Many tests of Boost v1.54 fail

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/boost1.54/+bug/1276262/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 727261] Re: [ppc64] coreutils misc/sort test fails at -O3

2011-03-01 Thread Peter Bergner
Can you try with -mno-vsx and/or -fno-tree-vectorize?  We have a bug
http://gcc.gnu.org/PR47862 that causes data corruption when vectorizing
and I can kind of see that sort might have a loop that might be hit by
this.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/727261

Title:
  [ppc64] coreutils misc/sort test fails at -O3

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs