TDengine icon indicating copy to clipboard operation
TDengine copied to clipboard

Library Symbol Conflict "Version" with other Lib

Open xunzhimeng opened this issue 1 year ago • 10 comments

Bug Description Taos Library Symbol Conflict "Version" with other Lib which use the same symbol.

To Reproduce

Expected Behavior [05/23 20:00:11.962314891][info ] [TaosVer]: 3.3.0.3, fqdn: ****, port: 6030, user: root [05/23 20:00:22.247955223][error ] [TdEngine]: got an error when connect

Screenshots

Environment (please complete the following information):

  • OS: [e.g. Ubuntu 22.04]
  • Memory, CPU, current Disk Space
  • TDengine Version 3.2.3.0 & 3.3.03

Additional Context

xunzhimeng avatar May 24 '24 02:05 xunzhimeng

May I know more detail?

yu285 avatar May 24 '24 05:05 yu285

May I know more detail?

You can look at my pr[https://github.com/taosdata/TDengine/pull/25921], the [version] symbol defined at "source/util/src/version.c.in".

My program used another library and taos.so, the other library also used a global version symbol ,so when I connect to tdengine server, the taos.so return an error. The error appeared in ver 2.6,you can look back.

xunzhimeng avatar May 24 '24 06:05 xunzhimeng

may I know what this other library is ? is it a common libraray?

yu285 avatar May 27 '24 01:05 yu285

may I know what this other library is ? is it a common libraray?

http://www.sfit.com.cn/5_2_DocumentDown_2_2.htm Trading Api for almost all future trading api.

xunzhimeng avatar May 27 '24 05:05 xunzhimeng

may I know what this other library is ? is it a common libraray?

http://www.sfit.com.cn/5_2_DocumentDown_2_2.htm Trading Api for almost all future trading api.

Also calls CTP

xunzhimeng avatar May 27 '24 05:05 xunzhimeng

may I know what this other library is ? is it a common libraray?

may I know what this other library is ? is it a common libraray?

Secondly, whether it is a general library or not, the use of global symbols in this manner is inherently problematic and can cause significant inconvenience for users. It also makes issue troubleshooting more difficult.

xunzhimeng avatar May 27 '24 05:05 xunzhimeng

of course we need to avoid the circumstance like what you said.

but I'm not the developer of TDengine , I need to make it clear first then transfer your requirement to our development team.

here is my question:

Does your PR can make this senario not happen again between TDengine and other lib ?

yu285 avatar May 27 '24 06:05 yu285

of course we need to avoid the circumstance like what you said.

but I'm not the developer of TDengine , I need to make it clear first then transfer your requirement to our development team.

here is my question:

Does your PR can make this senario not happen again between TDengine and other lib ?

Yeah, I build taos library when tdengine update everytime.The PR works good! You can see the ISSUE 11029 and 15939

xunzhimeng avatar May 27 '24 13:05 xunzhimeng

of course we need to avoid the circumstance like what you said. but I'm not the developer of TDengine , I need to make it clear first then transfer your requirement to our development team. here is my question: Does your PR can make this senario not happen again between TDengine and other lib ?

Yeah, I build taos library when tdengine update everytime.The PR works good! You can see the ISSUE 11029 and 15939

hi ,The 'other lib' I mentioned refers to any library other than CTP.

I need to confirm this PR not only work for single library .

for example , after this PR accept, will conflict happen between taos and 'ABC' ,'BCD' or whatever other library again?

yu285 avatar May 28 '24 01:05 yu285

of course we need to avoid the circumstance like what you said. but I'm not the developer of TDengine , I need to make it clear first then transfer your requirement to our development team. here is my question: Does your PR can make this senario not happen again between TDengine and other lib ?

Yeah, I build taos library when tdengine update everytime.The PR works good! You can see the ISSUE 11029 and 15939

hi ,The 'other lib' I mentioned refers to any library other than CTP.

I need to confirm this PR not only work for single library .

for example , after this PR accept, will conflict happen between taos and 'ABC' ,'BCD' or whatever other library again?

The 'version' symbol will not, but other symbol defined in the file [\TDengine\source\util\src\version.c.in] may also conflict with other library. There two way to sovle the problem:

  1. Modify the names of symbols to minimize duplication, for example, 'TdengineVersion'
  2. Apply "attribute((visibility("hidden")))" to all global symbols. Or your team has a more efficient methods. An assessment is needed from your side on this, as I am occupied with other tasks and do not have visibility on the results from your GitHub testing system, which makes it less convenient for me to conduct tests personally.

xunzhimeng avatar May 28 '24 08:05 xunzhimeng

Solve the library conflict by rename vesion to td_version. See https://github.com/taosdata/TDengine/pull/28634

guanshengliang avatar Nov 05 '24 05:11 guanshengliang