Menu

#570 Incorrect size variable used for gsl_permutation_*

v1.0 (example)
closed-accepted
nobody
None
7
2013-10-02
2013-09-30
No

GDL uses a DLong to store gsl_permutation_* data, but gsl uses size_t. On x86_64 at least, DLong is 4 bytes and size_t is 8. I'm not sure of the best way to handle this in general.

This was leading to a segmentation fault on x86_64 in test_ludc_lusol.pro:

test 83
        Start  83: test_ludc_lusol.pro
83: Test command: /builddir/build/BUILD/gdl-0.9.4/build/testsuite/launchtest "test_ludc_lusol.pro"
83: Test timeout computed to be: 9.99988e+06
83: % Compiled module: TEST_LUDC_LUSOL.
83: testing LUDC then LUSOL on IDL example
83: expected:      3.00000     -8.00000      10.0000
83: computed:       3.0000000      -8.0000000       10.000000
83: % TEST_LUDC_IDL: Basic tests OK
83: testing LUDC then LUSOL on GSL example
83: expected:      1.00000      2.00000      3.00000      4.00000
83: computed:       1.0000000       2.0000000       3.0000000       4.0000000
83: % TEST_LUDC_GSL: Basic tests OK
83: testing LUDC then LUSOL on IDL example
83: expected:       3.0000000      -8.0000000       10.000000
83: computed:       3.0000000      -8.0000000       10.000000
83: % TEST_LUDC_IDL: Basic tests OK
83: testing LUDC then LUSOL on GSL example
83: TEST EXITED FROM SIGNAL 11

Discussion

  • Orion Poplawski

    Orion Poplawski - 2013-09-30

    On IDL 8.2.2 64-bit index is of type LONG64, LONG on 32-bit. This patch makes that change. The guard stuff looks a little tricky - not sure I have that right.

     
  • Alain C.

    Alain C. - 2013-09-30

    Thanks Orion

    I tested with success on x86_64 (no crash but crashing with Valgrind, no more crash after. Yes the test crashes on OSX.)

    PS: could you give a second to my email yesterday, please ?

     
  • Alain C.

    Alain C. - 2013-10-02

    thanks Orion

    this is now in the CVS

    Alain

     
  • Alain C.

    Alain C. - 2013-10-02
    • status: open --> closed-accepted
     

Log in to post a comment.

MongoDB Logo MongoDB