You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by GitBox <gi...@apache.org> on 2020/08/07 06:50:55 UTC

[GitHub] [incubator-brpc] songlong opened a new issue #1199: 动态运行错误RegisterValidateFunction

songlong opened a new issue #1199:
URL: https://github.com/apache/incubator-brpc/issues/1199


   **Describe the bug (描述bug)**
   makfile添加brpc.so发现Ignoring RegisterValidateFunction() for flag pointer 0x7f3d0b54893c: no flag found at that address
   
   **To Reproduce (复现方法)**
   
   动态加载自编译so出现找不到
   **Expected behavior (期望行为)**
     
   
   **Versions (各种版本)**
   OS: centos6.2
   Compiler: cmake
   brpc: 0.9.7
   protobuf: 2.4
   
   **Additional context/screenshots (更多上下文/截图)**
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] sunzhenkai edited a comment on issue #1199: 动态运行错误RegisterValidateFunction

Posted by GitBox <gi...@apache.org>.
sunzhenkai edited a comment on issue #1199:
URL: https://github.com/apache/incubator-brpc/issues/1199#issuecomment-755299530


   ![image](https://user-images.githubusercontent.com/74759149/103773476-0f638a00-5066-11eb-9f34-1fa9ad1def7c.png)
   
   gflags静态库和共享库同时存在导致。我是选择手动编译gflags,在编译时为cmake指定选项`-DBUILD_SHARED_LIBS=1`,只编译共享库,可解决问题,具体参考[这里](https://github.com/sunzhenkai/cooking/blob/5022774c0185cf140c90553d837fc247f9586d67/c%2B%2B/universal/third/install.sh#L73)。如果是使用命令安装,可以尝试先移除`/usr/local/lib/libgflags.a` 和 `/usr/local/lib/libgflags_nothread.a`,然后重新编译brpc。
   ![image](https://user-images.githubusercontent.com/74759149/103773612-4cc81780-5066-11eb-99f5-3ab1fa69dcfc.png)
   ![image](https://user-images.githubusercontent.com/74759149/103774369-67e75700-5067-11eb-87f1-ab56ed2e0c09.png)
   
   
   如果遇到下面这个异常,类似的原因,移除静态库。
   ```
   ERROR: something wrong with flag 'help' in file '/Users/wii/Git/cooking/c++/universal/third/build/gflags-2.2.2/src/gflags_reporting.cc'.  One possibility: file '/Users/wii/Git/cooking/c++/universal/third/build/gflags-2.2.2/src/gflags_reporting.cc' is being linked both statically and dynamically into this executable.
   ```
   
   以上仅供参考。
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] sunzhenkai commented on issue #1199: 动态运行错误RegisterValidateFunction

Posted by GitBox <gi...@apache.org>.
sunzhenkai commented on issue #1199:
URL: https://github.com/apache/incubator-brpc/issues/1199#issuecomment-755299530


   
   ![image](https://user-images.githubusercontent.com/74759149/103773476-0f638a00-5066-11eb-9f34-1fa9ad1def7c.png)
   
   gflags静态库和共享库同时存在导致。我是选择手动编译gflags,在编译时为cmake指定`-DBUILD_SHARED_LIBS=1`只编译共享库,可参考[这里](https://github.com/sunzhenkai/cooking/blob/5022774c0185cf140c90553d837fc247f9586d67/c%2B%2B/universal/third/install.sh#L73)。如果是使用命令安装,可以尝试先移除`/usr/local/lib/libgflag.a` 和 `/usr/local/lib/libgflag_nothread.a`,然后重新编译brpc,可解决问题。
   ![image](https://user-images.githubusercontent.com/74759149/103773612-4cc81780-5066-11eb-99f5-3ab1fa69dcfc.png)
   
   
   如果遇到下面这个异常,类似的原因,移除静态库。
   ```
   ERROR: something wrong with flag 'help' in file '/Users/wii/Git/cooking/c++/universal/third/build/gflags-2.2.2/src/gflags_reporting.cc'.  One possibility: file '/Users/wii/Git/cooking/c++/universal/third/build/gflags-2.2.2/src/gflags_reporting.cc' is being linked both statically and dynamically into this executable.
   ```
   
   以上仅供参考。
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] sunzhenkai edited a comment on issue #1199: 动态运行错误RegisterValidateFunction

Posted by GitBox <gi...@apache.org>.
sunzhenkai edited a comment on issue #1199:
URL: https://github.com/apache/incubator-brpc/issues/1199#issuecomment-755299530


   ![image](https://user-images.githubusercontent.com/74759149/103773476-0f638a00-5066-11eb-9f34-1fa9ad1def7c.png)
   
   gflags静态库和共享库同时存在导致。我是选择手动编译gflags,在编译时为cmake指定`-DBUILD_SHARED_LIBS=1`只编译共享库,可解决问题,具体参考[这里](https://github.com/sunzhenkai/cooking/blob/5022774c0185cf140c90553d837fc247f9586d67/c%2B%2B/universal/third/install.sh#L73)。如果是使用命令安装,可以尝试先移除`/usr/local/lib/libgflag.a` 和 `/usr/local/lib/libgflag_nothread.a`,然后重新编译brpc。
   ![image](https://user-images.githubusercontent.com/74759149/103773612-4cc81780-5066-11eb-99f5-3ab1fa69dcfc.png)
   ![image](https://user-images.githubusercontent.com/74759149/103774369-67e75700-5067-11eb-87f1-ab56ed2e0c09.png)
   
   
   如果遇到下面这个异常,类似的原因,移除静态库。
   ```
   ERROR: something wrong with flag 'help' in file '/Users/wii/Git/cooking/c++/universal/third/build/gflags-2.2.2/src/gflags_reporting.cc'.  One possibility: file '/Users/wii/Git/cooking/c++/universal/third/build/gflags-2.2.2/src/gflags_reporting.cc' is being linked both statically and dynamically into this executable.
   ```
   
   以上仅供参考。
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] gydong commented on issue #1199: 动态运行错误RegisterValidateFunction

Posted by GitBox <gi...@apache.org>.
gydong commented on issue #1199:
URL: https://github.com/apache/incubator-brpc/issues/1199#issuecomment-682270904


   是说升级到protobuf2.5 后即可解决您的问题?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] songlong commented on issue #1199: 动态运行错误RegisterValidateFunction

Posted by GitBox <gi...@apache.org>.
songlong commented on issue #1199:
URL: https://github.com/apache/incubator-brpc/issues/1199#issuecomment-682022520


   修改cmakefile文件
   
   set(Protobuf_INCLUDE_DIR /usr/include/protobuf25)
   set(Protobuf_LIBRARY /usr/lib64/protobuf25)
   include_directories(${Protobuf_INCLUDE_DIR})
   include_directories(${CMAKE_CURRENT_BINARY_DIR})
   set(Protobuf_PROTOC_EXECUTABLE /usr/bin/protoc25)
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] sunzhenkai edited a comment on issue #1199: 动态运行错误RegisterValidateFunction

Posted by GitBox <gi...@apache.org>.
sunzhenkai edited a comment on issue #1199:
URL: https://github.com/apache/incubator-brpc/issues/1199#issuecomment-755299530


   ![image](https://user-images.githubusercontent.com/74759149/103773476-0f638a00-5066-11eb-9f34-1fa9ad1def7c.png)
   
   gflags静态库和共享库同时存在导致。我是选择手动编译gflags,在编译时为cmake指定`-DBUILD_SHARED_LIBS=1`只编译共享库,可解决问题,具体参考[这里](https://github.com/sunzhenkai/cooking/blob/5022774c0185cf140c90553d837fc247f9586d67/c%2B%2B/universal/third/install.sh#L73)。如果是使用命令安装,可以尝试先移除`/usr/local/lib/libgflag.a` 和 `/usr/local/lib/libgflag_nothread.a`,然后重新编译brpc。
   ![image](https://user-images.githubusercontent.com/74759149/103773612-4cc81780-5066-11eb-99f5-3ab1fa69dcfc.png)
   
   
   如果遇到下面这个异常,类似的原因,移除静态库。
   ```
   ERROR: something wrong with flag 'help' in file '/Users/wii/Git/cooking/c++/universal/third/build/gflags-2.2.2/src/gflags_reporting.cc'.  One possibility: file '/Users/wii/Git/cooking/c++/universal/third/build/gflags-2.2.2/src/gflags_reporting.cc' is being linked both statically and dynamically into this executable.
   ```
   
   以上仅供参考。
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] sunzhenkai edited a comment on issue #1199: 动态运行错误RegisterValidateFunction

Posted by GitBox <gi...@apache.org>.
sunzhenkai edited a comment on issue #1199:
URL: https://github.com/apache/incubator-brpc/issues/1199#issuecomment-755299530


   ![image](https://user-images.githubusercontent.com/74759149/103773476-0f638a00-5066-11eb-9f34-1fa9ad1def7c.png)
   
   gflags静态库和共享库同时存在导致。我是选择手动编译gflags,在编译时为cmake指定`-DBUILD_SHARED_LIBS=1`只编译共享库,可解决问题,具体参考[这里](https://github.com/sunzhenkai/cooking/blob/5022774c0185cf140c90553d837fc247f9586d67/c%2B%2B/universal/third/install.sh#L73)。如果是使用命令安装,可以尝试先移除`/usr/local/lib/libgflag.a` 和 `/usr/local/lib/libgflag_nothread.a`,然后重新编译brpc,可解决问题。
   ![image](https://user-images.githubusercontent.com/74759149/103773612-4cc81780-5066-11eb-99f5-3ab1fa69dcfc.png)
   
   
   如果遇到下面这个异常,类似的原因,移除静态库。
   ```
   ERROR: something wrong with flag 'help' in file '/Users/wii/Git/cooking/c++/universal/third/build/gflags-2.2.2/src/gflags_reporting.cc'.  One possibility: file '/Users/wii/Git/cooking/c++/universal/third/build/gflags-2.2.2/src/gflags_reporting.cc' is being linked both statically and dynamically into this executable.
   ```
   
   以上仅供参考。
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] songlong commented on issue #1199: 动态运行错误RegisterValidateFunction

Posted by GitBox <gi...@apache.org>.
songlong commented on issue #1199:
URL: https://github.com/apache/incubator-brpc/issues/1199#issuecomment-682282946


   不能,升级了pb2.5,gflags2.2.1, 通过preload加载,能避免flags重新reload注册问题


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] songlong commented on issue #1199: 动态运行错误RegisterValidateFunction

Posted by GitBox <gi...@apache.org>.
songlong commented on issue #1199:
URL: https://github.com/apache/incubator-brpc/issues/1199#issuecomment-670433302


   BRPC_VALIDATE_GFLAG这个地方会引用不可预知的引起动态库加载的退出,有啥办法给解决一下么?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org