Hello everyone,
I am using Hexagon SDK 2.0 on DragonBoard 810 bought from Intrinsyc Technologies.
I follow the instructions in Hexagon SDK document(${SDK_ROOT}\docs\Examples_Computer-Vision.html) and run cornerApp(${SDK_ROOT}\examples\fastcv\cornerApp) on DragonBoard 810 success.
But I found if I compile the cornerApp as a shared library(cornerApp.so) and write a simple program dlopen this shared library, I will get hang when dlclose().
The following simple modifications can reproduce the error:
1.Modify android.min: cornerApp build as shared library, build src/foo.c as executable
- # stub library
- BUILD_DLLS += libcornerApp
- libcornerApp_QAICIDLS += \
- inc/cornerApp \
- $(MAKE_D_DSPCV_INCDIR)/dspCV \
- libcornerApp_C_SRCS += \
- $V/cornerApp_stub \
- $V/dspCV_stub \
- libcornerApp_DLLS += libadsprpc
- # stand-alone corner-detection executable
- BUILD_DLLS += cornerApp
- cornerApp_QAICIDLS += \
- inc/cornerApp \
- $(MAKE_D_DSPCV_INCDIR)/dspCV \
- cornerApp_C_SRCS += src/cornerApp
- cornerApp_LIBS += rpcmem
- cornerApp_DLLS += libcornerApp \
- libadsprpc \
- cornerApp_LD_FLAGS += -llog
- cornerApp_DEFINES += VERIFY_PRINT_ERROR
- BUILD_EXES += dlopen_test
- dlopen_test_C_SRCS += src/foo
- dlopen_test_LD_FLAGS += -ldl
- # copy final build products to the ship directory
- BUILD_COPIES = \
- $(DLLS) \
- $(EXES) \
- $(LIBS) \
- $(SHIP_DIR)/ ;
2.Add src/foo.c:
- #include <stdlib.h>
- #include <stdio.h>
- #include <dlfcn.h>
- int main(int argc, char **argv)
- {
- void *handle;
- int (*test_main_start)(int argc, char* argv[]);
- char *error;
- handle = dlopen ("cornerApp.so", RTLD_LAZY);
- if (!handle) {
- fputs (dlerror(), stderr);
- exit(1);
- }
- test_main_start = dlsym(handle, "test_main_start");
- if ((error = (char *)dlerror()) != NULL) {
- fputs(error, stderr);
- exit(1);
- }
- printf ("test_main_start returned %d\n", (*test_main_start)(argc, argv));
- dlclose(handle);
- return 0;
- }
Does anyone know how to solve this problem?