-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to build UDFs #5761
Comments
|
@jjsimps Have you tried pulling the
|
I guess @jjsimps is about to run graphd with udf folder attached in production, thus leveraging our graphd docker image rather than the dev one. |
I checked that the implementation of the code does not execute |
This is exactly the situation of how UDF in C++ works, i.e. the ABI between the UDF and the host program must be compatible. ABI might be broken between different GCC versions, especially the ones before and after GCC 5. There are indeed some techniques to address such issues like symbol versioning, but for the old ABI before C++11 it's too tedious, difficult and unreliable to maintain. So we will not support such cases. As for the compatibility for the newer versions, a serious UDF implementation maybe should try best to handle this. But it is still a tough work to do. Keeping the building environments exactly the same is the easy and reliable way. |
Thanks for the input everyone! @wey-gu is exactly correct -- the UDFs are built using the nebula-dev image which has the builtools and I also tried your suggestion of building using ubuntu2004 image and that seems to work. But that does require me to build my own graphd image using ubuntu2004 (not the worst, but not ideal of course). I expect the same would be fine if I build the graphd image using the nebula-dev:centos7 as the base image instead of just centos7. As for calling dlopen, please see here. As you can see, the lambda, when called, will call dlopen(), create the UDF, call it, destroy, then call dlclose(). I do realize that this feature was kinda put in as a stealth feature (not fully documented, but referenced in release notes). I was looking forward to it as it allows me to run a bit more complex logic that would either otherwise manifest as a very complex query (with branch, bitwise operators, etc), or have to be taken back to the application level. What would you say is the current outlook/roadmap for the serious UDF support? Is there anywhere I can find out this info? In the meantime, I think that the current implementation is 85% there for most of my use-cases. I would like to know the proper solution for dealing with the ABI (hopefully by changing the prod base image to something that has it), and also a fix for the performance issue when calling the UDF (I noticed query times jump from 10s of ms to 100s of ms when calling a cusom UDF which seems absurd). Thank you :) |
The basic idea is that you build the UDF itself with toolchain of the same version as graphd. Besides, since graphd links libstdc++ statically(not proper for the UDF scenario) but the dependency on libstdc++ by UDF cannot be eliminated, you have to ship the UDF library with libstdc++.so(maybe with a Personally I never reviewed this UDF framework implementation. But it smells bad to me after a fast browsing. It does invoke As for the serious one, we don't have a plan on this so far. Actually we have been working on a huge refactoring which includes user defined function and procedure. But the roadmap to release is not determined yet. |
Awesome, thank you. I tried the I'll see about refactoring some of the code to bring it back up to a bit of a better level. |
Describe the bug
When I build the UDFs for centos7 (using the nebula-dev image), it builds fine. However, when try to use the UDF in nebula I get the error:
/lib64/libstdc++.so.6: version 'CXXABI_1.3.9' not found
It seems the UDF is being built with ABI 1.3.9, but that doesn't come included on the centos7 image for graphd:
I tried statically linking libstd++, but that's just causing memory leaks in graphd see this issues.
So if I can't statically link it, then I must match the ABI version. But this doesn't seem possible without downgrading the buildtools.
Your Environments (required)
How To Reproduce(required)
Steps to reproduce the behavior:
Expected behavior
No UDF error, no build error, no memory leaks.
I also noticed that It calls dlopen() every time the function is called, which seems like it would cause a huge performance overhead. Why not cache the function pointer?
The text was updated successfully, but these errors were encountered: