Bug 115305

Summary: Segmentation fault for Apache on RH AS 2.1 : bad gcc exception handling
Product: Red Hat Enterprise Linux 2.1 Reporter: Albin Debeaupuis <albin.debeaupuis>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 2.1CC: bnocera
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-10-30 10:15:14 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:
Attachments:
Description Flags
standalone prg
none
out file none

Description Albin Debeaupuis 2004-02-10 15:26:19 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.5)
Gecko/20031007

Description of problem:
We're running an php/apache server (installed with rpm pkg, apache
1.3.27 and php 4.3.2) with fast-cgi module (2.4.0) on a RH AS 2.1.

We were using gcc-2.96-118.7.2 and we got in the apache error log the
following errors:
"
[Fri Jan 30 12:29:26 2004] [notice] child pid 2672 exit signal Aborted (6)
[Fri Jan 30 12:29:29 2004] [notice] child pid 2673 exit signal
Segmentation fault (11)
"
 
After investigation, our development team pointed out a problem with
gcc handling exceptions.
 
We then installed gcc-2.96-124.7.2. And we still have problems
"
[Mon Feb 9 16:47:35 2004] [warn] FastCGI: (dynamic) server
"/var/www/fcgi-bin/mpim_admin.fcgi" (pid 1168) termination signaled
[Mon Feb 9 16:47:35 2004] [warn] FastCGI: (dynamic) server
"/var/www/fcgi-bin/mpim_admin.fcgi" (pid 1168) terminated due to
uncaught signal '15' (Terminated)
[Mon Feb 9 16:52:39 2004] [warn] FastCGI: (dynamic) server
"/var/www/fcgi-bin/mpim_admin.fcgi" (pid 1167) termination signaled
[Mon Feb 9 16:52:39 2004] [warn] FastCGI: (dynamic) server
"/var/www/fcgi-bin/mpim_admin.fcgi" (pid 1167) terminated due to
uncaught signal '15' (Terminated)
[Mon Feb 9 16:53:05 2004] [notice] child pid 680 exit signal
Segmentation fault (11)
"


Version-Release number of selected component (if applicable):
gcc-2.96-124.7.2 

How reproducible:
Sometimes

Steps to Reproduce:

// code sample

1. // we try something which could potentially raise a SAException

    try {
    
            SACommand cmd(
                    connection,
                    "select acc_prsid, acc_title, acc_name,
acc_firstname, acc_email, acc_telephone, acc_mobile, acc_login,
acc_pwd, acc_active, acc_server_account, acc_sync, acc_notif \
                            from accounts where acc_prsid=:1");
    
            cmd.Param(1).setAsLong()=key;
    
            cmd.Execute();
            //Get data back
    
            if (cmd.FetchNext()) {
                    accountInformation.accountInformationId = key;
                    assign(accountInformation,cmd);
            } else {
                    std::cerr<<"personDAO.read CATCH"<<std::endl;

2. // we throw an exception from inside a try/catch and we got
"exception fault" randomly
                    throw Exception(NOT_FOUND);
            }
    
    } catch(SAException &x) {

            throw DAOException(x);
    }
return true;


Actual Results:  Segmentation fault (11)

Additional info:

it looks like this bug :
http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=54724

Comment 2 Bastien Nocera 2004-02-11 09:14:39 UTC
As discussed on the phone, we would need a stand-alone test case to
reproduce the problem before we can assess whether or not a bug is
present in gcc.

Comment 3 Albin Debeaupuis 2004-02-11 17:00:04 UTC
Created attachment 97585 [details]
standalone prg

error occurs when exception called in catch block

Comment 4 Albin Debeaupuis 2004-02-11 17:01:43 UTC
Created attachment 97586 [details]
out file

compiled with gcc main.cpp -lstdc++

Comment 5 Bastien Nocera 2004-02-11 17:25:27 UTC
I don't see what the problem is with this. The second exception thrown
is not caught by any handler, so the program will abort as it should.

Comment 6 Richard Henderson 2004-10-04 21:02:56 UTC
Indeed, the standalone application in comment #3 *should* fail.

As for the original log message,

"/var/www/fcgi-bin/mpim_admin.fcgi" (pid 1168) terminated due to
uncaught signal '15' (Terminated)

is not by itself an exception handling issue.  Signal 15 is SIGTERM,
which is generated in one of two ways: (1) by a user with the "kill"
program, or (2) the kernel's out-of-memory handler.

Without more information, I do not see how these are related.

Comment 7 Jakub Jelinek 2004-10-30 10:15:14 UTC
If you have more information, please reopen.