[GRASS5] nviz problem
Michael Barton
michael.barton at asu.edu
Sat Dec 18 16:51:11 EST 2004
I want to add a report that might (or I suppose might not) help to clarify
what is happening.
I am at home and running a 2 December version of GRASS 5.7 cvs on my Mac OSX
laptop. I have a newer version on my lab Mac but can't get at it at the
moment. However, one of my grad students has been doing a lot with nviz in
the last couple days on a 13 December version of GRASS 5.7 cvs and (without
systematic testing) it seems to behave the same.
When I run nviz from the GUI it runs fine. This is using the 'execute'
procedure which is essentially exec [cmd] &, which brings up the
autogenerated GUI dialog. Whether I add a raster (or other) map or run it
with the -q flag from this environment, it runs in the background without
any problems
When I run nviz from the GRASS command prompt it runs exactly the same as
above *IF* I simply type nviz [return], bringing up the autogenerated GUI.
However, if I type from the GRASS command prompt "nviz -q & [return]", it
runs differently. NVIZ works fine UNTIL I return to the command prompt and
hit [return]. I've copied the terminal output below. Note that it goes to
the Wish "%" prompt (this doesn't happen if I start nviz either of the other
2 ways).
GRASS 5.7.cvs:~ > nviz -q &
[1] 1503
GRASS 5.7.cvs:~ > *** malloc[1503]: Deallocation of a pointer not malloced:
0x29e4248; This could be a double free(), or free() called with the middle
of an allocated block; Try setting environment variable MallocHelp to see
tools to help debug
*** malloc[1503]: Deallocation of a pointer not malloced: 0x2b7e108; This
could be a double free(), or free() called with the middle of an allocated
block; Try setting environment variable MallocHelp to see tools to help
debug
%
[1]+ Stopped nviz -q
GRASS 5.7.cvs:~ >
At this point nviz freezes. I can't get it to do anything and I can't quit
it. The rest of GRASS works fine, both from the command prompt and from the
tcltk GIS Manager. However, the only way I can quit nviz is to completely
exit X-11 on my Mac.
I hope this helps.
Michael
On 12/18/04 11:36 AM, "Huidae Cho" <grass4u at gmail.com> wrote:
> Hi, output is the following:
>
> GRASS 5.7.cvs:~/tmp > cat a
> #!/bin/sh
> exec nviz "$0" "$@"
> GRASS 5.7.cvs:~/tmp > ./a elev=dem&
> [1] 1112
> GRASS 5.7.cvs:~/tmp > Loading Data
> Loading Data
> translating colors
> recalculating normals...
> % w 100
>
> [1]+ Stopped ./a elev=dem
> GRASS 5.7.cvs:~/tmp >
>
> It stops just after displaying map and empty control windows and
> if I "fg", it starts working again.
>
> I think behavior is not consistent from system to system.
>
>
> Huidae Cho
>
>
> On Sat, Dec 18, 2004 at 04:29:33PM +0000, Bob Covill wrote:
>>
>> Hi,
>>
>>
>>
>> This is an interesting one. If I execute something like "nviz -q &", nviz
>>
>> starts up normally with the wish (%) prompt. If I hit enter at the prompt I
>>
>> am returned to the normal command line prompt and can run other commands
>>
>> (while nviz is running). When I quit nviz I get the respone on the command
>>
>> line ...
>>
>> [1]+ Done nviz -q
>>
>> which is what I would expect from a command that has been running in the
>>
>> background.
>>
>>
>>
>> Out of curiousity try creating a simple startup script with the following:
>>
>>
>>
>> #!/bin/sh
>>
>> exec nviz "$0" "$@"
>>
>>
>>
>> Make it executable and try running it in the background. For example if you
>>
>> name the script nv_start.sh, try "nv_start.sh elev=dem &" and see if that
>>
>> works.
>>
>>
>>
>> --
>>
>> Bob
>>
>>
>>
>>
>>
>> On 12/18/2004, "Huidae Cho" <grass4u at gmail.com> wrote:
>>
>>
>>
>>> Interesting!
>>
>>>
>>
>>> Is wish running in background? As I know, a shell-like program cannot be
>>
>>> running in that way because if it's bg'ed or run with "&", /bin/sh or
>>
>>> the login shell takes control of stdin so that users can stay in the login
>>
>>> shell.
>>
>>>
>>
>>> If it's executed by a script, then it's ok because it's a usual shell
>>
>>> script.
>>
>>>
>>
>>> Do you mean running "nviz" and executing other programs in the "%" nviz
>>
>>> prompt instead of running "nviz &"?
>>
>>>
>>
>>> If wish is running in background (wish &), how can you execute wish
>>
>> functions?
>>
>>>
>>
>>>
>>
>>> Thank you.
>>
>>> Huidae Cho
>>
>>>
>>
>>>
>>
>>> On Sat, Dec 18, 2004 at 01:22:50PM +0000, Bob Covill wrote:
>>
>>>>
>>
>>>> Hi,
>>
>>>>
>>
>>>>
>>
>>>>
>>
>>>> It appears that not even wish will run in the background on your system
>>
>> ...
>>
>>>>
>>
>>>> very strange.
>>
>>>>
>>
>>>>
>>
>>>>
>>
>>>> The current nviz IS the old NVWISH executable which was called was called
>>
>> by
>>
>>>>
>>
>>>> the old nviz shell script. The reason I got rid of the shell script was
>>
>>>>
>>
>>>> because when nviz encountered an error the same un-informitive message
>>
>> was
>>
>>>>
>>
>>>> generated because it was passed through the script. Also, there are a
>>
>> number
>>
>>>>
>>
>>>> of error catches in the actual nviz tcl scripts which were completely
>>
>> ignored
>>
>>>>
>>
>>>> with the old shell startup.
>>
>>>>
>>
>>>>
>>
>>>>
>>
>>>> Before reverting to the old startup it would be nice to know why wish
>>
>> (and
>>
>>>>
>>
>>>> nviz) will not run in the background on some systems. On both of my
>>
>> RedHat
>>
>>>>
>>
>>>> systems it runs fine both in the background and the foreground.
>>
>>>>
>>
>>>>
>>
>>>>
>>
>>>> --
>>
>>>>
>>
>>>> Bob
>>
>>>>
>>
>>>>
>>
>>>>
>>
>>>> On 12/18/2004, "Huidae Cho" <grass4u at gmail.com> wrote:
>>
>>>>
>>
>>>>
>>
>>>>
>>
>>>>> Hi,
>>
>>>>
>>
>>>>>
>>
>>>>
>>
>>>>> Now nviz is not a *wish script but a shell itself. That's why it prints
>>
>>>>
>>
>>>>> a prompt and we cannot execute it background and inside "d.m &". To fix
>>
>>>>
>>
>>>>> this problem, I think we should go back to NVWISH because running nviz
>>
>>>>
>>
>>>>> foreground is pain.
>>
>>>>
>>
>>>>>
>>
>>>>
>>
>>>>> You can test this:
>>
>>>>
>>
>>>>>
>>
>>>>
>>
>>>>> wish &
>>
>>>>
>>
>>>>>
>>
>>>>
>>
>>>>> prints % prompt and just stop!
>>
>>>>
>>
>>>>>
>>
>>>>
>>
>>>>> Huidae Cho
>>
>>>>
>>
>>>>>
>>
>>>>
>>
>>>>>
>>
>>>>
>>
>>>>> On Fri, Dec 17, 2004 at 09:02:39PM -0400, Bob Covill wrote:
>>
>>>>
>>
>>>>>> Hello,
>>
>>>>
>>
>>>>>>
>>
>>>>
>>
>>>>>> I tried running the latest version of nviz in the background with
>>
>>>>
>>
>>>>>> various options and it seems to work fine. The "%" prompt that you see
>>
>>>>
>>
>>>>>> is perfectly normal. The nviz program is simply a customized version
>>
>> of
>>
>>>>
>>
>>>>>> the Tcl/Tk "wish" executable. Try executing "wish" on the command line
>>
>>>>
>>
>>>>>> and you should see the same prompt.
>>
>>>>
>>
>>>>>>
>>
>>>>
>>
>>>>>> As for it crashing when it is run in the background, I have no idea.
>>
>> You
>>
>>>>
>>
>>>>>> might try changing GRASS_MESSAGE_FORMAT environment variable to see if
>>
>>>>
>>
>>>>>> that has any effect.
>>
>>>>
>>
>>>>>>
>>
>>>>
>>
>>>>>> It might help to know what platform and Tcl/Tk version it is failing
>>
>> on.
>>
>>>>
>>
>>>>>>
>>
>>>>
>>
>>>>>> For me it works on RedHat 7.3 with Tk8.3, and RedHat 9 with Tk8.4.
>>
>>>>
>>
>>>>>>
>>
>>>>
>>
>>>>>> --
>>
>>>>
>>
>>>>>> Bob
>>
>>>>
>>
>>>>>>
>>
>>>>
>>
>>>>>>
>>
>>>>
>>
>>>>>> Helena wrote:
>>
>>>>
>>
>>>>>>> Huidae Cho wrote:
>>
>>>>
>>
>>>>>>>
>>
>>>>
>>
>>>>>>>> Hi,
>>
>>>>
>>
>>>>>>>>
>>
>>>>
>>
>>>>>>>> I noticed today that nviz doesn't work if I run it background as
>>
>>>>
>>
>>>> before.
>>
>>>>
>>
>>>>>>>> Similarly, it just stops after displaying a map when it's executed
>>
>> from
>>
>>>>
>>
>>>>>>>> "d.m &" which is recommended in the welcome message.
>>
>>>>
>>
>>>>>>>>
>>
>>>>
>>
>>>>>>>> nviz elevation=dem & # doesn't work
>>
>>>>
>>
>>>>>>>> d.m & # nviz doesn't work
>>
>>>>
>>
>>>>>>>>
>>
>>>>
>>
>>>>>>>> nviz elevation=dem # works!
>>
>>>>
>>
>>>>>>>> d.m # nviz works!
>>
>>>>
>>
>>>>>>>>
>>
>>>>
>>
>>>>>>>> And I see nviz prints % prompt. Does anyone have a clue?
>>
>>>>
>>
>>>>>>>
>>
>>>>
>>
>>>>>>>
>>
>>>>
>>
>>>>>>> It must be the latest change that was done - I just tried it and it
>>
>>>>
>>
>>>>>>> does not work even if I do nviz elevation=dem, it displays the DEM
>>
>>>>
>>
>>>>>>> but fails to open the Main pannel and prints a % prompt.
>>
>>>>
>>
>>>>>>> It worked OK just a few days (weeks?) ago.
>>
>>>>
>>
>>>>>>> It may be related to the change in the startup script - Bob, are you
>>
>>>>
>>
>>>>>>> around? How does it work for you?
>>
>>>>
>>
>>>>>>>
>>
>>>>
>>
>>>>>>> Helena
>>
>>>>
>>
>>>>>>>
>>
>>>>
>>
>>>>>>>>
>>
>>>>
>>
>>>>>>>> Thanks.
>>
>>>>
>>
>>>>>>>> Huidae Cho
>>
>>>>
>>
>>>>>>>>
>>
>>>>
>>
>>>>>>>> _______________________________________________
>>
>>>>
>>
>>>>>>>> grass5 mailing list
>>
>>>>
>>
>>>>>>>> grass5 at grass.itc.it
>>
>>>>
>>
>>>>>>>> http://grass.itc.it/mailman/listinfo/grass5
>>
>>>>
>>
>>>>>>>
>>
>>>>
>>
>>>>>>>
>>
>>>>
>>
>>>>>
>>
>>>>
>>
>>>>>
>>
>>>
>>
>>> _______________________________________________
>>
>>> grass5 mailing list
>>
>>> grass5 at grass.itc.it
>>
>>> http://grass.itc.it/mailman/listinfo/grass5
>>
>>>
>>
>>>
>
>
>
____________________
C. Michael Barton, Professor of Anthropology
School of Human Evolution and Social Change
PO Box 872402
Arizona State University
Tempe, AZ 85287-2402
USA
Phone: 480-965-6262
Fax: 480-965-7671
www: <www.public.asu.edu/~cmbarton>
More information about the grass-dev
mailing list