[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::c_plus_plus

Title:C++
Notice:Read 1.* and use keywords (e.g. SHOW KEY/FULL KIT_CXX_VAX_VMS)
Moderator:DECCXX::AMARTIN
Created:Fri Nov 06 1987
Last Modified:Thu Jun 05 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:3604
Total number of notes:18242

3539.0. "Stack overflow DEC C++ V5.5-004 Digital UNIX 4.0a" by AXPBIZ::MOEHLENPAH () Wed Apr 16 1997 19:14

This bug while working on a next generation server product at Netscape...
There is a workaround, demonstrated in the code sample below.

Ed


Return-Path: daemon
Received: from pobox1 by cobra.pa.dec.com; (5.65v3.2/1.1.8.2/03Sep96-0148PM)
	id AA28450; Wed, 16 Apr 1997 13:14:36 -0700
Received: by pobox1.pa.dec.com; id AA04821; Wed, 16 Apr 97 13:14:34 -0700
Received: from h-205-217-236-195.netscape.com by mail1.digital.com (5.65 EXP 4/12/95 for V3.2/1.0/WV)
	id AA12639; Wed, 16 Apr 1997 13:09:51 -0700
Received: from deccapp1.mcom.com ([127.0.0.1]) by deccapp1.mcom.com
          (Netscape Mail Server v2.02) with SMTP id AAA1154;
          Wed, 16 Apr 1997 13:09:29 -0700
Sender: [email protected]
Message-Id: <[email protected]>
Date: Wed, 16 Apr 1997 13:09:29 -0700
From: Ed Moehlenpah <[email protected]>
Organization: Digital
X-Mailer: Mozilla 3.0Gold (X11; I; OSF1 V4.0 alpha)
Mime-Version: 1.0
To: [email protected]
Subject: [Fwd: cxx compiler crash report]
Content-Type: multipart/mixed; boundary="------------6488773C6F59"

This is a multi-part message in MIME format.

--------------6488773C6F59
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

-- 
Ed M. [email protected]   [email protected]
415-937-5276 (netscape) 415-617-3506 (Digital)
Onsite Engineering Manager for Digital

--------------6488773C6F59
Content-Type: message/rfc822
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Return-Path: <[email protected]>
Received: from netscape.com ([205.217.237.46]) by judge.mcom.com
          (Netscape Mail Server v2.02) with ESMTP id AAA26231
          for <[email protected]>; Wed, 16 Apr 1997 12:46:14 -0700
Received: from deccapp3.mcom.com (deccapp3.mcom.com [205.217.236.197])
	by netscape.com (8.8.5/8.8.5) with SMTP id MAA08259
	for <[email protected]>; Wed, 16 Apr 1997 12:46:13 -0700 (PDT)
Received: by deccapp3.mcom.com (5.65v3.2/1.1.10.5/26Jun96-0538PM)
	id AA07183; Wed, 16 Apr 1997 12:48:44 -0700
Date: Wed, 16 Apr 1997 12:48:44 -0700
From: Phung Truong <[email protected]>
Message-Id: <[email protected]>
To: [email protected]
Subject: cxx compiler crash report


The enclosed code fragment (reduced from a MUCH larger code) causes the 
cxx compiler to crash. (It compiles fine with g++.) Here are three different 
variations on the problem.


cxx -c bug.cpp

cxx: Error: bug.cpp, line 62: In this statement, the argument list "(schemaType_,coltype_,0,indicator_, ...)" supplies 5 argument(s), which is not the number expected by any "RWDBValue::RWDBValue" in scope.
	return RWDBInformixValue(schemaType_, coltype_,
---------------^
Stack overflow: pid 29638, proc gemc_cxx, addr 0x10c77da0, pc 0x1208dc5c
Fatal error in: /usr/lib/cmplrs/cxx/gemc_cxx Segmentation fault 


cxx -c -DWORKS bug.cpp

cxx: Warning: bug.cpp, line 60: In this statement, the initialization of a non-const reference requires a temporary for "val".
	return val;
---------------^

cxx -c -v -DNO_PROBLEM bug.cpp  

cxx -V   
cxx  (cxx)
DEC C++ V5.5-004 on Digital UNIX (Alpha)

uname -a
OSF1 deccapp3.mcom.com V4.0 464 alpha

////////////// bug.cpp ///////////

class RWDBValue;
class RWFile;

#define RWDECLARE_COLLECTABLE(className) public: \
    friend RWFile&   operator>>(RWFile& f,  className*& pCl) {return f;}

class RWCollectable
{
  RWDECLARE_COLLECTABLE(RWCollectable)
public:
  RWCollectable();
  virtual	~RWCollectable();
};

class RWDBValue : public RWCollectable
{
    RWDECLARE_COLLECTABLE(RWDBValue);
public:
    enum ValueType { NoType = 0, Char,     UnsignedChar, String,   Blob };
    RWDBValue();
#ifndef NO_PROBLEM
	// This line caused the stack dump: without it we compile OK!!
    RWDBValue(RWDBValue& value);
#endif
    virtual ~RWDBValue();
protected:
    RWDBValue(ValueType type);
private:
    void                    cleanup();
};

class RWDBInformixData {
public:
    RWDBInformixData		();
    ~RWDBInformixData		();
    RWDBValue			asValue();
private:
    enum bufferType {none, usingInfData, usingAppData};
    RWDBValue::ValueType	schemaType_;
    short			coltype_;
    void*			infData_;
    short			indicator_;
};

class RWDBInformixValue : public RWDBValue {
public:
    RWDBInformixValue		(RWDBValue::ValueType rwtype,
				 short coltype,
				 short hosttype,
				 short sqlind,
				 void* data);
};

RWDBValue RWDBInformixData::asValue()
{
#ifdef WORKS
	RWDBInformixValue	val (schemaType_, coltype_,
				 0, /* sqlvar_->sqltype, */
				 indicator_, infData_);
	return val;
#else
	return RWDBInformixValue(schemaType_, coltype_,
				 0, /* sqlvar_->sqltype, */
				 indicator_, infData_);
#endif
}

--------------6488773C6F59--

T.RTitleUserPersonal
Name
DateLines
3539.1Problem reproducedCXXC::REINIGThis too shall changeThu Apr 17 1997 11:314
    We can reproduce the problem.  Thankyou for bringing it to our
    attention.
    
                                    August
3539.2CXXC::WOLFEWed May 28 1997 10:311
fixed by v6.0