visibility and movable_exception

visibility and movable_exception

on Mac OS X with open source TBB 4.1 consider

class A { //copyable class, good for tbb::movable_exception
public:
   A(size_t n) : m_n(n) {}
   size_t getN() const {return m_n;}
private:
   size_t m_n;
};

class TBBTry {
public:
    void operator() ( const tbb::blocked_range<size_t>& r ) const {
        for ( size_t i = r.begin(); i != r.end(); ++i ) {
             if (((i+1) % 4) == 0) {
                size_t n = i + 100;
               throw tbb::movable_exception<A>(A(n));
            }
       } 
   }
   TBBTry() { }
};

int main() {
    try {
        tbb::parallel_for(tbb::blocked_range<size_t>(0, 5 ), TBBTry() );
    } catch ( tbb::movable_exception<A> &ex) {
        std::cout << "tbb::movable_exception n = " << ex.data().getN() << std::endl;
    } catch ( tbb::captured_exception &ex ) {
        std::cout << "tbb::captured_exception name = " << ex.name() << "; " << ex.what() << std::endl;
    } catch ( ... ) {
        std::cout << "unknown_exception" << std::endl;
   }
    return 0;
}

I expect to see
tbb::movable_exception n = 103

However I see the following output:
tbb::captured_exception name = N3tbb17movable_exceptionI1AEE; tbb::movable_exception

I debugged that issue and found out that we have problem with visibility template exception thrown from separate dll.

Problem is fixed if I do the following changes in the file
tbb_exception.h:

#ifndef __TBB_exception_H
#define __TBB_exception_H

# pragma GCC visibility push (default) //xxx(dmarkman)

...........

# pragma GCC visibility pop //xxx(dmarkman)

#endif /* __TBB_exception_H */

I sbmitted bug report but didn't get back any bugid and when I search bug db I'm getting no records

2 posts / novo 0
Último post
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.

Hello,

Thanks for the solution. could you submit a patch via contribution page http://threadingbuildingblocks.org/contribution_first.php?

Bugzilla on our site is not very user-friendly now:) as far as I understand you have submitted 3 bugs: 197, 198, 199.

thank you,
--Vladimir

Deixar um comentário

Faça login para adicionar um comentário. Não é membro? Inscreva-se hoje mesmo!