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

#97: r.random fails with bus error on Mac OS X 10.5
--------------------------+-------------------------------------------------
Reporter: cmbarton | Owner: grass-dev@lists.osgeo.org
     Type: defect | Status: new
Priority: critical | Milestone: 6.3.0
Component: default | Version: unspecified
Keywords: r.random Mac |
--------------------------+-------------------------------------------------
I just learned that r.random fails completely on OS X 10.5. It is working
on my OS X 10.4 PowerBook. it fails to create either raster or vector
points and exits with a bus error. Try making points from the Spearfish
elevation.10m map.

Michael

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/97&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

#97: r.random fails with bus error on Mac OS X 10.5
-----------------------+----------------------------------------------------
  Reporter: cmbarton | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: critical | Milestone: 6.3.0
Component: default | Version: unspecified
Resolution: | Keywords: r.random Mac
-----------------------+----------------------------------------------------
Comment (by 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
2 r.random 0x00002898 main + 615
3 r.random 0x0000206a start + 54
}}}

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

#97: r.random fails with bus error on Mac OS X 10.5
-----------------------+----------------------------------------------------
  Reporter: cmbarton | Owner: grass-dev@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&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

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

Just tested on current SVN and no crash. Michael?

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

I can't test on 10.5 until I get back in town next week.

Michael

On 4/16/08 7:14 AM, "GRASS GIS" <trac@osgeo.org> wrote:

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

Just tested on current SVN and no crash. Michael?

__________________________________________
Michael Barton, Professor of Anthropology
Director of Graduate Studies
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

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

  * milestone: 6.3.0 => 6.4.0

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

#97: r.random fails with bus error on Mac OS X 10.5
-----------------------+----------------------------------------------------
  Reporter: cmbarton | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: critical | Milestone: 6.4.0
Component: default | Version: unspecified
Resolution: | Keywords: r.random Mac
  Platform: MacOSX | Cpu: Unspecified
-----------------------+----------------------------------------------------
Changes (by neteler):

  * platform: => MacOSX
  * cpu: => Unspecified

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

#97: r.random fails with bus error on Mac OS X 10.5
-----------------------+----------------------------------------------------
  Reporter: cmbarton | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: closed
  Priority: critical | Milestone: 6.4.0
Component: default | Version: unspecified
Resolution: fixed | Keywords: r.random Mac
  Platform: MacOSX | Cpu: Unspecified
-----------------------+----------------------------------------------------
Changes (by cmbarton):

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

Comment:

Tested with GRASS 6.4. No problems

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