Opened 12 years ago

Closed 11 years ago

#97 closed defect (fixed)

r.random fails with bus error on Mac OS X 10.5

Reported by: cmbarton Owned by: grass-dev@…
Priority: critical Milestone: 6.4.0
Component: Default Version: unspecified
Keywords: r.random Mac Cc:
CPU: Unspecified Platform: MacOSX

Description

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

Change History (6)

comment:1 Changed 12 years ago 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

comment:2 in reply to:  1 Changed 12 years ago by glynn

Replying to 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.

comment:3 Changed 12 years ago by kyngchaos

Just tested on current SVN and no crash. Michael?

comment:4 Changed 12 years ago by neteler

Milestone: 6.3.06.4.0

comment:5 Changed 11 years ago by neteler

CPU: Unspecified
Platform: MacOSX

comment:6 Changed 11 years ago by cmbarton

Resolution: fixed
Status: newclosed

Tested with GRASS 6.4. No problems

Note: See TracTickets for help on using tickets.