Opened 15 years ago

Closed 14 years ago

#23604 closed defect (wontfix)

C++ Destructor of UnicodeString throws exception if local in block with a throw of another exception

Reported by: bumens@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 1.8.2
Keywords: Cc:
Port: icu

Description

vb@bayhorse:~/icu-bug % cat test1.cc
#include <unicode/unistr.h>
#include <iostream>

void f() {
    UnicodeString s("");
    throw 23;
}

int main(int argc, char **argv) {
    try {
        f();
    }
    catch (...) {
        std::cout << "catched.\n";
    }

    return 0;
}

vb@bayhorse:~/icu-bug % cat test2.cc
#include <unicode/unistr.h>
#include <iostream>

void f() {
    { UnicodeString s; }
    throw 23;
}

int main(int argc, char **argv) {
    try {
        f();
    }
    catch (...) {
        std::cout << "catched.\n";
    }

    return 0;
}

vb@bayhorse:~/icu-bug % make
g++-mp-4.4 -fexceptions  -L/opt/local/lib -licuuc  test1.cc   -o test1
g++-mp-4.4 -fexceptions  -L/opt/local/lib -licuuc  test2.cc   -o test2
vb@bayhorse:~/icu-bug % ./test1
[1]    66078 abort      ./test1
vb@bayhorse:~/icu-bug % ./test2
catched.
vb@bayhorse:~/icu-bug % uname -a
Darwin bayhorse.local 10.2.0 Darwin Kernel Version 10.2.0: Tue Nov  3 10:37:10 PST 2009; root:xnu-1486.2.11~1/RELEASE_I386 i386 i386
vb@bayhorse:~/icu-bug % g++-mp-4.4 --version
g++-mp-4.4 (GCC) 4.4.3
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

vb@bayhorse:~/icu-bug % port installed icu
The following ports are currently installed:
  icu @4.3.3_0 (active)
vb@bayhorse:~/icu-bug %

Attachments (1)

icu-bug.tar.bz2 (1.1 KB) - added by bumens@… 15 years ago.
test code to trigger the bug

Download all attachments as: .zip

Change History (9)

Changed 15 years ago by bumens@…

Attachment: icu-bug.tar.bz2 added

test code to trigger the bug

comment:1 Changed 15 years ago by mf2k (Frank Schima)

Keywords: icu UnicodeString C++ bug removed
Owner: changed from macports-tickets@… to nox@…

comment:2 Changed 15 years ago by nox@…

I'm pretty sure you should report this upstream instead of here.

comment:3 Changed 15 years ago by bumens@…

Actually I did report it upstream already. I was unsure if I should report it here, too, so I did additionally.

comment:4 Changed 15 years ago by nox@…

Could you give us the upstream ticket number?

comment:5 Changed 15 years ago by bumens@…

Yes, of course: #7410, see http://bugs.icu-project.org/trac/ticket/7410

And yes, I forgot the again ;-)

comment:6 Changed 14 years ago by jmroot (Joshua Root)

Upstream report was closed "worksforme", FWIW.

comment:7 Changed 14 years ago by jmroot (Joshua Root)

Owner: changed from nox@… to macports-tickets@…

comment:8 Changed 14 years ago by jmroot (Joshua Root)

Resolution: wontfix
Status: newclosed

Closing as this appears to be a FSF GCC bug.

Note: See TracTickets for help on using tickets.