[webkit-dev] Windows setjmp/longjmp issue

SCU Rock scurock at gmail.com
Tue Apr 27 22:30:31 PDT 2010

Hi Peter,

   Thanks for your reply, which cleared my concern. And with help from
another forum,I was able to identify the cause of the crash. It is caused by
an incompatibility of definition of "boolean" between my WebKit library
built and libjpeg. For your reference, the same bug is shown at
https://bugzilla.redhat.com/show_bug.cgi?id=497492. Incidentally, the crash
that this bug caused showed an exception point at setjmp() on my gdb

   I believe that many people do not see this problem because their build or
runtime environment may have avoided such inconsistency.


On Tue, Apr 27, 2010 at 9:34 PM, Peter Kasting <pkasting at google.com> wrote:

> On Tue, Apr 27, 2010 at 2:33 PM, SCU Rock <scurock at gmail.com> wrote:
>>    In WebCore/platform/image-
>> decoders/jpeg/JPEGImageDecoder.cpp (
>> https://trac.webkit.org/browser/trunk/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp)
>> and png/PNGImageDecoder.cpp, setjmp and longjmp are called. This causes this
>> code unportable to Windows environment. At
>> http://msdn.microsoft.com/en-us/library/xe7acxfb%28VS.80%29.aspx, it is
>> mentioned that "setjmp and longjmp do not support C++ object semantics".
> I believe that means that things like stack-allocated objects may not be
> destroyed correctly (as opposed to when using C++ exceptions, which can make
> more guarantees about object destruction).  At the locations in question,
> there are no C++ objects in the current stack frame (and the JPEG and PNG
> decoding libraries are C code).  Thus I don't believe there should be any
> problem here.  A key design goal of C++ is making sure that well-formed C
> programs still operate the same way, and thus it is certainly untrue that
> any usage of setjmp() and longjmp() within an ostensibly-C++ program will
> inherently cause crashes.
> My understanding is that WebKit has been ported to Windows for three years.
>> Can someone educate me on how current Chrome and Safari work on Windows? Why
>> does such a basic problem exist but without being seen? Do they use the
>> above image decoder files? I tried to run a program linked with a prebuilt
>> Windows WebKit library and it crashes at setjmp() when accessing a jpeg
>> file. Can this problem be fixed?
> I have no idea what prebuilt Windows library you may have used or what kind
> of crash you may have seen.  Chromium uses the above files on Windows
> without issue (note that we compile with C++ exceptions disabled).   Brent
> Fulgham's Cairo-based Windows port also uses these without problem.
> PK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20100427/479ae47c/attachment.html>

More information about the webkit-dev mailing list