Guillaume Yziquel wrote:
Martin Kersten a écrit :
pthread_create(&sqlthread, NULL, start_sql_server, (void *) server);
I would start by being more defensive. What is the return value of pthread_create? did it work?
I have been progressively wrapping stuff at a very low-level to see where the segfault comes from. I have reached the conclusion that the segfault occurs at the line 71 of embeddedclient.c.in, in the monetdb-sql debian package:
if (mal_init())
It's the call to mal_init() that gives rise to a segfault.
As said before, there is no guarantee that your snippet will work as shown. It just contains basic programming errors, namely properly handling return values, and dealing with parallel processing. You have to wait for the sql-server thread to finish it initialization work, which may contain a lot of actions. Alternative, run it with gdb to be able to inspect the stack trace of all running threads to identify your programming misconception. regards, Martin
That's quite a pain...
All the best,