Bugs item #2925338, was opened at 2010-01-03 20:46
Message generated for change (Comment added) made by yziquel
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2925338&group_id=56967

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Core
Group: MonetDB5 "stable"
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Guillaume Yziquel (yziquel)
Assigned to: Nobody/Anonymous (nobody)
Summary: BSS not necessarily initialised to 0.

Initial Comment:
Hello.

Operating System: Debian testing + sid. amd64.
Compiler: gcc (Debian 4.3.4-6) 4.3.4
Parser: lex 2.5.35, flex 2.5.35, bison (GNU Bison) 2.4.1
autoconf: autoconf (GNU Autoconf) 2.61
automake: automake (GNU automake) 1.11
libtool: ltmain.sh (GNU libtool) 2.2.6b

To reproduce the bug, follow instructions on 
http://www.mail-archive.com/[email protected]/msg05449.html
You will need OCaml to compile the binding. Then do make gdb-byte, and just 
run. -> segfault.
click on snapshot for the binding: 
http://yziquel.homelinux.org/gitweb/?p=ocaml-monetdb5.git;a=tree

I've been running into dynamic loading issues while dynamically loading 
libmonetdb5.so from OCaml bytecode. In a nutshell, I get a segfault because the 
uninitialised data section (BSS) is somehow not initialised to 0. However, 
implementation of mal_box.c relies on the fact that the BSS is set to 0. 
Therefore, the function findBox contains a line "box[i] != NULL && idcmp(..., 
box[i]->name)". box[i] != NULL evaluates to true since BSS is not initialised 
to 0, but box[i]->name segfaults, quite logically.

I've googled quite a bit, and while BSS seems very very often to be initialised 
to 0, it doesn't seem to be always the case. So could it be possible to have 
the code of MonetDB not assume by default that BSS is initialised to 0?

----------------------------------------------------------------------

>Comment By: Guillaume Yziquel (yziquel)
Date: 2010-01-04 00:08

Message:
In fact, it's a symbol collision that got resolved the wrong way round.
There's a box function in /lib/libncurses.so.5.

int box(WINDOW *win, chtype verch, chtype horch);
The border, wborder and box routines draw a box around the edges of a
window.

And this library is loaded very early on by ocamlrun, the ocaml bytecode
interpreter.

----------------------------------------------------------------------

Comment By: Martin Kersten (mlkersten)
Date: 2010-01-03 22:30

Message:
A patch to the mal_box file has been checked in to deal with this issue as
it should, i.e. only access memory when it is initialized. Code to be
checked for other cases of this pattern

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2925338&group_id=56967

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs

Reply via email to