Changeset: c038c6971c41 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/c038c6971c41 Modified Files: cmake/monetdb-defines.cmake monetdb5/mal/mal_linker.c monetdb_config.h.in sql/backends/monet5/sql_gencode.c sql/backends/monet5/sql_scenario.c Branch: default Log Message:
Merge with Jun2023 branch. diffs (179 lines): diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c --- a/clients/mapiclient/mclient.c +++ b/clients/mapiclient/mclient.c @@ -3482,6 +3482,11 @@ main(int argc, char **argv) #endif mnstr_printf(toConsole, "using mapi library %s\n", mapi_get_mapi_version()); + free(dotfile.user); + free(dotfile.passwd); + free(dotfile.dbname); + free(dotfile.host); + free(dotfile.output); return 0; } case 'w': diff --git a/cmake/monetdb-defines.cmake b/cmake/monetdb-defines.cmake --- a/cmake/monetdb-defines.cmake +++ b/cmake/monetdb-defines.cmake @@ -105,6 +105,7 @@ function(monetdb_configure_defines) check_function_exists("setsid" HAVE_SETSID) check_function_exists("shutdown" HAVE_SHUTDOWN) check_function_exists("sigaction" HAVE_SIGACTION) + check_function_exists("siglongjmp" HAVE_SIGLONGJMP) check_symbol_exists("stpcpy" "string.h" HAVE_STPCPY) check_function_exists("strcasestr" HAVE_STRCASESTR) check_symbol_exists("strncasecmp" "strings.h" HAVE_STRNCASECMP) diff --git a/monetdb5/mal/mal_linker.c b/monetdb5/mal/mal_linker.c --- a/monetdb5/mal/mal_linker.c +++ b/monetdb5/mal/mal_linker.c @@ -71,7 +71,6 @@ fileexists(const char *path) MALfcn getAddress(const char *modname, const char *fcnname) { - void *dl; MALfcn adr; int idx = 0; static int prev = -1; @@ -103,46 +102,23 @@ getAddress(const char *modname, const ch } } - if (lastfile) { - /* first should be monetdb5 */ - assert(strcmp(filesLoaded[0].modname, "monetdb5") == 0 - || strcmp(filesLoaded[0].modname, "embedded") == 0); - adr = (MALfcn) dlsym(filesLoaded[0].handle, fcnname); - if (adr != NULL) { - prev = 0; - return adr; /* found it */ + if (lastfile == 0) { + char *msg = loadLibrary("monetdb5", 1); + if (msg) { + freeException(msg); + return NULL; } - return NULL; } - /* - * Try the program libraries at large or run through all - * loaded files and try to resolve the functionname again. - * - * the first argument must be the same as the base name of the - * library that is created in src/tools */ -#ifdef __APPLE__ - dl = mdlopen(SO_PREFIX "monetdb5" SO_EXT, RTLD_NOW | RTLD_GLOBAL); -#else - dl = dlopen(SO_PREFIX "monetdb5" SO_EXT, RTLD_NOW | RTLD_GLOBAL); -#endif - if (dl == NULL) - return NULL; - adr = (MALfcn) dlsym(dl, fcnname); - filesLoaded[lastfile].modname = GDKstrdup("libmonetdb5"); - if (filesLoaded[lastfile].modname == NULL) { - dlclose(dl); - return NULL; + /* first should be monetdb5 */ + assert(strcmp(filesLoaded[0].modname, "monetdb5") == 0 + || strcmp(filesLoaded[0].modname, "embedded") == 0); + adr = (MALfcn) dlsym(filesLoaded[0].handle, fcnname); + if (adr != NULL) { + prev = 0; + return adr; /* found it */ } - filesLoaded[lastfile].fullname = GDKstrdup("libmonetdb5"); - if (filesLoaded[lastfile].fullname == NULL) { - dlclose(dl); - GDKfree(filesLoaded[lastfile].modname); - return NULL; - } - filesLoaded[lastfile].handle = dl; - lastfile++; - return adr; + return NULL; } /* diff --git a/monetdb_config.h.in b/monetdb_config.h.in --- a/monetdb_config.h.in +++ b/monetdb_config.h.in @@ -157,6 +157,7 @@ #cmakedefine HAVE_SETSID 1 #cmakedefine HAVE_SHUTDOWN 1 #cmakedefine HAVE_SIGACTION 1 +#cmakedefine HAVE_SIGLONGJMP 1 #cmakedefine HAVE_STPCPY 1 #cmakedefine HAVE_STRCASESTR 1 #cmakedefine HAVE_STRNCASECMP 1 diff --git a/sql/backends/monet5/sql_gencode.c b/sql/backends/monet5/sql_gencode.c --- a/sql/backends/monet5/sql_gencode.c +++ b/sql/backends/monet5/sql_gencode.c @@ -1201,8 +1201,6 @@ backend_dumpproc(backend *be, Client c, *be = bebackup; c->curprg = symbackup; m->sa->eb = ebsave; - if (m->sa->eb.enabled) - eb_error(&m->sa->eb, m->errstr[0] ? m->errstr : be->mb->errors ? be->mb->errors : *GDKerrbuf ? GDKerrbuf : "out of memory", 1000); return -1; } diff --git a/sql/backends/monet5/sql_scenario.c b/sql/backends/monet5/sql_scenario.c --- a/sql/backends/monet5/sql_scenario.c +++ b/sql/backends/monet5/sql_scenario.c @@ -101,7 +101,7 @@ SQLprelude(Client cntxt, MalBlkPtr mb, M const char *caller_revision = (const char *) (void *) mb; const char *p = mercurial_revision(); if (p && strcmp(p, caller_revision) != 0) { - throw(MAL, "sq;.start", "incompatible versions: caller is %s, GDK is %s\n", caller_revision, p); + throw(MAL, "sql.start", "incompatible versions: caller is %s, GDK is %s\n", caller_revision, p); } } diff --git a/sql/common/exception_buffer.c b/sql/common/exception_buffer.c --- a/sql/common/exception_buffer.c +++ b/sql/common/exception_buffer.c @@ -29,5 +29,9 @@ eb_error( exception_buffer *eb, char *ms eb->code = val; eb->msg = msg; eb->enabled = 0; /* not any longer... */ +#ifdef HAVE_SIGLONGJMP + siglongjmp(eb->state, eb->code); +#else longjmp(eb->state, eb->code); +#endif } diff --git a/sql/include/exception_buffer.h b/sql/include/exception_buffer.h --- a/sql/include/exception_buffer.h +++ b/sql/include/exception_buffer.h @@ -21,10 +21,14 @@ typedef struct exception_buffer { int enabled; } exception_buffer; -extern exception_buffer *eb_init( exception_buffer *eb ); +extern exception_buffer *eb_init(exception_buffer *eb); /* != 0 on when we return to the savepoint */ -#define eb_savepoint(eb) ((eb)->enabled=1,setjmp((eb)->state)) -extern _Noreturn void eb_error( exception_buffer *eb, char *msg, int val ); +#ifdef HAVE_SIGLONGJMP +#define eb_savepoint(eb) ((eb)->enabled = 1, sigsetjmp((eb)->state, 0)) +#else +#define eb_savepoint(eb) ((eb)->enabled = 1, setjmp((eb)->state)) +#endif +extern _Noreturn void eb_error(exception_buffer *eb, char *msg, int val); #endif /* EXCEPTION_BUFFER_H */ diff --git a/tools/monetdbe/monetdbe.c b/tools/monetdbe/monetdbe.c --- a/tools/monetdbe/monetdbe.c +++ b/tools/monetdbe/monetdbe.c @@ -754,8 +754,8 @@ monetdbe_startup(monetdbe_database_inter monetdbe_embedded_url = dbdir?GDKstrdup(dbdir):NULL; if (dbdir && !monetdbe_embedded_url) set_error(mdbe, createException(MAL, "monetdbe.monetdbe_startup", MAL_MALLOC_FAIL)); +cleanup: GDKfataljumpenable = 0; -cleanup: if (mdbe->msg) monetdbe_shutdown_internal(); } _______________________________________________ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org