www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - C-ABI bug returning string/struct on linux 32 bit when using wxd


shortly i tried to use wxd for building a native 64 bit application on 
my OpenSuse 11.4 - 64 bit box. Sadly i ran into issue 5570 wich stopped 
me from building a woking wxd lib. So i stepped back to build the app 
for 32 bit. This worked up to the point where i tried to use a 
HtmlListBox  control. Here i encountered a segmentation fault when this 
cpp method  tries to execute a D callback function.

htmllbox.cpp   class  _HtmlListbox:

wxString OnGetItemMarkup( size_t n) const
{ wxc_string tmp = m_OnGetItemMarkup(m_dobj, n); return wxstr(tmp); }


static extern(C) private string staticOnGetItemMarkup(HtmlListBox 
obj,size_t n)
      return obj.OnGetItemMarkup(n);

The debbuger shows me that the calling cpp function pushes the tmp 
pointer on the stack as the first parameter while the D function seems 
to expect the obj as first parameter.

This happens with the 64-bit suse-rpm  DMDs  in versioons 2.54 and 2.55.

I can't find anything about this in the bugtracker, so i would like to 
know if this is really a bug or if wxd is on the wrong path.

Btw. i can't find a link to the bugtracker on the dpl.org page.

Gerrit Wichert
Sep 11 2011