[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft-devel] Crash because of invalid use of setjmp

From: Henrik Grubbström
Subject: Re: [ft-devel] Crash because of invalid use of setjmp
Date: Mon, 14 Aug 2006 19:07:44 +0200 (CEST)

On Tue, 15 Aug 2006, address@hidden wrote:


On Mon, 14 Aug 2006 08:27:28 -0700 (PDT)
Jens Claudius <address@hidden> wrote:
on my system ftvalid crashes when I run it on SIL Charis (get it from

So it seems that we cannot encapsulate setjmp() within a function. Indeed, if
I replace the function declaration of ft_validator_run() with a macro
like this

#define ft_validator_run( valid ) setjmp( (valid)->jump_buffer )

The above hints that the original ft_validator_run() function returns, which will invalidate the state saved by the call to setjmp(). From the setjmp(3C) manpage on Linux/Gentoo (similar on many other OSes):

       The stack context will be invalidated if the function which called
       setjmp() returns.

the crash is gone.

I would check in this change to CVS, but I_d like to know first why it
wasn_t done this way before. Are there compatibility problems with
systems that don_t have (working) setjmp/longjmp?

Thank you for finding the bug.

The original implementation of ft_validator_run was introduced
as a part of (PS-)CMap handler (before ftvalid), 2002-03-22
(raw setjmp() was used).

At present, ft_validator_run() is only used by otvalid/gxvalid.
Unfortunately, the platforms of ftvalid maintainers (Masatake
Yamato and me) are quite limited: Linux/i386 and a few Mac OS X,
thus the bug does not appear. Yet I'm not sure of the intention
of original author, give me a few weeks. If urgent fix is required,
I will write a patch for configure to check ft_validator_run()
works well and replace ft_setjmp() if does not work.

Having ft_validator_run() be a function can not be trusted on any platform.


Henrik Grubbström                                       address@hidden
Roxen Internet Software AB                              address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]