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

v.to.rast segfault converting points #3105

Open
marisn opened this issue Jul 28, 2023 · 3 comments · May be fixed by #3440
Open

v.to.rast segfault converting points #3105

marisn opened this issue Jul 28, 2023 · 3 comments · May be fixed by #3440
Labels
bug Something isn't working C Related code is in C vector Related to vector data processing
Milestone

Comments

@marisn
Copy link
Contributor

marisn commented Jul 28, 2023

The issue is reproduceable, reason unknown. At the moment just taking a note, will look into this at some point later.

#0  0x0000000000000000 in ?? ()
#1  0x00007ffff7ede221 in G_plot_point (east=<optimized out>, north=<optimized out>) at plot.c:195
#2  0x0000555555558d49 in plot_points (n=<optimized out>, y=<optimized out>, x=<optimized out>)
    at do_lines.c:206
#3  do_lines (Map=Map@entry=0x7fffffffcd10, Points=Points@entry=0x5555555ada10, 
    Cvarr=Cvarr@entry=0x7fffffffccf0, ctype=ctype@entry=0, 
    field=field@entry=1, cat_list=cat_list@entry=0x0, use=4, value=value@entry=1, value_type=0,
    feature_type=1, count_all=0x7fffffffccec, dense=1) at do_lines.c:134
#4  0x000055555555b049 in vect_to_rast (vector_map=0x5555555a8850 "fosso_punti", raster_map=0x5555555a8890
    "fosso_dem", field_name=<optimized out>, column=0x0, cache_mb=cache_mb@entry=300,
    use=use@entry=4, value=value@entry=1, value_type=0, rgbcolumn=0x0, 
    labelcolumn=0x0, ftype=1, where=0x0, cats=0x0, dense=1) at vect2rast.c:179
#5  0x0000555555557c09 in main (argc=<optimized out>, argv=<optimized out>) at main.c:165
==7669== Jump to the invalid address stated on the next line
==7669==    at 0x0: ???
==7669==    by 0x4952220: G_plot_point (plot.c:195)
==7669==    by 0x10CD48: plot_points (do_lines.c:206)
==7669==    by 0x10CD48: do_lines (do_lines.c:134)
==7669==    by 0x10F048: vect_to_rast (vect2rast.c:179)
==7669==    by 0x10BC08: main (main.c:165)
==7669==  Address 0x0 is not stack'd, malloc'd or (recently) free'd

First reported on the ml by bonushenricus
https://lists.osgeo.org/pipermail/grass-user/2023-July/083373.html

@marisn marisn added bug Something isn't working vector Related to vector data processing C Related code is in C labels Jul 28, 2023
@HuidaeCho
Copy link
Member

HuidaeCho commented Feb 20, 2024

To reproduce this error,

grass -c epsg:32632 /tmp/grasstmp
cat <<EOT > fosso.dat
687244.011,4910560.273,482.096
687240.364,4910558.058,482.109
687236.976,4910556.868,482.224
687233.285,4910555.428,482.328
687229.403,4910553.534,482.447
687224.965,4910551.415,482.629
687220.509,4910549.32,482.71
687216.282,4910546.997,482.89
687211.919,4910544.472,483.09
687208.558,4910542.642,483.261
687204.914,4910540.584,483.411
687204.912,4910540.58,483.32
687204.91,4910540.585,483.318
687200.661,4910538.442,483.673
687196.32,4910536.328,483.925
687191.518,4910534.29,484.293
687186.415,4910532.11,484.606
687181.112,4910530.163,484.737
687175.282,4910528.125,484.931
687169.458,4910526.233,485.236
687165.078,4910524.769,485.454
687160.04,4910522.885,485.697
687155.365,4910521.006,485.94
687151.164,4910519.457,486.282
687146.398,4910517.688,486.647
687141.874,4910515.805,487
687136.644,4910513.793,487.386
687132.068,4910512.125,487.659
687127.667,4910510.478,487.808
687122.314,4910508.022,487.879
687118.571,4910505.605,488.063
687114.031,4910501.636,488.301
687110.273,4910498.216,488.499
687108.325,4910496.676,488.602
687104.514,4910493.377,488.952
687101.82,4910491.029,489.219
687098.956,4910488.78,489.501
687096.126,4910486.848,489.734
687093.251,4910484.774,489.993
687088.748,4910482.092,490.242
687084.967,4910480.104,490.434
687080.853,4910478.109,490.631
687079.416,4910477.4,490.858
NaN,NaN,NaN
687034.891,4910501.481,486.212
687036.539,4910499.803,486.445
687038.564,4910497.364,486.72
687041.869,4910494.061,487.317
687046.279,4910490.702,487.837
687051.119,4910486.971,488.42
687056.483,4910483.767,488.936
687062.8,4910480.263,489.641
687068.777,4910477.408,490.42
687075.301,4910474.554,491.299
687082.093,4910471.638,492.264
EOT
v.in.lines -z --overwrite input=fosso.dat output=fosso_linea separator=comma
g.region vector=fosso_linea res=0.2
v.split input=fosso_linea output=fosso_linea_split length=0.2
v.to.points -i input=fosso_linea_split output=fosso_punti
v.to.rast -d input=fosso_punti type=point output=fosso_dem use=z

@HuidaeCho
Copy link
Member

HuidaeCho commented Feb 20, 2024

You cannot densify points (doesn't make sense). -d is for densifying lines. This error occurs because -d uses its own setup_plot() for line densification, but type=point calls G_plot_points() in plot_points(), which requires G_setup_plot().

@HuidaeCho
Copy link
Member

@marisn Please try #3440.

@echoix echoix added this to the 8.4.0 milestone Mar 11, 2024
@echoix echoix modified the milestones: 8.4.0, 8.4.1 Jun 10, 2024
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 vector Related to vector data processing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants