Pb with gcc on hpux-11.0
edupont@club-internet.fr
edupont@club-internet.fr
Fri Feb 1 02:14:00 GMT 2002
Hi,
This very short piece of code doesn't work properly under HP with g++ 3.0.1 and even with g++ -3.0.3-32bit.
#include <string>
using namespace std;
int main(int argc, char *argv[])
{
struct appStruck {
string appName;
char *appContents[500];
};
appStruck appCOMMON[6];
appStruck appA[6];
appStruck appB[15];
return 0;
}
Program received signal SIGBUS, Bus error.
0x2ca8 in main (argc=1, argv=0x7b0414cc) at muell.C:12
12 appStruck appCOMMON[6];
(gdb) backtrace
#0 0x2ca8 in main (argc=1, argv=0x7b0414cc) at muell.C:12
Segment violation fault during the allocation memory.
0x55555555 <Address 0x55555555 out of bounds>
Cannot access memory at address 0x55555555
If I replace the array[] by vector<> from the std::, the variable declaration are OK but further in my initial program when the dynamic location happens it fails. The trouble is exatly the same but arrives a little more later because of the dynamic memory alocation.
Good luck,
Emmanuel.
More information about the Gcc-bugs
mailing list