On Wed, 2011-11-09 at 00:36 +0900, NARUSE, Yui wrote:
> 2011/11/8 Svante Signell <svante.signell / telia.com>:
> > I'm working on porting packages having PATH_MAX issues and ruby1.9.1 is
> > one of them. PATH_MAX is not defined for GNU/Hurd. The code analysis
> > below shows that it would be possible to use dynamic allocation of the
> > buffer binary_filename using malloc and free.
> >
> > However, Samuel Thibault, a large contributor to GNU/Hurd and a Debiab
> > Developer, advised me to ask here is it is possible or if a
> > fixed-length buffer should be used? Especially if it is safe to call
> > rb_dump_backtrace_with_lines from a *Unix* signal handler.
> >
> > So if dynamic allocation is not possible, can you in the next release
> > provide a conditional definition of PATH_MAX?
> >
> > #ifndef PATH_MAX
> > #define PATH_MAX 4096
> > #endif
> 
> I committed in r33675.

Thanks!

> >> > Below is a patch attempt to solve the PATH_MAX issue on the latest
> >> > ruby1.9.1.
> 
> This means trunk branch of ruby repo?

The code I compiled is the latest one in Debian experimental a while
ago: ruby1.9.1-1.9.3~rc1-1. Now the latest version in unstable seems to
be: 1.9.3.0-1

> > Code analysis follows below:
> 
> You may already noticed, following codes are run when the program is
> crashed like segv.
> On such situation, it hardly use malloc.

OK, so a fixed-length buffer is the only solution. Thanks!