So I’m writing this as an external stored procedure for a database, and I found out I was getting the issue because of how I defined the stored procedure itself, so I’ve resolved that particular issue. Now I’m running into an even stranger problem…
Not sure if it’s related to the stored procedure definition, or if it’s due to how I’m compiling stuff so I will elaborate more.
When I’m running the stored procedure which is using the library I defined, I’m getting crashes when I use particular parts of an external library I’ve imported.
For further context here is an example:
some_print_function_I_defined("start");
ObjectFromExternalLibrary objectA;
some_print_function_I_defined(objectA.attributeA);
some_print_function_I_defined(objectA.attributeB);
some_print_function_I_defined("end");
I will find that when I access attributeA
the stored procedure continues to run fine, but as soon as I touch attributeB
the procedure will stop with a crash. There are a multitude of other functions/properties/objects in the library which also crash the program (always the same ones), as well as a multitude of other functions/properties/objects that don’t seem to offend the procedure at all.
The strangest case I’ve encountered is that I will assign some value to an attribute for ObjectFromExternalLibrary
, and this is the only thing I am doing functionally in the procedure with a print before and after the assignment. I’ll see the print statement at the end, but still get a report that the procedure crashed even though it reached the last print statement.
This is essentially the definition of my CMakeLists.txt
...
find_package(EXTERNAL_LIBRARY REQUIRED COMPONENTS COMPONENT)
...
add_library(${PROJECT_NAME} SHARED my_code.C ${HEADER_AND_SUCH})
target_link_libraries(${PROJECT_NAME} ${EXTERNAL_LIBARARY})
As mentioned before, when compiling similar code as a binary, the program works completely fine, but when I’m trying to use it as a library for a stored procedure I am hitting this issue.
Also I noticed that you posted in all my questions, so that was very appreciated!