Re: grdmath problems

Marcelo Banik <[email protected]>
Newsgroups gmane.comp.gis.gmt.user
Message-ID <CAN-U1_YLFRhB=Hm=CauS7pHghYuPCeHNwxcrcJ8bGnQ-OVR6fQ@mail.gmail.com>
I tested in an ubuntu 13.10.


 Following command pass:

~/strange_behavior$ /usr/local/GMT4.5.11/bin/grdmath 1.grd DUP DUP 10 LE
0.65 MUL EXCH DUP DUP DUP 10 GT EXCH 20 LE MUL EXCH 10 SUB 10 DIV -0.05 MUL
0.65 ADD MUL EXCH DUP DUP DUP 20 GT EXCH 30 LE MUL EXCH 20 SUB 10 DIV -0.07
MUL 0.60 ADD MUL EXCH DUP DUP DUP 30 GT EXCH 40 LE MUL EXCH 30 SUB 10 DIV
-0.08 MUL 0.53 ADD MUL EXCH 40 GT 0.45 MUL ADD ADD ADD ADD 686 2.grd DIV
EXCH POW MUL = 3.grd


 But if I did:

~/strange_behavior$ ln -s /usr/local/GMT4.5.11/bin .

~/strange_behavior$ bin/grdmath 1.grd DUP DUP 10 LE 0.65 MUL EXCH DUP DUP
DUP 10 GT EXCH 20 LE MUL EXCH 10 SUB 10 DIV -0.05 MUL 0.65 ADD MUL EXCH DUP
DUP DUP 20 GT EXCH 30 LE MUL EXCH 20 SUB 10 DIV -0.07 MUL 0.60 ADD MUL EXCH
DUP DUP DUP 30 GT EXCH 40 LE MUL EXCH 30 SUB 10 DIV -0.08 MUL 0.53 ADD MUL
EXCH 40 GT 0.45 MUL ADD ADD ADD ADD 686 2.grd DIV EXCH POW MUL = 3.grd

*** buffer overflow detected ***: bin/grdmath terminated


 And if I use full path to grdmath 4.5.12_r10185 [64-bit], it fails:

/opt/gmt/4.5.12/bin/grdmath 1.grd DUP DUP 10 LE 0.65 MUL EXCH DUP DUP DUP
10 GT EXCH 20 LE MUL EXCH 10 SUB 10 DIV -0.05 MUL 0.65 ADD MUL EXCH DUP DUP
DUP 20 GT EXCH 30 LE MUL EXCH 20 SUB 10 DIV -0.07 MUL 0.60 ADD MUL EXCH DUP
DUP DUP 30 GT EXCH 40 LE MUL EXCH 30 SUB 10 DIV -0.08 MUL 0.53 ADD MUL EXCH
40 GT 0.45 MUL ADD ADD ADD ADD 686 2.grd DIV EXCH POW MUL = 3.grd

*** buffer overflow detected ***: /opt/gmt/4.5.12/bin/grdmath terminated


 In both cases, it succeed if I use ./1.grd instead of 1.grd.


 Could someone more reproduce these results?


 Marcelo




On Thu, Jan 23, 2014 at 9:12 PM, Branden Christensen <
[email protected]> wrote:

> Paul:
>
>
> Good evening.
>
> I originally had the buffer overflow problem when I installed GMT on
> Ubuntu 12.04 using "sudo apt-get install gmt". You recommended I install
> 4.5.11 from sources which I did using the attached script
> "siposg4511-1.sh". But the problems persists.
>
> In the end I hope to be able to execute grdmath by calling the full path.
>
>
>
> *Branden Christensen*
> The Seismo Guys Blog: http://www.osop.com.pa/blog/the-seismo-guys/
> Take a Virtual Tour: http://www.osop.com.pa/tour
> Sign up for the OSOP mailing list:
> http://www.osop.com.pa/about/osop-mailing-list/
>
>
> On Wed, Jan 22, 2014 at 7:06 PM, Paul Wessel <[email protected]> wrote:
>
>> Hi Brandan-
>>
>> I think I forgot how this started.  Did you build GMT yourself or
>> installed via ubuntu package manager? We have had lots of issues with the
>> ubuntu-built GMT release but people who build it themselves have no issues.
>>  I know a ticket was opened with Ubuntu so maybe in 4 years it will be
>> addressed...  We suspect they used some unhealthy compiler flag but we do
>> not know.
>> -p
>>
>> On Jan 22, 2014, at 9:43 AM, Branden Christensen <
>> [email protected]> wrote:
>>
>> Paul:
>>
>>
>> If you guys want access to a server running 12.04 let me know.
>>
>>
>> Kind Regards,
>>
>>
>> *Branden Christensen*
>> The Seismo Guys Blog: http://www.osop.com.pa/blog/the-seismo-guys/
>> Take a Virtual Tour: http://www.osop.com.pa/tour
>> Sign up for the OSOP mailing list:
>> http://www.osop.com.pa/about/osop-mailing-list/
>>
>>
>> On Wed, Jan 22, 2014 at 7:31 PM, Paul Wessel <[email protected]> wrote:
>>
>>> No, this should be good - I just need to reproduce it in Ubuntu, or have
>>> some of our other guys try it as well (Marcelo? Eduardo?)
>>>
>>> -p
>>>
>>> On Jan 22, 2014, at 9:16 AM, Branden Christensen <
>>> [email protected]> wrote:
>>>
>>> Paul:
>>>
>>>
>>> I get this:
>>> osop@osop-displays2:~$ /usr/src/gmt-4.5.11/bin/grdmath -R0/10/0/10 -I1
>>> X = 1.grd
>>> osop@osop-displays2:~$ /usr/src/gmt-4.5.11/bin/grdmath -R0/10/0/10 -I1
>>> X = 2.grd
>>> osop@osop-displays2:~$ /usr/src/gmt-4.5.11/bin/grdmath 1.grd DUP DUP 10
>>> LE 0.65 MUL EXCH DUP DUP DUP 10 GT EXCH 20 LE MUL EXCH 10 SUB 10 DIV -0.05
>>> MUL 0.65 ADD MUL EXCH DUP DUP DUP 20 GT EXCH 30 LE MUL EXCH 20 SUB 10 DIV
>>> -0.07 MUL 0.60 ADD MUL EXCH DUP DUP DUP 30 GT EXCH 40 LE MUL EXCH 30 SUB 10
>>> DIV -0.08 MUL 0.53 ADD MUL EXCH 40 GT 0.45 MUL ADD ADD ADD ADD 686 2.grd
>>> DIV EXCH POW MUL = 3.grd
>>> *** buffer overflow detected ***: /usr/src/gmt-4.5.11/bin/grdmath
>>> terminated
>>>
>>> So will you still need the original files if these dummy files produce
>>> the same error? Please let me know!
>>>
>>>
>>> Kind Regards,
>>>
>>>
>>> *Branden Christensen*
>>> The Seismo Guys Blog: http://www.osop.com.pa/blog/the-seismo-guys/
>>> Take a Virtual Tour: http://www.osop.com.pa/tour
>>> Sign up for the OSOP mailing list:
>>> http://www.osop.com.pa/about/osop-mailing-list/
>>>
>>>
>>> On Wed, Jan 22, 2014 at 7:05 PM, Paul Wessel <[email protected]> wrote:
>>>
>>>> Hi Brandan-
>>>>
>>>> Even if the input grids dont matter I will need to create dummy ones
>>>> with the right dimensions since grdmath is reading them to detect -R -I.
>>>> If I just try
>>>>
>>>> grdmath -R0/10/0/10 -I1 X = 1.grd
>>>> grdmath -R0/10/0/10 -I1 X = 2.grd
>>>> grdmath 1.grd DUP DUP 10 LE 0.65 MUL EXCH DUP DUP DUP 10 GT EXCH 20 LE
>>>> MUL EXCH 10 SUB 10 DIV -0.05 MUL 0.65 ADD MUL EXCH DUP DUP DUP 20 GT EXCH
>>>> 30 LE MUL EXCH 20 SUB 10 DIV -0.07 MUL 0.60 ADD MUL EXCH DUP DUP DUP 30 GT
>>>> EXCH 40 LE MUL EXCH 30 SUB 10 DIV -0.08 MUL 0.53 ADD MUL EXCH 40 GT 0.45
>>>> MUL ADD ADD ADD ADD 686 2.grd DIV EXCH POW MUL = 3.grd
>>>>
>>>> I get no errors.  Let me know if the above crashes for you.  I will
>>>> then fire up Ubuntu in parallels and see what happens there.
>>>> -p
>>>>
>>>> On Jan 22, 2014, at 8:51 AM, Branden Christensen <
>>>> [email protected]> wrote:
>>>>
>>>> > Paul:
>>>> >
>>>> >
>>>> > Buenas tardes.
>>>> >
>>>> > I would like to take up this issue again.
>>>> >
>>>> > The buffer overflow is caused by grdmath on a 64-bit 12.04 LTS Ubuntu
>>>> machine running GMT 4.5.11.
>>>> >
>>>> > Here is the complete command and resulting error:
>>>> >
>>>> > /usr/src/gmt-4.5.11/bin/grdmath
>>>> /opt/shakemap2/bin/../data/9583161/richter/pgv_rock.grd DUP DUP 10 LE 0.65
>>>> MUL EXCH DUP DUP DUP 10 GT EXCH 20 LE MUL EXCH 10 SUB 10 DIV -0.05 MUL 0.65
>>>> ADD MUL EXCH DUP DUP DUP 20 GT EXCH 30 LE MUL EXCH 20 SUB 10 DIV -0.07 MUL
>>>> 0.60 ADD MUL EXCH DUP DUP DUP 30 GT EXCH 40 LE MUL EXCH 30 SUB 10 DIV -0.08
>>>> MUL 0.53 ADD MUL EXCH 40 GT 0.45 MUL ADD ADD ADD ADD 686
>>>> /opt/shakemap2/bin/../data/9583161/output/UFVS74PC0J.grd DIV EXCH POW MUL =
>>>> /opt/shakemap2/bin/../data/9583161/output/pgv.grd
>>>> > *** buffer overflow detected ***: /usr/src/gmt-4.5.11/bin/grdmath
>>>> terminated
>>>> >
>>>> > The input files do not matter. I created a new directory "tmp" and
>>>> touched 1.grd, 2.grd and 3.grd. Then:
>>>> > osop@osop-displays2:~/tmp$ /usr/src/gmt-4.5.11/bin/grdmath 1.grd DUP
>>>> DUP 10 LE 0.65 MUL EXCH DUP DUP DUP 10 GT EXCH 20 LE MUL EXCH 10 SUB 10 DIV
>>>> -0.05 MUL 0.65 ADD MUL EXCH DUP DUP DUP 20 GT EXCH 30 LE MUL EXCH 20 SUB 10
>>>> DIV -0.07 MUL 0.60 ADD MUL EXCH DUP DUP DUP 30 GT EXCH 40 LE MUL EXCH 30
>>>> SUB 10 DIV -0.08 MUL 0.53 ADD MUL EXCH 40 GT 0.45 MUL ADD ADD ADD ADD 686
>>>> 2.grd DIV EXCH POW MUL = 3.grd*** buffer overflow detected ***:
>>>> /usr/src/gmt-4.5.11/bin/grdmath terminated
>>>> >
>>>> >
>>>> > Thank you for your expertise.
>>>> >
>>>> >
>>>> > Kind Regards from Panama,
>>>> >
>>>> >
>>>> > Branden Christensen
>>>> > The Seismo Guys Blog: http://www.osop.com.pa/blog/the-seismo-guys/
>>>> > Take a Virtual Tour: http://www.osop.com.pa/tour
>>>> > Sign up for the OSOP mailing list:
>>>> http://www.osop.com.pa/about/osop-mailing-list/
>>>> >
>>>> >
>>>> > On Fri, Nov 29, 2013 at 9:32 AM, Paul Wessel <[email protected]>
>>>> wrote:
>>>> > Brendan-
>>>> >
>>>> > It would be helpful if you could save the files used to run the
>>>> grdmath command below which seems to be the first that crashes.  However,
>>>> that is clearly not the full grdmath command since there is no -R -I or
>>>> gridfile on the input side. If I am to be of any help I will need an actual
>>>> grdmath command line that crashes and all the input files that it requires
>>>> so I can try to recreate the situation here.
>>>> >
>>>> > Cheers,
>>>> > -p
>>>> >
>>>> >
>>>> >
>>>> > On Nov 28, 2013, at 5:54 PM, Branden Christensen <
>>>> [email protected]> wrote:
>>>> >
>>>> >> grdmath: (/opt/shakemap2/bin/../data/9583161/output/hwxDhIWuGY.xy)
>>>> PDIST 27.47 HYPOT = /opt/shakemap2/bin/../data/9583161/output/D7FwNIcwDT.grd
>>>> >> *** buffer overflow detected ***: /usr/lib/gmt/bin/grdmath terminated
>>>> >
>>>> > To unsubscribe, send the message "signoff gmt-help" to
>>>> [email protected]
>>>> >
>>>> > To unsubscribe, send the message "signoff gmt-help" to
>>>> [email protected]
>>>>
>>>> To unsubscribe, send the message "signoff gmt-help" to
>>>> [email protected]
>>>>
>>>
>>> To unsubscribe, send the message "signoff gmt-help" to
>>> [email protected]
>>>
>>>
>>> To unsubscribe, send the message "signoff gmt-help" to
>>> [email protected]
>>>
>>
>> To unsubscribe, send the message "signoff gmt-help" to
>> [email protected]
>>
>>
>> To unsubscribe, send the message "signoff gmt-help" to
>> [email protected]
>>
>
> To unsubscribe, send the message "signoff gmt-help" to
> [email protected]
>

To unsubscribe, send the message "signoff gmt-help" to [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.