Thread: Re: Sac101.6 unable to accept arguments

Started: 2013-08-02 00:04:16
Last activity: 2013-08-02 00:04:16
Topics: SAC Help
Steve Gao
2013-08-02 00:04:16
I'm also having an issue with 101.6. A SAC macro program, which worked under 101.2, crashed under 101.6 (see below).
I do not have any problems with reading and displaying SAC files using 101.6. The platform is x86-64 Ubuntun Linux.

Any hints?

Thanks.

Stephen S. Gao
http://www.mst.edu/~sgao

----------------------------------------------------------


SEISMIC ANALYSIS CODE [06/12/2013 (Version 101.6)]
Copyright 1995 Regents of the University of California
SIUCxx_NM.z SIUCxx_NM.n SIUCxx_NM.e
*** glibc detected *** /soft/sacnew/bin/sac: double free or corruption (fasttop): 0x00000000107e59f0 ***
======= Backtrace: =========
/lib64/libc.so.6[0x32662711df]
/lib64/libc.so.6(cfree+0x4b)[0x326627163b]
/soft/sacnew/bin/sac[0x4146d2]
/soft/sacnew/bin/sac[0x4173b3]
/soft/sacnew/bin/sac[0x41953a]
/soft/sacnew/bin/sac[0x41275f]
/soft/sacnew/bin/sac[0x410ab4]
/soft/sacnew/bin/sac[0x44af1c]
/soft/sacnew/bin/sac[0x448f4d]
/soft/sacnew/bin/sac[0x41cf73]
/soft/sacnew/bin/sac[0x412751]
/soft/sacnew/bin/sac[0x410ab4]
/soft/sacnew/bin/sac[0x40551b]
/lib64/libc.so.6(__libc_start_main+0xf4)[0x326621d994]
/soft/sacnew/bin/sac[0x404c29]
======= Memory map: ========
00400000-00618000 r-xp 00000000 fd:02 75814 /data/sgao/soft/sacnew/bin/sac
00817000-0082b000 rw-p 00217000 fd:02 75814 /data/sgao/soft/sacnew/bin/sac
0082b000-00a54000 rw-p 0082b000 00:00 0
10783000-107f5000 rw-p 10783000 00:00 0 [heap]
3265e00000-3265e1c000 r-xp 00000000 fd:00 4555028 /lib64/ld-2.5.so
326601c000-326601d000 r--p 0001c000 fd:00 4555028 /lib64/ld-2.5.so
326601d000-326601e000 rw-p 0001d000 fd:00 4555028 /lib64/ld-2.5.so
3266200000-326634e000 r-xp 00000000 fd:00 4555053 /lib64/libc-2.5.so
326634e000-326654d000 ---p 0014e000 fd:00 4555053 /lib64/libc-2.5.so
326654d000-3266551000 r--p 0014d000 fd:00 4555053 /lib64/libc-2.5.so
3266551000-3266552000 rw-p 00151000 fd:00 4555053 /lib64/libc-2.5.so
3266552000-3266557000 rw-p 3266552000 00:00 0
3266600000-3266682000 r-xp 00000000 fd:00 4555158 /lib64/libm-2.5.so
3266682000-3266881000 ---p 00082000 fd:00 4555158 /lib64/libm-2.5.so
3266881000-3266882000 r--p 00081000 fd:00 4555158 /lib64/libm-2.5.so
3266882000-3266883000 rw-p 00082000 fd:00 4555158 /lib64/libm-2.5.so
3266a00000-3266a14000 r-xp 00000000 fd:00 4555157 /lib64/libz.so.1.2.3
3266a14000-3266c13000 ---p 00014000 fd:00 4555157 /lib64/libz.so.1.2.3
3266c13000-3266c14000 rw-p 00013000 fd:00 4555157 /lib64/libz.so.1.2.3
3266e00000-3266e02000 r-xp 00000000 fd:00 4555159 /lib64/libdl-2.5.so
3266e02000-3267002000 ---p 00002000 fd:00 4555159 /lib64/libdl-2.5.so
3267002000-3267003000 r--p 00002000 fd:00 4555159 /lib64/libdl-2.5.so
3267003000-3267004000 rw-p 00003000 fd:00 4555159 /lib64/libdl-2.5.so
3267600000-3267605000 r-xp 00000000 fd:00 1640443 /usr/lib64/libXdmcp.so.6.0.0
3267605000-3267804000 ---p 00005000 fd:00 1640443 /usr/lib64/libXdmcp.so.6.0.0
3267804000-3267805000 rw-p 00004000 fd:00 1640443 /usr/lib64/libXdmcp.so.6.0.0
3267a00000-3267b05000 r-xp 00000000 fd:00 1640444 /usr/lib64/libX11.so.6.2.0
3267b05000-3267d05000 ---p 00105000 fd:00 1640444 /usr/lib64/libX11.so.6.2.0
3267d05000-3267d0c000 rw-p 00105000 fd:00 1640444 /usr/lib64/libX11.so.6.2.0
3267e00000-3267e02000 r-xp 00000000 fd:00 1640442 /usr/lib64/libXau.so.6.0.0
3267e02000-3268001000 ---p 00002000 fd:00 1640442 /usr/lib64/libXau.so.6.0.0
3268001000-3268002000 rw-p 00001000 fd:00 1640442 /usr/lib64/libXau.so.6.0.0
3269a00000-3269a09000 r-xp 00000000 fd:00 1640455 /usr/lib64/libSM.so.6.0.0
3269a09000-3269c09000 ---p 00009000 fd:00 1640455 /usr/lib64/libSM.so.6.0.0
3269c09000-3269c0a000 rw-p 00009000 fd:00 1640455 /usr/lib64/libSM.so.6.0.0
326a200000-326a217000 r-xp 00000000 fd:00 1640454 /usr/lib64/libICE.so.6.3.0
326a217000-326a416000 ---p 00017000 fd:00 1640454 /usr/lib64/libICE.so.6.3.0
326a416000-326a418000 rw-p 00016000 fd:00 1640454 /usr/lib64/libICE.so.6.3.0
326a418000-326a41b000 rw-p 326a418000 00:00 0
326aa00000-326aa10000 r-xp 00000000 fd:00 1650668 /usr/lib64/libXpm.so.4.11.0
326aa10000-326ac10000 ---p 00010000 fd:00 1650668 /usr/lib64/libXpm.so.4.11.0
326ac10000-326ac11000 rw-p 00010000 fd:00 1650668 /usr/lib64/libXpm.so.4.11.0
326b600000-326b60d000 r-xp 00000000 fd:00 4555162 /lib64/libgcc_s-4.1.2-20080825.so.1
326b60d000-326b80d000 ---p 0000d000 fd:00 4555162 Abort
r43sgao{sgao}1427:

________________________________________
From: sac-help-bounces<at>iris.washington.edu [sac-help-bounces<at>iris.washington.edu] on behalf of Sheila Peacock [sheila<at>blacknest.gov.uk]
Sent: Thursday, August 01, 2013 4:26 AM
To: sac-help<at>iris.washington.edu
Subject: [SAC-HELP] Sac101.6 unable to accept arguments

Dear all,

My colleague showed me a problem with our installation of
SAC 101.6: it does not accept command-line arguments
for substitution for "$1", etc.

The most trivial example is:

macro jj.mac contains

r $1 $2
p

It is invoked by:

sac1016c jj.mac 20130205_020000.EKB10.BHZ.sac 20130205_020000.EKB1.BHZ.sac

and gives the error message

ERROR 1014: Undefined variable in command: 1

This works OK with SAC 101.5c

It looks as if SAC 101.6, or the OS, has stripped off the leading $ signs from
the variables, because if you switch the order, i.e.

r $2$ $1$

you get:

ERROR 1014: Undefined variable in command: 2

I'm running Linux 2.6.18-348.el5 #1 SMP Tue Jan 8 17:53:53 EST 2013 x86_64 x86_64 x86_64 GNU/Linux
i.e. CentOS5. I get this error message for both the precompiled
linux version of SAC 101.6 and our locally compiled version.
On SAC 101.5c both precompiled and locally compiled versions
behave correctly.


The example using keywords in the "Macros" page of the SAC manual
also fails. When the commands

$KEYS FILES VALUES
read $FILES
mul $VALUES
p

are put into macro file jjj.mac

invoked with "sac1016 jjj.mac FILES 20130205_020000.EKB1.BHZ.sac 20130205_020000.EKB10.BHZ.sac VALUES 2.0 2.5

it comes up with:

ERROR 1301: No data files read in.
ERROR interpreting command: mul $VALUES
ILLEGAL OPTION: ^

I get the same error message when I invoke the macro from within SAC, thus:

SAC> macro jjj.mac
ERROR 1301: No data files read in.
ERROR interpreting command: mul $VALUES
ILLEGAL OPTION: ^
ERROR 1016: Terminating execution of macro jjj.mac
Command line is: mul $VALUES

whereas if I run the macro from within SAC 101.5c, it works:

SAC> macro jjj.mac
FILES? 20130205_020000.EKB1.BHZ.sac 20130205_020000.EKB10.BHZ.sac
VALUES? 2.0 4.0
Waiting (plots appear on screen as expected)
SAC>


I am invoking SAC 101.6 with the following script:
#! /bin/csh -f
# run SAC v. 101.6 locally compiled compiled version 2013 64-bit
setenv SACHOME /sharedprograms/sac/v101.6/64c
setenv PATH ${PATH}:${SACHOME}/bin
setenv SACAUX ${SACHOME}/aux
setenv SAC_USE_DATABASE 0
setenv SAC_PPK_LARGE_CROSSHAIRS 0
setenv MALLOC_CHECK_ 0
/sharedprograms/sac/v101.6/64c/bin/sac $*

and an almost identical script for SAC 101.5c:
#! /bin/csh -f
# run SAC v. 101.5c locally compiled compiled version 2011 64-bit
setenv SACHOME /sharedprograms/sac/v101.5c/64c
setenv PATH ${PATH}:${SACHOME}/bin
setenv SACAUX ${SACHOME}/aux
setenv SAC_USE_DATABASE 0
setenv SAC_PPK_LARGE_CROSSHAIRS 0
setenv MALLOC_CHECK_ 0
/sharedprograms/sac/v101.5c/64c/bin/sac $*

I assume that the error is on my behalf, since such an obvious
problem would have been flagged by other users by now if not.

Regards,
Sheila Peacock
AWE Blacknest.

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

19:48:43 v.01697673