[GRASS-dev] Re: [GRASS GIS] #97: r.random fails with bus error on Mac OS X 10.5

GRASS GIS trac at osgeo.org
Wed Mar 19 00:56:43 EDT 2008

#97: r.random fails with bus error on Mac OS X 10.5
  Reporter:  cmbarton  |       Owner:  grass-dev at lists.osgeo.org
      Type:  defect    |      Status:  new                      
  Priority:  critical  |   Milestone:  6.3.0                    
 Component:  default   |     Version:  unspecified              
Resolution:            |    Keywords:  r.random Mac             
Comment (by glynn):

 Replying to [comment:1 kyngchaos]:
 > verified bus error on Leopard and OK on tiger, SVN 3/8.  Here is the
 thread trace from the crashlog:
 > {{{
 > Thread 0 Crashed:
 > 0   r.random                          0x000021a7 set_max + 103
 > 1   r.random                          0x00002498 get_stats + 686
 > }}}

 I don't know if it's related to the crash, but the way that the RASTER_PTR
 union is used in get_stats violates ANSI C aliasing rules. Specifically,
 the code stores a pointer in data.v but then uses data.[cfd]. Because
 those fields have different types, the compiler is entitled to treat the
 fields as distinct, even though they overlap. E.g. if it has a copy of
 data.c in a register, and you modify data.v, references to data.c may
 still use the value stored in the register.

 As for the crash, we really need at least a proper backtrace with argument
 values, and ideally the values of any relevant variables.

Ticket URL: <http://trac.osgeo.org/grass/ticket/97#comment:2>
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

More information about the grass-dev mailing list