[GRASS-dev] [GRASS GIS] #2074: r3.mapcalc neighborhood modifier hash table and tile errors

GRASS GIS trac at osgeo.org
Fri Oct 4 14:01:29 PDT 2013


#2074: r3.mapcalc neighborhood modifier hash table and tile errors
-------------------------+--------------------------------------------------
 Reporter:  wenzeslaus   |       Owner:  grass-dev@…              
     Type:  defect       |      Status:  new                      
 Priority:  normal       |   Milestone:  7.0.0                    
Component:  Raster3D     |     Version:  svn-trunk                
 Keywords:  r3.mapcalc   |    Platform:  All                      
      Cpu:  Unspecified  |  
-------------------------+--------------------------------------------------

Comment(by huhabla):

 It seems that putting putenv("WORKERS=1") into setup_maps() in map3.c does
 the job. Many thanks Glynn!
 Here the helgrind log:

 {{{
 GRASS 7.0.svn (nc_spm_08_grass7):~/src/grass7.0/grass_trunk > valgrind
 --tool=helgrind r3.mapcalc "new_map = (test_map[0, 0, 0] + test_map[1, 1,
 0]) / 2" --o
 ==30587== Helgrind, a thread error detector
 ==30587== Copyright (C) 2007-2011, and GNU GPL'd, by OpenWorks LLP et al.
 ==30587== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright
 info
 ==30587== Command: r3.mapcalc new_map\ =\ (test_map[0,\ 0,\ 0]\ +\
 test_map[1,\ 1,\ 0])\ /\ 2 --o
 ==30587==

 ==30587== ---Thread-Announcement------------------------------------------
 ==30587==
 ==30587== Thread #2 was created
 ==30587==    at 0x5CE2C8E: clone (clone.S:77)
 ==30587==    by 0x56DCF6F: do_clone.constprop.4 (createthread.c:75)
 ==30587==    by 0x56DE57F: pthread_create@@GLIBC_2.2.5
 (createthread.c:256)
 ==30587==    by 0x4C2DAAD: ??? (in /usr/lib/valgrind/vgpreload_helgrind-
 amd64-linux.so)
 ==30587==    by 0x508F5EC: G_init_workers (worker.c:124)
 ==30587==    by 0x405506: execute (evaluate.c:327)
 ==30587==    by 0x407201: main (main.c:158)
 ==30587==
 ==30587== ----------------------------------------------------------------
 ==30587==
 ==30587== Thread #2: lock order "0x52A0A20 before 0x65D3B90" violated
 ==30587==
 ==30587== Observed (incorrect) order is: acquisition of lock at 0x65D3B90
 ==30587==    at 0x4C2D1BE: ??? (in /usr/lib/valgrind/vgpreload_helgrind-
 amd64-linux.so)
 ==30587==    by 0x508F2B5: worker (worker.c:39)
 ==30587==    by 0x4C2DC3D: ??? (in /usr/lib/valgrind/vgpreload_helgrind-
 amd64-linux.so)
 ==30587==    by 0x56DDE99: start_thread (pthread_create.c:308)
 ==30587==
 ==30587==  followed by a later acquisition of lock at 0x52A0A20
 ==30587==    at 0x4C2E0ED: pthread_mutex_lock (in /usr/lib/valgrind
 /vgpreload_helgrind-amd64-linux.so)
 ==30587==    by 0x508F3CA: G_begin_execute (worker.c:74)
 ==30587==    by 0x404EB7: begin_evaluate (evaluate.c:107)
 ==30587==    by 0x405098: evaluate_function (evaluate.c:165)
 ==30587==    by 0x4052B6: evaluate (evaluate.c:228)
 ==30587==    by 0x404E8B: do_evaluate (evaluate.c:102)
 ==30587==    by 0x508F2D5: worker (worker.c:41)
 ==30587==    by 0x4C2DC3D: ??? (in /usr/lib/valgrind/vgpreload_helgrind-
 amd64-linux.so)
 ==30587==    by 0x56DDE99: start_thread (pthread_create.c:308)
 ==30587==
 ==30587== Required order was established by acquisition of lock at
 0x52A0A20
 ==30587==    at 0x4C2E0ED: pthread_mutex_lock (in /usr/lib/valgrind
 /vgpreload_helgrind-amd64-linux.so)
 ==30587==    by 0x508F3CA: G_begin_execute (worker.c:74)
 ==30587==    by 0x404EB7: begin_evaluate (evaluate.c:107)
 ==30587==    by 0x405098: evaluate_function (evaluate.c:165)
 ==30587==    by 0x4052B6: evaluate (evaluate.c:228)
 ==30587==    by 0x40525B: evaluate_binding (evaluate.c:210)
 ==30587==    by 0x4052C4: evaluate (evaluate.c:231)
 ==30587==    by 0x405566: execute (evaluate.c:338)
 ==30587==    by 0x407201: main (main.c:158)
 ==30587==
 ==30587==  followed by a later acquisition of lock at 0x65D3B90
 ==30587==    at 0x4C2E0ED: pthread_mutex_lock (in /usr/lib/valgrind
 /vgpreload_helgrind-amd64-linux.so)
 ==30587==    by 0x508F442: G_begin_execute (worker.c:86)
 ==30587==    by 0x404EB7: begin_evaluate (evaluate.c:107)
 ==30587==    by 0x405098: evaluate_function (evaluate.c:165)
 ==30587==    by 0x4052B6: evaluate (evaluate.c:228)
 ==30587==    by 0x40525B: evaluate_binding (evaluate.c:210)
 ==30587==    by 0x4052C4: evaluate (evaluate.c:231)
 ==30587==    by 0x405566: execute (evaluate.c:338)
 ==30587==    by 0x407201: main (main.c:158)
 ==30587==
 ==30587== ----------------------------------------------------------------
 ==30587==
 ==30587== Thread #2: pthread_cond_{signal,broadcast}: dubious: associated
 lock is not held by any thread
 ==30587==    at 0x4C2CC23: ??? (in /usr/lib/valgrind/vgpreload_helgrind-
 amd64-linux.so)
 ==30587==    by 0x508F31B: worker (worker.c:47)
 ==30587==    by 0x4C2DC3D: ??? (in /usr/lib/valgrind/vgpreload_helgrind-
 amd64-linux.so)
 ==30587==    by 0x56DDE99: start_thread (pthread_create.c:308)
 ==30587==
 ==30587== ---Thread-Announcement------------------------------------------
 ==30587==
 ==30587== Thread #1 is the program's root thread
 ==30587==
 ==30587== ----------------------------------------------------------------
 ==30587==
 ==30587== Thread #1: lock order "0x65D3B90 before 0x52A0A20" violated
 ==30587==
 ==30587== Observed (incorrect) order is: acquisition of lock at 0x52A0A20
 ==30587==    at 0x4C2E0ED: pthread_mutex_lock (in /usr/lib/valgrind
 /vgpreload_helgrind-amd64-linux.so)
 ==30587==    by 0x508F3CA: G_begin_execute (worker.c:74)
 ==30587==    by 0x404EB7: begin_evaluate (evaluate.c:107)
 ==30587==    by 0x405098: evaluate_function (evaluate.c:165)
 ==30587==    by 0x4052B6: evaluate (evaluate.c:228)
 ==30587==    by 0x40525B: evaluate_binding (evaluate.c:210)
 ==30587==    by 0x4052C4: evaluate (evaluate.c:231)
 ==30587==    by 0x405566: execute (evaluate.c:338)
 ==30587==    by 0x407201: main (main.c:158)
 ==30587==
 ==30587==  followed by a later acquisition of lock at 0x65D3B90
 ==30587==    at 0x4C2E0ED: pthread_mutex_lock (in /usr/lib/valgrind
 /vgpreload_helgrind-amd64-linux.so)
 ==30587==    by 0x508F442: G_begin_execute (worker.c:86)
 ==30587==    by 0x404EB7: begin_evaluate (evaluate.c:107)
 ==30587==    by 0x405098: evaluate_function (evaluate.c:165)
 ==30587==    by 0x4052B6: evaluate (evaluate.c:228)
 ==30587==    by 0x40525B: evaluate_binding (evaluate.c:210)
 ==30587==    by 0x4052C4: evaluate (evaluate.c:231)
 ==30587==    by 0x405566: execute (evaluate.c:338)
 ==30587==    by 0x407201: main (main.c:158)
 ==30587==
 ==30587== Required order was established by acquisition of lock at
 0x65D3B90
 ==30587==    at 0x4C2D1BE: ??? (in /usr/lib/valgrind/vgpreload_helgrind-
 amd64-linux.so)
 ==30587==    by 0x508F2B5: worker (worker.c:39)
 ==30587==    by 0x4C2DC3D: ??? (in /usr/lib/valgrind/vgpreload_helgrind-
 amd64-linux.so)
 ==30587==    by 0x56DDE99: start_thread (pthread_create.c:308)
 ==30587==
 ==30587==  followed by a later acquisition of lock at 0x52A0A20
 ==30587==    at 0x4C2E0ED: pthread_mutex_lock (in /usr/lib/valgrind
 /vgpreload_helgrind-amd64-linux.so)
 ==30587==    by 0x508F3CA: G_begin_execute (worker.c:74)
 ==30587==    by 0x404EB7: begin_evaluate (evaluate.c:107)
 ==30587==    by 0x405098: evaluate_function (evaluate.c:165)
 ==30587==    by 0x4052B6: evaluate (evaluate.c:228)
 ==30587==    by 0x404E8B: do_evaluate (evaluate.c:102)
 ==30587==    by 0x508F2D5: worker (worker.c:41)
 ==30587==    by 0x4C2DC3D: ??? (in /usr/lib/valgrind/vgpreload_helgrind-
 amd64-linux.so)
 ==30587==    by 0x56DDE99: start_thread (pthread_create.c:308)
 ==30587==
 ==30587== ----------------------------------------------------------------
 ==30587==
 ==30587== Thread #1's call to pthread_mutex_destroy failed
 ==30587==    with error code 16 (EBUSY: Device or resource busy)
 ==30587==    at 0x4C2DF2F: pthread_mutex_destroy (in /usr/lib/valgrind
 /vgpreload_helgrind-amd64-linux.so)
 ==30587==    by 0x508F696: G_finish_workers (worker.c:141)
 ==30587==    by 0x4055FC: execute (evaluate.c:350)
 ==30587==    by 0x407201: main (main.c:158)
 ==30587==
  100%
 ==30587==
 ==30587== For counts of detected and suppressed errors, rerun with: -v
 ==30587== Use --history-level=approx or =none to gain increased speed, at
 ==30587== the cost of reduced accuracy of conflicting-access information
 ==30587== ERROR SUMMARY: 12800 errors from 4 contexts (suppressed: 182683
 from 129)
 }}}

 I would like to commit the patch if there are no objections against it.

-- 
Ticket URL: <https://trac.osgeo.org/grass/ticket/2074#comment:4>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list