Bug#105569: [mips/mipsel] g++ exception catching does not work...
Package: g++
Version: 2.95.x
The following program breaks on mips and mipsel:
#include <stdio.h>
class shex {
public:
shex();
~shex();
shex(const shex&);
shex& operator=(const shex&);
};
shex::shex()
{
printf("creating new shex @%p\n", this);
}
shex::shex(const shex& that)
{
printf("creating new shex @%p from %p\n", this, &that);
}
shex& shex::operator=(const shex& that)
{
printf("copying shex from %p to %p\n", &that, this);
return *this;
}
shex::~shex()
{
printf("destroying shex @%p\n", this);
}
int main()
{
try {
throw shex();
} catch(const shex&) {
printf("Caught shex (ok)\n");
} catch(...) {
printf("Caught unknown exception (BAD)\n");
}
return 0;
}
phil@resume:~/shtest% uname -a
Linux resume.rfc822.org 2.4.2 #8 Sun Apr 1 20:56:43 CEST 2001 mips unknown
phil@resume:~/shtest% dpkg --print-architecture
mips
phil@resume:~/shtest% dpkg -l g++
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-==============-==============-============================================
ii g++ 2.95.4-4 The GNU C++ compiler.
phil@resume:~/shtest% g++ -Wall -W -o catchfails catchfails.cpp
phil@resume:~/shtest% ./catchfails
creating new shex @0x7fff7958
creating new shex @0x10000228 from 0x7fff7958
destroying shex @0x7fff7958
zsh: 17066 segmentation fault ./catchfails
phil@resume:~/shtest%
phil@repeat:~$ uname -a
Linux repeat.rfc822.org 2.4.1 #2 Thu Apr 5 02:26:22 CEST 2001 mips unknown
phil@repeat:~$ dpkg --print-architecture
mipsel
phil@repeat:~$ dpkg -l g++
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-==============-==============-============================================
ii g++ 2.95.3-7 The GNU C++ compiler.
phil@repeat:~$ g++ -Wall -W -o catchfails catchfails.cpp
phil@repeat:~$ ./catchfails
creating new shex @0x7fff7c98
creating new shex @0x10000228 from 0x7fff7c98
destroying shex @0x7fff7c98
Segmentation fault
phil@repeat:~$
Phil.
Reply to: