Thread: SAC Macro: Problem

Started: 2009-12-02 22:58:21
Last activity: 2009-12-02 22:58:21
Topics: SAC Help
Shantanu Pandey
2009-12-02 22:58:21
Hello, I am facing a strange problem while running a SAC Macro. The output
is correct and the macro is performing but showing the strange error.
*
**
----------------------------------------------------------------------------------------------------
**The Macro is:*
r $dat
evaluate to tstart &1,dist / 8.

evaluate to tdeb &1,dist / 3.0
evaluate to tfin %tdeb + 201

if &1,delta gt 1
evaluate to tadd &1,delta * 201
evaluate to tfin %tdeb + %tadd + 10
endif

evaluate to tbid &1,dist / 2.5
if %tbid gt %tfin
evaluate to tfin %tbid
endif

cut %tstart %tfin
---------------------------------------------------------------------------------------------------------------------
*The output is**:*

SEISMIC ANALYSIS CODE [09/04/2008 (Version 101.2)]
Copyright 1995 Regents of the University of California

SAC> macro cutons.m dat 2004.006.01.01.52.0000.CB.BNXX.00.LHZ.SAC
r $dat
==> r 2004.006.01.01.52.0000.CB.BNXX.00.LHZ.SAC
evaluate to tstart &1,dist / 8.
*** glibc detected *** /sac/bin/sac: free(): invalid pointer: 0x0855f070 ***
==> evaluate to tstart 2.082740e+03 / 8.

evaluate to tdeb &1,dist / 3.0
*** glibc detected *** /sac/bin/sac: free(): invalid pointer: 0x08561cb0 ***
==> evaluate to tdeb 2.082740e+03 / 3.0
evaluate to tfin %tdeb + 201
==> evaluate to tfin 6.9424664e+02 + 201

if &1,delta gt 1
*** glibc detected *** /sac/bin/sac: free(): invalid pointer: 0x08561d28 ***
==> if 9.999999e-01 gt 1
endif

evaluate to tbid &1,dist / 2.5
*** glibc detected *** /sac/bin/sac: free(): invalid pointer: 0x08561de8 ***
==> evaluate to tbid 2.082740e+03 / 2.5
if %tbid gt %tfin
==> if 8.3309601e+02 gt 8.9524664e+02
endif

cut %tstart %tfin
==> cut 2.6034250e+02 8.9524664e+02
---------------------------------------------------------------------------------------------------------------------------------------
What i dont understand is the error **** glibc detected *** sac/bin/sac:
free(): invalid pointer:*
What does it mean???
--
Shantanu Pandey
******************************************************************************
"A winner is not one who never fails,but one who NEVER QUITS"
******************************************************************************

  • Brian Savage
    2009-12-02 19:25:36
    Dear Shantanu,

    Quickly: version 101.3b has this specific bug fixed. Please consider
    upgrading to the newer version.

    I tracked down this issue in version 101.2. The error you are seeing
    is due to your current, or system's default value, of the environment
    variable MALLOC_CHECK_ and a buffer overrun bug in version 101.2.

    The possible settings for MALLOC_CHECK_:
    0 = no error, do not abort
    1 = show error, do not abort
    2 = no error, abort
    3 = show error, abort

    You probably have the setting set at 1. This is the reason you are
    seeing an error, but the program continues and does not abort.

    Version 101.3b has fixed this specific bug and I would suggest that
    you upgrade to this version.

    Brian Savage
    savage @ uri.edu

    On Dec 2, 2009, at 8:58 AM , Shantanu Pandey wrote:

    Hello, I am facing a strange problem while running a SAC Macro. The
    output is correct and the macro is performing but showing the
    strange error.

    ----------------------------------------------------------------------------------------------------
    The Macro is:
    r $dat
    evaluate to tstart &1,dist / 8.

    evaluate to tdeb &1,dist / 3.0
    evaluate to tfin %tdeb + 201

    if &1,delta gt 1
    evaluate to tadd &1,delta * 201
    evaluate to tfin %tdeb + %tadd + 10
    endif

    evaluate to tbid &1,dist / 2.5
    if %tbid gt %tfin
    evaluate to tfin %tbid
    endif

    cut %tstart %tfin
    ---------------------------------------------------------------------------------------------------------------------
    The output is:

    SEISMIC ANALYSIS CODE [09/04/2008 (Version 101.2)]
    Copyright 1995 Regents of the University of California

    SAC> macro cutons.m dat 2004.006.01.01.52.0000.CB.BNXX.00.LHZ.SAC
    r $dat
    ==> r 2004.006.01.01.52.0000.CB.BNXX.00.LHZ.SAC
    evaluate to tstart &1,dist / 8.
    *** glibc detected *** /sac/bin/sac: free(): invalid pointer:
    0x0855f070 ***
    ==> evaluate to tstart 2.082740e+03 / 8.

    evaluate to tdeb &1,dist / 3.0
    *** glibc detected *** /sac/bin/sac: free(): invalid pointer:
    0x08561cb0 ***
    ==> evaluate to tdeb 2.082740e+03 / 3.0
    evaluate to tfin %tdeb + 201
    ==> evaluate to tfin 6.9424664e+02 + 201

    if &1,delta gt 1
    *** glibc detected *** /sac/bin/sac: free(): invalid pointer:
    0x08561d28 ***
    ==> if 9.999999e-01 gt 1
    endif

    evaluate to tbid &1,dist / 2.5
    *** glibc detected *** /sac/bin/sac: free(): invalid pointer:
    0x08561de8 ***
    ==> evaluate to tbid 2.082740e+03 / 2.5
    if %tbid gt %tfin
    ==> if 8.3309601e+02 gt 8.9524664e+02
    endif

    cut %tstart %tfin
    ==> cut 2.6034250e+02 8.9524664e+02
    ---------------------------------------------------------------------------------------------------------------------------------------
    What i dont understand is the error *** glibc detected *** sac/bin/
    sac: free(): invalid pointer:
    What does it mean???
    --
    Shantanu Pandey
    ******************************************************************************
    "A winner is not one who never fails,but one who NEVER QUITS"
    ******************************************************************************

    _______________________________________________
    sac-help mailing list
    sac-help<at>iris.washington.edu
    http://www.iris.washington.edu/mailman/listinfo/sac-help


10:01:54 v.22510d55