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

[solved]Re: Undefined symbol but symbol is there when importing _pywrap_tensorflow_internal.so



On Mon, Sep 24, 2018 at 03:03:02PM +0500, Andrey Rahmatullin wrote:
> On Mon, Sep 24, 2018 at 08:50:53AM +0000, Mo Zhou wrote:
> > python complains that the symbol is undefined
> > 
> >    _ZN10tensorflow25CreateRemoteMemoryManagerERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_
> > 
> > however with readelf -sW xxx | ripgrep, the symbol is indeed in the
> > shared object. 
> [...]
> > 	(sid-lumin)lumin@wrath:/dev/shm/tensorflow.pkg/tensorflow$ readelf -sW _pywrap_tensorflow_internal.so | rg _ZN10tensorflow25CreateRemoteMemoryManagerERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_
> > 	  1146: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND _ZN10tensorflow25CreateRemoteMemoryManagerERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_
> > 	197099: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND _ZN10tensorflow25CreateRemoteMemoryManagerERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_
> > 	(sid-lumin)lumin@wrath:/dev/shm/tensorflow.pkg/tensorflow$
> 
> I don't know about this output format but if UND means undefined it's not
> really "the symbol is indeed in the shared object".

I found this:
	https://stackoverflow.com/questions/3065535/what-are-the-meanings-of-the-columns-of-the-symbol-table-displayed-by-readelf
 
Further investigation into the CXX source suggests that I didn't
give the preprocessor a proper flag which guards the implementation,
such that actually the function is referenced by some other components
in the same shared object, but the function isn't defined.

I have fixed this "undefined symbol" error, by excluding related objects
since they are not important for the final shared object.
 
> > I also checked the build and the CXX file which provides
> > this symbol is indeed included in the object list when linking the
> > shared object in question.
> Are you sure that file really provides this symbol? Are you sure it's the
> shared object in question? Why is it in /dev/shm?

No, it doesn't provide such symbol. What's in question is indeed the
shared object itself. And /dev/shm is simply the build directory
because the machine has 512GB of RAM.

> -- 
> WBR, wRAR


Reply to: