bug-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gsl] [bug #49518] bug in matrix/vector tests


From: Patrick Alken
Subject: [Bug-gsl] [bug #49518] bug in matrix/vector tests
Date: Wed, 2 Nov 2016 19:37:27 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.90 Safari/537.36

URL:
  <http://savannah.gnu.org/bugs/?49518>

                 Summary: bug in matrix/vector tests
                 Project: GNU Scientific Library
            Submitted by: psa
            Submitted on: Wed 02 Nov 2016 07:37:24 PM GMT
                Category: Build
                Severity: 3 - Normal
        Operating System: 
                  Status: None
             Assigned to: None
             Open/Closed: Open
                 Release: 
         Discussion Lock: Any

    _______________________________________________________

Details:

from kmb2718 =at= gmail =dot= com

I found a bug in matrix and vector testing routines under MS Visual Studio
64bit build.

To open a temporary file, following code is used in some test routines.

===================================================

char filename[] = "test.XXXXXX";

#if !defined( _WIN32 )

  int fd = mkstemp(filename);

#else

  char * fd = _mktemp(filename);

# define fdopen fopen

#endif

===================================================

Under MS Visual Studio, _mktemp() is used without its function declaration
because the declaration resides in <io.h>.

 At compile time, the function is treated as an integer returning function
but it return an address of the filename string.

Under 64bit build condition, test programs using above code crashes due to
pointer value truncation (64bit pointer -> 32bit integer -> 64bit pointer
???).


To prevent this problem, test.c for vector or matrix needs to include
<io.h> as follows.

===================================================

#ifdef _WIN32

#include <io.h>

#endif

===================================================



_mktemp() is used in following files.

           gsl/matrix/test_complex_source.c

           gsl/matrix/test_source.c

           gsl/spmatrix/test.c

           gsl/vector/test_complex_source.c

           gsl/vector/test_source.c



Best Regards,

KB




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?49518>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]