Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

m.nviz.image: fix checking if color raster map exists if color_map param arg was used #3139

Merged
merged 1 commit into from
Sep 8, 2023

Conversation

tmszi
Copy link
Member

@tmszi tmszi commented Sep 5, 2023

Describe the bug
Create output image with m.nviz.image elevation_map=elevation perspective=15 output=/tmp/elevation module fails if color_map param arg is not used.

To Reproduce
Steps to reproduce the behavior:

  1. Run m.nviz.image elevation_map=elevation perspective=15 output=/tmp/elevation from the emulator terminal
  2. See error
GRASS nc_spm_08_grass7/PERMANENT:~ > m.nviz.image elevation_map=elevation perspective=15 output=/tmp/elevation
Loading raster map <elevation@PERMANENT>...
 100%
Segmentation fault

Expected behavior
Create output image with m.nviz.image elevation_map=elevation perspective=15 output=/tmp/elevation module should work if color_map param arg is not used.

System description (please complete the following information):

  • Operating System: all
  • GRASS GIS version: all

Additional context

GDB debug info:

GRASS nc_spm_08_grass7/PERMANENT:~ > gdb `which m.nviz.image`
GNU gdb (Gentoo 13.2 vanilla) 13.2
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://bugs.gentoo.org/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/lib64/grass84/bin/m.nviz.image...
Reading symbols from /usr/lib/debug//usr/lib64/grass84/bin/m.nviz.image.debug...
(gdb) run  elevation_map=elevation perspective=15 output=/tmp/elevation
Starting program: /usr/lib64/grass84/bin/m.nviz.image elevation_map=elevation perspective=15 output=/tmp/elevation
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
If they do, bad things may happen!
[New Thread 0x7fffe7e7c6c0 (LWP 3602)]
[New Thread 0x7fffe753a6c0 (LWP 3603)]
[New Thread 0x7fffe6d396c0 (LWP 3604)]
[New Thread 0x7fffe65386c0 (LWP 3605)]
[New Thread 0x7fffe59376c0 (LWP 3606)]
[New Thread 0x7fffe51366c0 (LWP 3607)]
Loading raster map <elevation@PERMANENT>...
 100%

Thread 1 "m.nviz.image" received signal SIGSEGV, Segmentation fault.
0x000055555555c048 in load_rasters (params=params@entry=0x55555558f9f0, data=data@entry=0x7fffffffd2e0) at surface.c:102
102	        mapset = G_find_raster2(params->color_map->answers[i], "");

Checking if a color raster map exists should be done if the color_map parameter arg is used.

@tmszi tmszi added bug Something isn't working C Related code is in C backport to 8.3 labels Sep 5, 2023
@tmszi tmszi added this to the 8.3.1 milestone Sep 5, 2023
@tmszi
Copy link
Member Author

tmszi commented Sep 5, 2023

Centos 7 CI fails due PR #3138.

@tmszi tmszi requested a review from neteler September 5, 2023 10:55
@tmszi tmszi force-pushed the m_nviz_image-fix-check-color_map-exists branch from f9d31b7 to c718e71 Compare September 8, 2023 03:48
@tmszi
Copy link
Member Author

tmszi commented Sep 8, 2023

Rebase c718e71.

@tmszi tmszi merged commit 738b29c into OSGeo:main Sep 8, 2023
18 checks passed
tmszi added a commit to tmszi/grass that referenced this pull request Sep 8, 2023
tmszi added a commit to tmszi/grass that referenced this pull request Sep 8, 2023
tmszi added a commit to tmszi/grass that referenced this pull request Sep 8, 2023
@tmszi tmszi deleted the m_nviz_image-fix-check-color_map-exists branch September 8, 2023 13:11
landam pushed a commit to landam/grass that referenced this pull request Oct 25, 2023
neteler pushed a commit to nilason/grass that referenced this pull request Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working C Related code is in C
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants