Coredump caused by function SERVERreconnectWithoutAlias() and its verifies fix

Fang Cao fangcao.hw at
Mon Mar 11 22:41:01 CET 2013


Today when I try to use mapi.connect() and mapi.reconnect() with mserver5,
I found such crash when I tried to :

fang at fang-ThinkCentre-M91p:~/Work/DB-Farm$ mserver5
# MonetDB 5 server v11.15.1 "Feb2013"
# Serving database 'DB-Farm', using 8 threads
# Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs dynamically
# Found 3.692 GiB available main-memory.
# Copyright (c) 1993-July 2008 CWI.
# Copyright (c) August 2008-2013 MonetDB B.V., all rights reserved
# Visit for further information
# Listening for connection requests on mapi:monetdb://
# MonetDB/GIS module loaded
# MonetDB/JAQL module loaded
# MonetDB/SQL module loaded
Segmentation fault (core dumped)

The root cause is located at:

SERVERreconnectWithoutAlias(Client cntxt, MalBlkPtr mb, MalStkPtr stk,
InstrPtr pci) {
        int *key =(int*) getArgReference(stk,pci,0);
        str *host = (str*) getArgReference(stk,pci,1);
        int *port = (int*) getArgReference(stk,pci,2);
        str *username = (str*) getArgReference(stk,pci,4);  ===>> should be
        str *password = (str*) getArgReference(stk,pci,5); ===>> should be 4
        str *lang = (str*) getArgReference(stk,pci,6); ===>> should be 5

Since we only transfer 5 input parameters, so for the last one “lang”, of
course we will coredump the program when try to check 6th.

After the modification, everything is fine now, for both mapi.connect() and

The reason why this issue is introduced:
pattern reconnect(host:str, port:int, usr:str, passwd:str,lang:str):int
address SERVERreconnectWithoutAlias
comment "Re-establish connection with a remote mserver.";

pattern reconnect(host:str, port:int, db_alias:str, usr:str,
address SERVERreconnectAlias
comment "Re-establish connection with a remote mserver.";

So when to implement SERVERreconnectWithoutAlias(), seems following the
style of SERVERreconnectAlias(). The latter one has 6 inputs, but the first
one has only 5 inputs. So un-needed db_alias was removed, but forgot to
adjust the sequence number.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the developers-list mailing list