#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.
#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.
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