#226 initialize malloc memory invtrsm.c

Both
open-fixed
None
5
2014-07-04
2014-06-30
mnormand
No

initialize malloc memory invtrsm.c as already addressed in atlas-devel ML:
https://sourceforge.net/p/math-atlas/mailman/message/31581212/

1 Attachments

Discussion

    • assigned_to: R. Clint Whaley
     
  • I don't see the question I asked answered there. The question was:

    All required memory should be init by calls to gegen or hegen. If you
    are getting an error that goes away by complete init, maybe cuased by an
    error somewhere causing out-of-bounds read (eg., read in lda-N gap,
    etc). Think the fix is to find error, not change init.

    To rephrase, I don't think the fix you propose can possibly be correct, and suspect there is another bug causing it. So this patch is rejected, unless you point out what valid part of memory is not being initialized in the tester.

     
  • mnormand
    mnormand
    2014-07-03

    I did not investigated the problem by myself but reading the patch header
    let me identify the following call stack, but unable to point to source
    code of the last called macro
    atlas/ATLAS/tune/blas/level3/invtrsm.c:512: static double RunTiming                                  
    atlas/ATLAS/tune/blas/level3/invtrsm.c:534: hegen(Order, (enum CBLAS_UPLO)Uplo, N, A+i*incA, lda);   
    atlas/ATLAS/tune/blas/level3/invtrsm.c:305: static void hegen                                        
    atlas/ATLAS/tune/blas/level3/invtrsm.c:311:   MakeHEDiagDom(Order, Uplo, N, A, lda);                 
    atlas/ATLAS/tune/blas/level3/invtrsm.c:251:static void MakeHEDiagDom                                 
    atlas/ATLAS/tune/blas/level3/invtrsm.c:270: *A = 1.0 + cblas_asum(N-j, A, 1);                
    atlas/ATLAS/include/atlas_cblascalias.h:40:#define cblas_asum     cblas_scasum                   
    atlas/ATLAS/include/cblas.h:57:float  cblas_scasum(const int N, const void *X, const int incX);
    atlas/ATLAS/interfaces/blas/C/src/cblas_scasum.c:39:float cblas_scasum(const int N, const void *X, const int incX)
    atlas/ATLAS/interfaces/blas/C/src/cblas_scasum.c:42: return(ATL_scasum(N, X, incX));
    
     
  • OK, looking at the call stack, I think I see an error, but the fix you have is wrong. Can you take the original code, and simply add the following as the first line of MakeHEDiagDom (line 260 of my invtrsm.c):


    Mjoin(PATL,gegen)(N, N, A, lda, N*N+lda);

    and let me know if that fixes things?

     
  • Ticket moved from /p/math-atlas/patches/64/

     
  • I have made this change to the basefiles after moving this from patch to bug tracker. Can close once reporter confirms that the fix works for them.

     
    • status: open --> open-fixed
    • Group: developer --> Both