openexr-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Openexr-devel] pyilmbase problems importing imath


From: Federico Naum
Subject: Re: [Openexr-devel] pyilmbase problems importing imath
Date: Thu, 13 Feb 2014 20:47:36 +1100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0

Thanks Piotr,

That confirms that I have something else wrong..
I tried also with gcc446, and both gcc combination with pyilmbase 2.0.1 against version 2.1.0 of ilmbase and I still have the same issue.

Regarding what Nick pointed out about the visibility on linux, but It

#else   // linux/macos
#  if defined(PLATFORM_VISIBILITY_AVAILABLE)
#    define IEX_EXPORT_DEFINITION __attribute__((visibility("default")))
#    define IEX_IMPORT_DEFINITION
#  else
#    define IEX_EXPORT_DEFINITION
#    define IEX_IMPORT_DEFINITION


I don't see the -fvisibility=hidden flag passed into the compiled lines, so I assume that all symbols are by defualt, I try defining PLATFORM_VISIBILITY_AVAILABLE but I see no change...

and I can see the symbols are visible . i.e

> nm -CS libIex-2_1.so.11 | grep BaseExc
0000000000015df0 0000000000000275 T Iex_2_1::BaseExc::append(std::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >&)
0000000000015430 00000000000000af T Iex_2_1::BaseExc::assign(std::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >&)
0000000000015850 00000000000000e2 T Iex_2_1::BaseExc::BaseExc(char const*)
0000000000015c70 00000000000000ba T Iex_2_1::BaseExc::BaseExc(Iex_2_1::BaseExc const&)
00000000000156b0 00000000000000ce T Iex_2_1::BaseExc::BaseExc(std::string const&)
0000000000015350 00000000000000d7 T Iex_2_1::BaseExc::BaseExc(std::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >&)
00000000000154e0 00000000000000e2 T Iex_2_1::BaseExc::BaseExc(char const*)
0000000000015d30 00000000000000ba T Iex_2_1::BaseExc::BaseExc(Iex_2_1::BaseExc const&)
0000000000015780 00000000000000ce T Iex_2_1::BaseExc::BaseExc(std::string const&)
00000000000155d0 00000000000000d7 T Iex_2_1::BaseExc::BaseExc(std::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >&)
0000000000015940 0000000000000110 T Iex_2_1::BaseExc::~BaseExc()
0000000000015a50 0000000000000108 T Iex_2_1::BaseExc::~BaseExc()
0000000000015b60 0000000000000108 T Iex_2_1::BaseExc::~BaseExc()
0000000000015340 0000000000000005 T Iex_2_1::BaseExc::what() const
000000000021cd80 0000000000000038 V typeinfo for Iex_2_1::BaseExc
00000000000172e0 0000000000000013 V typeinfo name for Iex_2_1::BaseExc
000000000021cd40 0000000000000028 V vtable for Iex_2_1::BaseExc

> nm -CS libIex-2_1.so.11 | grep throwErrnoExc
0000000000013420 0000000000000014 T Iex_2_1::throwErrnoExc(std::string const&)
0000000000011730 0000000000001ce2 T Iex_2_1::throwErrnoExc(std::string const&, int)
0000000000013440 00000000000000b2 T Iex_2_1::throwErrnoExc()


so not sure what to try.... I'll grab something else tomorrow to continue with the investigation.
would it help if I post the output of the configure of both ilmase and pyilmbase? maybe you can spot something that I am missing
F


On 13/02/14 13:41, Piotr Stanczyk wrote:
I see, thanks for the qualification. I have built with gcc4.4.6 all the way up to 4.7.x so not sure that is the issue.  I think boost 1.5.1 is good for the later releases, certainly 2.x, but again, we built 1.x versions with 1.39 for quite a few years without any issues. 

I'm not sure why you would be seeing this linux as is... 

Piotr


On 12 February 2014 15:32, Federico Naum <address@hidden> wrote:
Hi Piotr,

I think this is more related to what Nick is pointing out (but I'm on Linux not in Windows)

Regarding the lines with NAMESPACE that I put in the post, I  mix them, but just to stress that I'm seeing the same problem either with version 1.X and version 2.X of both ilmbase and pylmbase

On verison 1.X there was no namespaces code around that piece of code and I'm still seeing the same issue. (crash in the same line)
But, I don't know what to try, so I'll give it a go to ilmbase 2.1.0, and I'll report back

Thanks
Fede



On 13/02/14 05:33, Piotr Stanczyk wrote:
Hey - 

How did you build IlmBase? Pre- 2.1.0 releases had a bug when building with custom namespaces

Piotr



On 11 February 2014 23:50, Federico Naum <address@hidden> wrote:
Hi

Hope this is the forum to ask.

I'm building pyilmbase 1.0.0  under llinux Centos 6.2, with ilmbase  1.0.3,  gcc4.1.2 and boost 1.44.0 (also tried all combinations of the newer version of pyilmbase 2.0.0/1 against ilmbase 2.0 with newer compiler gcc446, and several flavours boost.

In all cases I can build  successfully and import iex just fine, but importing imath does SegFault, it does crashed on line 241 of PyIex.h

240│     const TypeTranslator<IEX_NAMESPACE::BaseExc>::ClassDesc *baseDesc = baseExcTranslator().template findClassDesc<ExcBase>(baseExcTranslator().firstClassDesc());
241├>    std::string baseName = baseDesc->typeName();
242│     std::string baseModule = baseDesc->moduleName();

baseDesc ends up with a nullPointer (const PyIex::TypeTranslator<Iex_2_0::BaseExc>::ClassDesc *) 0x0


As importing iex works fine, I changed the code in imathmodule.cpp to kind of copy how the Exception gets registered.

<     PyIex::registerExc<Imath::NullVecExc,Iex::MathExc>("NullVecExc","imath");
<     PyIex::registerExc<Imath::NullQuatExc,Iex::MathExc>("NullQuatExc","imath");
<     PyIex::registerExc<Imath::SingMatrixExc,Iex::MathExc>("SingMatrixExc","imath");
<     PyIex::registerExc<Imath::ZeroScaleExc,Iex::MathExc>("ZeroScaleExc","imath");
<     PyIex::registerExc<Imath::IntVecNormalizeExc,Iex::MathExc>("IntVecNormalizeExc","imath");
---
>     PyIex::registerExc<Imath::NullVecExc,Iex::BaseExc>("NullVecExc","iex");
>     PyIex::registerExc<Imath::NullQuatExc,Iex::BaseExc>("NullQuatExc","iex");
>     PyIex::registerExc<Imath::SingMatrixExc,Iex::BaseExc>("SingMatrixExc","iex");
>     PyIex::registerExc<Imath::ZeroScaleExc,Iex::BaseExc>("ZeroScaleExc","iex");
>     PyIex::registerExc<Imath::IntVecNormalizeExc,Iex::BaseExc>("IntVecNormalizeExc","iex");

This way I can import imath, and in python land I can see that the imath module contains the registered exceptions and I can raise/try/catch them. but this code change seems fishy since nothing else seems to have reported and the code in the latest version remains the same.

I saw someone else did the same change (back in 2012) https://groups.google.com/forum/#!searchin/alembic-discussion/Cannot$20build$20windows/alembic-discussion/OMOvhg0Nv7o/VnJRrByVv10J

but I'm pretty sure I am missing something more obvious

also it caught my attention that I get this warning on gdb

PyIex::TypeTranslator<Iex_2_0::BaseExc>::findClassDesc<Iex_2_0::MathExc> (this=0x6e6510, cd=0x6eaa00) at /scratch/federicon/git/rezExternalPackages/pyilmbase/2.0.0/build/2/pyilmbase-prefix/src/pyilmbase/PyIex/Py
IexTypeTranslator.h:262
(gdb) print cd->typeInfo()
warning: RTTI symbol not found for class 'PyIex::TypeTranslator<Iex_2_0::BaseExc>::ClassDescT<Iex_2_0::BaseExc>'

could it be related to the realtime type info? I made sure that ilmbase and pyilmbase were compiled wihout the -fno-rtti so it should be on by default

Hope someone can help me find the issue

Thanks in advance
Fede



_______________________________________________
Openexr-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/openexr-devel






reply via email to

[Prev in Thread] Current Thread [Next in Thread]