#1073: G_fatal_error segfault outside of GRASS session
-----------------------+----------------------------------------------------
Reporter: kyngchaos | Owner: grass-dev@lists.osgeo.org
Type: defect | Status: new
Priority: normal | Milestone: 6.4.0
Component: default | Version: 6.4.0 RCs
Keywords: | Platform: MacOSX
Cpu: OSX/Intel |
-----------------------+----------------------------------------------------
When any module is run outside of a GRASS session, G_fatal_error itself
segfaults. This causes a loop for a while until the system gives up.
From the OSX crashlog:
{{{
OS Version: Mac OS X 10.6.3 (10D573)
Report Version: 6
Replying to [ticket:1073 kyngchaos]:
> When any module is run outside of a GRASS session, G_fatal_error itself
segfaults. This causes a loop for a while until the system gives up.
In 7.0, r40465 was made to protect against infinite recursion. At that
time, it was determined that the issue couldn't arise with 6.x, but either
that was incorrect or something has changed.
AFAICT, the issue is due to log_error calling G_gisbase(); I have no idea
why it's doing this, as it uses the result as a truth value, but
G_gisbase() ends up calling G_fatal_error() if GISBASE is unset.
In any case, something similar to r40465 will work for 6.x.
I get a complaint about "error while loading shared libraries, cannot open
shared object file: No such file or directory" if I try to run a C module
outside of a GRASS session.
> I get a complaint about "error while loading shared libraries, cannot
open shared object file: No such file or directory" if I try to run a C
module outside of a GRASS session.
That's to be expected; the loader needs LD_LIBRARY_PATH (DYLD_LIBRARY_PATH
on OSX, PATH on Windows) to be set in order to locate the GRASS libraries.
To check for this specific issue, either set PATH and LD_LIBRARY_PATH
(etc) manually, or start a GRASS session then manually unset GISBASE and
GISRC with:
{{{
export -n GISBASE GISRC
}}}
Replying to [comment:1 glynn]:
> Replying to [ticket:1073 kyngchaos]:
> > When any module is run outside of a GRASS session, G_fatal_error
itself segfaults. This causes a loop for a while until the system gives
up.
>
> In 7.0, r40465 was made to protect against infinite recursion. At that
time, it was determined that the issue couldn't arise with 6.x, but either
that was incorrect or something has changed.
Backported to 6.5.svn in r52774. Still open for 6.4.svn.
Replying to [comment:4 neteler]:
> Replying to [comment:1 glynn]:
> > Replying to [ticket:1073 kyngchaos]:
> > > When any module is run outside of a GRASS session, G_fatal_error
itself
> > > segfaults. This causes a loop for a while until the system gives
up.
> >
> > In 7.0, r40465 was made to protect against infinite recursion. At that
time, it
> > was determined that the issue couldn't arise with 6.x, but either
that was
> > incorrect or something has changed.
>
> Backported to 6.5.svn in r52774. Still open for 6.4.svn.