Opened 12 years ago

Closed 11 years ago

#1710 closed defect (fixed)

Segfault in r.proj

Reported by: huhabla Owned by: grass-dev@…
Priority: major Milestone: 7.0.0
Component: Raster Version: svn-trunk
Keywords: r.proj, openmp Cc:
CPU: x86-64 Platform: Linux

Description

I have found a reproducible but irregular appearing segfault in r.proj when using several threads. Looks like an OpenMP race condition? This error is not reproducible with OMP_NUM_THREADS=1.

Here the gdb output and backtrace

GRASS 7.0.svn (ECAD):~/Geostat > gdb r.proj
(gdb) r input=g250_06 location="Corine LAEA ETRS89" mapset=PERMANENT --o

Input:
Cols: 23600 (23600)
Rows: 18400 (18400)
North: 5500000.000000 (5500000.000000)
South: 900000.000000 (900000.000000)
West: 1500000.000000 (1500000.000000)
East: 7400000.000000 (7400000.000000)
EW-res: 250.000000
NS-res: 250.000000

Output:
Cols: 23600 (23600)
Rows: 18400 (18400)
North: 58.952751 (58.952751)
South: 26.415806 (26.415806)
West: -18.236960 (-18.236960)
East: 72.906137 (72.906137)
EW-res: 0.003862
NS-res: 0.001768

Allocating memory and reading input map...
 100%
Projecting...
[New Thread 0x7fffeb099700 (LWP 18304)]
[New Thread 0x7fffea898700 (LWP 18305)]
[New Thread 0x7fffea097700 (LWP 18306)]
  27%
Program received signal SIGSEGV, Segmentation fault.
0x0000000000402bae in p_nearest (ibuffer=0x60daf0, obufptr=0x655c5c, cell_type=0, col_idx=4619.2086762076688, row_idx=8957.466116201218, cellhd=0x7fffffffd550) at nearest.c:33
33          cell = CVAL(ibuffer, row, col);
(gdb) bt
#0  0x0000000000402bae in p_nearest (ibuffer=0x60daf0, obufptr=0x655c5c, cell_type=0, col_idx=4619.2086762076688, row_idx=8957.466116201218, cellhd=0x7fffffffd550) at nearest.c:33
#1  0x00000000004050f2 in main.omp_fn.0 (.omp_data_i=0x7fffffffd8c0) at main.c:517
#2  0x0000000000404b31 in main (argc=5, argv=0x7fffffffdb68) at main.c:496

Change History (4)

comment:1 by martinl, 12 years ago

Keywords: r.proj openmp added

in reply to:  description comment:2 by mmetz, 12 years ago

Replying to huhabla:

I have found a reproducible but irregular appearing segfault in r.proj when using several threads. Looks like an OpenMP race condition? This error is not reproducible with OMP_NUM_THREADS=1.

I have disabled parallelization in r52882. It worked in my tests, but that was apparently pure luck. Maybe a separate cache for each thread is needed.

Markus M

comment:3 by martinl, 11 years ago

Can we close this ticket than?

comment:4 by neteler, 11 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.