[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

3441.0. "compiler ggets memory access violation on UNIX" by HYDRA::DORHAMER () Mon Feb 10 1997 18:44

A software partner who is porting to Digital UNIX v4.0 reported the following
problem, which I have reproduced with the DEC C++ v5.5-004 compiler:

The attached code causes the compiler to generate a fatal error message:

cxx: Fatal: A memory access violation (bus error or segmentation fault)
has occurred.  Please submit a problem report.

They have a work around but wanted to report this as a bug in the compiler.

Here is the source code:

      template <class E>
    struct DMEnumTable {
      char* name;
      E e;
    };

      template <class E>
    class DMEnumDict {
    public:
      DMEnumDict (DMEnumTable<E>* tbl);
    };

    typedef enum {
      apple, orange, banana, pear, grape, kiwi
    } fruit_t;

    DMEnumTable<fruit_t> fruitTable[] = {
      {"apple", apple},
      {"orange", orange},
      {"banana", banana},
      {"pear", pear},
      {"grape", grape},
      {"kiwi", kiwi},
     {0, (fruit_t) 0}
    };

    DMEnumDict<fruit_t> fruitDict (fruitTable);
    
T.RTitleUserPersonal
Name
DateLines
3441.1CXXC::BRETTWed Feb 12 1997 11:066
    I have replicated the problem, and will assign it to the appropriate
    developer.
    
    Please thank your software partner for reporting this.
    
    /Bevin
3441.2CXXC::BRETTWed Feb 12 1997 12:163
    The problem appears to be fixed in 5.6
    
    /Bevin
3441.3ThanksHYDRA::DORHAMERWed Feb 12 1997 18:356
    Thanks for checking on this.  Glad to hear that the problem is already
    fixed in the 5.6 compiler.  What is the expected ship date for this
    version of the compiler?
    
    Thanks,
    Karen
3441.4V5.6DECCXX::MITCHELLThu Feb 13 1997 11:412
V5.6 ship date is July 97.  We'll be in field
test this spring.