[ wxwindows-Bugs-1640955 ] wxLocale::Init() crashes with Borland BCC

SourceForge.net noreply at sourceforge.net
Sun Jan 21 10:52:11 PST 2007


Bugs item #1640955, was opened at 2007-01-21 19:52
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1640955&group_id=9863

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: Common
Group: Platform specific
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Markus Greither (magr)
Assigned to: Nobody/Anonymous (nobody)
Summary: wxLocale::Init() crashes with Borland BCC

Initial Comment:
When using BCC 5.5.1 and 5.82, my applications crash within wxLocale::Init() when compiled in final mode and unicode enabled (if also without unicode I didn't try, most likely it will also crash). I used 2.8.0.

After some manual debugging I found the reason. It is similar to some older issues with wxLocale, there is an invalid pointer returned. The workaround is to create a temporary local variable, and return this instead.

The code behind all this

return (T&)operator[](uiIndex)

as found in Item() from _WX_DECLARE_BASEARRAY_2(T, name, predicate, classexp), which seems to be causing this is a little beyound by understanding level of C++, so I can't tell whats going on. I do however remember that the wxLocale problem in 2.4.2 was very similar, with a returned pointer became invalid when passed through two functions without being locally relocated, like here. It seems to be a stack cleanup issue, but as I sayd its beyond me to tell if BCC is right or wrong here.

The problem can be duplicated using the internat sample.


Regards

Markus Greither


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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1640955&group_id=9863




More information about the wx-dev mailing list