Bug 101448

Summary: g++ exceptions broken in libjpeg error callbacks
Product: [Retired] Red Hat Linux Reporter: Vladimir Vukicevic <vladimir>
Component: libjpegAssignee: Matthias Clasen <mclasen>
Status: CLOSED CANTFIX QA Contact:
Severity: high Docs Contact:
Priority: medium    
Version: 9CC: gizmo, mattdm, shaver
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-01-02 19:08:03 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Vladimir Vukicevic 2003-08-01 07:12:31 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3.1) Gecko/20030530

Description of problem:
This seems to be related to this gcc bug:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9265

However, I'm specifically running into it with libjpeg, so I'm filing this bug
against libjpeg -- please refile against whatever is more appropriate.  This bug
is probably not limited to libjpeg.

Package versions:
libjpeg-6b-26
gcc-3.2.2-5
gcc-c++-3.2.2-5
libstdc++-3.2.2-5
glibc-2.3.2-27.9

The attached program aborts unexpectedly when the throw is executed in the error
handler.  If the libjpeg rpm is rebuilt with CC="g++ -x c++", so that it obtains
the GNU_EH_FRAME info (as reported by readelf -l libjpeg.so.62.0.0), the program
correctly prints "Exception caught!".

Sample program:

Compile with "gcc -o jpegbug jpegbug.c -ljpeg -lstdc++"

----- jpegbug.cpp -----

#include <stdio.h>
#include <jpeglib.h>
                                                                                
static void
my_error_exit (j_common_ptr cinfo)
{
    throw cinfo;
}
                                                                                
int
main (int argc, char **argv)
{
    struct jpeg_decompress_struct cinfo;
    struct jpeg_error_mgr jerr;
    FILE *infile;
                                                                                
    infile = fopen ("/dev/null", "rb");
                                                                                
    cinfo.err = jpeg_std_error(&jerr);
    jerr.error_exit = my_error_exit;
                                                                                
    try {
        jpeg_create_decompress(&cinfo);
        jpeg_stdio_src(&cinfo, infile);
        jpeg_read_header(&cinfo, TRUE);
    } catch (j_common_ptr cptr) {
        fprintf (stderr, "Exception caught!\n");
    }
}

------ end jpegbug -------

Version-Release number of selected component (if applicable):
See above

How reproducible:
Always

Comment 1 Vladimir Vukicevic 2003-08-22 08:44:52 UTC
ping?  or should I refile against g++?

Comment 2 Mike Shaver 2003-09-12 05:07:44 UTC
Hello?

Comment 3 christian koestlin 2005-10-09 15:05:48 UTC
hello is there still anyody around?
i have the same problem on a different platform. any resolutions?
(i get terminate called after throwing an instance of 'Exception', wheras Exception is the c+
+exceptionclass i throw in the libjpeg error handler)

Comment 4 Bill Nottingham 2006-08-05 04:52:38 UTC
Red Hat apologizes that these issues have not been resolved yet. We do want to
make sure that no important bugs slip through the cracks.

Red Hat Linux 7.3 and Red Hat Linux 9 are no longer supported by Red Hat, Inc.
They are maintained by the Fedora Legacy project (http://www.fedoralegacy.org/)
for security updates only. If this is a security issue, please reassign to the
'Fedora Legacy' product in bugzilla. Please note that Legacy security update
support for these products will stop on December 31st, 2006.

If this is not a security issue, please check if this issue is still present
in a current Fedora Core release. If so, please change the product and version
to match, and check the box indicating that the requested information has been
provided.

If you are currently still running Red Hat Linux 7.3 or 9, please note that
Fedora Legacy security update support for these products will stop on December
31st, 2006. You are strongly advised to upgrade to a current Fedora Core release
or Red Hat Enterprise Linux or comparable. Some information on which option may
be right for you is available at http://www.redhat.com/rhel/migrate/redhatlinux/.

Any bug still open against Red Hat Linux 7.3 or 9 at the end of 2006 will be
closed 'CANTFIX'. Again, if this bug still exists in a current release, or is a
security issue, please change the product as necessary. We thank you for your
help, and apologize again that we haven't handled these issues to this point.


Comment 6 Bill Nottingham 2007-01-02 19:08:03 UTC
Red Hat Linux 7.3 and Red Hat Linux 9 are no longer supported by Red Hat, Inc.
f you are currently still running Red Hat Linux 7.3 or 9, you are strongly
advised to upgrade to a current Fedora Core release or Red Hat Enterprise Linux
or comparable. Some information on which option may be right for you is
available at http://www.redhat.com/rhel/migrate/redhatlinux/.

Closing as CANTFIX.