dsdp tests hang on s390x when package is built with -O3

Bug #1543982 reported by Matthias Klose
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu on IBM z Systems
Fix Released
Medium
Unassigned
dsdp (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

dsdp tests hang on s390x when package is built with -O3. using -O2 works around it.

see https://launchpad.net/ubuntu/+source/dsdp/5.8-9.1build1/+build/8857744

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package dsdp - 5.8-9.1ubuntu1

---------------
dsdp (5.8-9.1ubuntu1) xenial; urgency=medium

  * Build using -O2 on s390x. LP: #1543982.

 -- Matthias Klose <email address hidden> Wed, 10 Feb 2016 11:28:13 +0100

Changed in dsdp (Ubuntu):
status: New → Fix Released
Revision history for this message
Matthias Klose (doko) wrote :

reopening, building with -O2 is just a workaround

Changed in dsdp (Ubuntu):
status: Fix Released → Confirmed
bugproxy (bugproxy)
tags: added: architecture-s39064 bugnameltc-136932 severity-high targetmilestone-inin1604
Revision history for this message
bugproxy (bugproxy) wrote : Comment bridged from LTC Bugzilla

------- Comment From <email address hidden> 2016-03-16 06:57 EDT-------
Canonical: Is this problem fixed now? Or is the workaround sufficient?

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

The problem is not fixed. This is an escalation from Canonical to IBM toolchain team, as it appears that -O3 gcc optimizations result in non working binary for this package. On all other architectures -O3 is used, on s390x we had to downgrade to -O2. We are expecting for this bug report to be passed to IBM s390x gcc team.

bugproxy (bugproxy)
tags: removed: bugnameltc-136932 ftbfs s390x severity-high
Revision history for this message
bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2016-03-22 12:24 EDT-------
This looks like a programming error in the library to me.

The function DTPUMatCholeskyFactor suffers from a type mismatch when
calling dpptrf. INFO is of type ffinteger which is defined to long (64 bit)
in dsdplapack.h while dpptrf appears to just set an integer part (32 bit) of
it.

When assigning this to *flag which is again an int we take the "wrong"
part of INFO since we are a big endian target.

Apparently ffinteger was changed intentionally from int to long. I
think that change broke it.

That it worked with -O2 but not with -O3 is just a coincidence. The
uninitialized value accessed here just happened to contain a 0 in the
-O2 case what indicates success.

src/vecmat/dlpack.c:

static int DTPUMatCholeskyFactor(void* AA, int *flag){
dtpumat* A=(dtpumat*) AA;
int i;
ffinteger INFO,LDA=1,N=A->n;
double *AP=A->val,*ss=A->sscale,*v;
char UPLO=A->UPLO;

if (N<=0) LDA=1;
else LDA=N;
if (A->scaleit){
for (v=AP,i=0;i<N;i++){ ss[i]=*v;v+=(i+2);}
for (i=0;i<N;i++){ ss[i]=1.0/sqrt(fabs(ss[i])+1.0e-8); }
dtpuscalemat(AP,ss,N);
}
dpptrf(&UPLO, &N, AP, &INFO );
*flag=INFO;
return 0;
}

dsdplapack.h:

#if !defined(DSDPLAPACK)
#define DSDPLAPACK
/*!
\file dsdplapack.h
\brief DSDP uses BLAS and LAPACK for many of its operations.
*/

typedef long int ffinteger;
/*
typedef int ffinteger;
*/

tags: added: bugnameltc-136932 severity-high
Changed in dsdp (Ubuntu):
importance: Undecided → Low
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package dsdp - 5.8-9.1ubuntu2

---------------
dsdp (5.8-9.1ubuntu2) xenial; urgency=medium

  * Cast INFO to int before storing it in the flag. LP: #1543982.

 -- Dimitri John Ledkov <email address hidden> Thu, 14 Apr 2016 12:52:28 +0100

Changed in dsdp (Ubuntu):
status: Confirmed → Fix Released
Frank Heimes (fheimes)
Changed in ubuntu-z-systems:
status: New → Fix Released
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.