[GRASS-dev] [GRASS GIS] #1680: r.proj w/ OpenMP segfaults

#1680: r.proj w/ OpenMP segfaults
----------------------------+-----------------------------------------------
Reporter: hamish | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Raster | Version: svn-trunk
Keywords: r.proj, openmp | Platform: Linux
      Cpu: x86-64 |
----------------------------+-----------------------------------------------
Hi,

just trying r.proj in trunk with OpenMP support. Allocation of memory
works fine, then it roars into life on all processors, but after 20 sec or
so it segfaults.

partial gdb session:
{{{
Allocating memory and reading input map...
  100%
Projecting...
[New Thread 0x7fffecb6f700 (LWP 22162)]
[New Thread 0x7fffec36e700 (LWP 22163)]
[New Thread 0x7fffebb6d700 (LWP 22164)]
[New Thread 0x7fffeb36c700 (LWP 22165)]
[New Thread 0x7fffeab6b700 (LWP 22166)]
   90%
Program received signal SIGSEGV, Segmentation fault.
0x00000000004064fe in p_nearest (ibuffer=0x60d1b0, obufptr=0x628804,
cell_type=1, col_idx=270.09924849952966,
     row_idx=15568.366738961817, cellhd=0x7fffffffd870) at nearest.c:33
33 cell = CVAL(ibuffer, row, col);

(gdb) bt
#0 0x00000000004064fe in p_nearest (ibuffer=0x60d1b0, obufptr=0x628804,
cell_type=1, col_idx=270.09924849952966,
     row_idx=15568.366738961817, cellhd=0x7fffffffd870) at nearest.c:33
#1 0x00000000004063a7 in main.omp_fn.0 (.omp_data_i=0x7fffffffdbe0) at
main.c:517
#2 0x0000000000405dfd in main (argc=5, argv=0x7fffffffde98) at main.c:496

(gdb) list
28 if (row < 0 || row >= cellhd->rows || col < 0 || col >=
cellhd->cols) {
29 Rast_set_null_value(obufptr, 1, cell_type);
30 return;
31 }
32
33 cell = CVAL(ibuffer, row, col);
34
35 if (Rast_is_f_null_value(&cell)) {
36 Rast_set_null_value(obufptr, 1, cell_type);
37 return;

(gdb) bt full
...
         obuffer = 0x628680
         ibuffer = 0x60d1b0
...
         row = 16068
         col = 3137560
         irows = 16801
         icols = 15601
         orows = 17353
         ocols = 15380
...
}}}

The column count seems a bit wacky:
  '' col = 3137560 ''

I don't know if it means anything, but note that value is just over 200 *
icols.

?,
Hamish

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1680&gt;
GRASS GIS <http://grass.osgeo.org>

#1680: r.proj w/ OpenMP segfaults
---------------------+------------------------------------------------------
  Reporter: hamish | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.0.0
Component: Raster | Version: svn-trunk
Resolution: fixed | Keywords: r.proj, openmp
  Platform: Linux | Cpu: x86-64
---------------------+------------------------------------------------------
Changes (by neteler):

  * status: new => closed
  * resolution: => fixed

Comment:

In r52882 the openMP parallelization has been disabled, see also trac
#1710.

Closing.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1680#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>