JR> I have stripped the prog down to a .h and .cpp file. These are below.
JR> It still asserts as previously in Release64 but not in release32/debug32/64.
JR> I tried wxMessageBox as the first line in HCtrlApp::OnInit() and the assert occurs before that. No text on the message dialog I assume because at that stage there is no wxString.
JR> Somewhere it calls filename.cpp function void wxFileName::Assign(...) at startup.
There really seems to be something wrong with your build environment. Does
the minimal sample work for you (in release 64 bit build)?
Also, if you have troubles with release build only, try enabling debug
information for release builds of everything. This won't change the code
generated but will also create PDB files which will allow you to debug the
problem.
Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
That is far less minimal than the bare bones I posted, though I understand
that compiler flags etc might be configured in a way that mine might not be.
"try enabling debug information for release builds of everything. This won't
change the code
generated but will also create PDB files which will allow you to debug the
problem."
This may be so for VS but not MingW which is what I am using as I posted
initially. makefile.gcc is not configured for 64bit in any of the samples
and I haven't had time to look at switches etc to get it to work with 64.
Perhaps I should be using VS but I like the public domain IDE selection and
most work on other platforms and so avoid too many project changes.
I keep MingW, MingW64 cross and MingW64 native) in different C:\... dirs on
Vista.
I did think someone might be familiar enough with wxApp startup to know
where it might call "void wxFileName::Assign(...)" 3 times and crash -
before it gets to wxOnInit(). I have searched the wxApp/base/.h/cpp files
with no joy so perhaps it is probably a call from something else called by
wxApp.
I re-compiled wxWidgets again with readable output in wxFileName::Assign. In
either nameDummy or extDummy variables a single slash is returned from the
overloaded wxFileName::Assign that checks for UNC names by calling
IsUNCPath(). This occurs only in release and occurs 3 times on startup.
Works fine in debug build though but just not with release using either the
native or cross compilers. I am not convinced this is an environment
problem.
Thanks for replying
JR
JR> "Vadim Zeitlin" <va...@wxwidgets.org> said "There really seems to be
JR> something wrong with your build environment. Does
JR> the minimal sample work for you (in release 64 bit build)?"
JR>
JR> That is far less minimal than the bare bones I posted, though I understand
JR> that compiler flags etc might be configured in a way that mine might not be.
I'm not sure I understood me correctly. By "minimal" sample I mean
samples/minimal distributed with wxWidgets. Have you tried running it?
JR> I did think someone might be familiar enough with wxApp startup to know
JR> where it might call "void wxFileName::Assign(...)" 3 times and crash -
JR> before it gets to wxOnInit(). I have searched the wxApp/base/.h/cpp files
JR> with no joy so perhaps it is probably a call from something else called by
JR> wxApp.
Calling wxFileName::Assign() shouldn't be a problem. The fact that it
crashes is, of course.
JR> I re-compiled wxWidgets again with readable output in wxFileName::Assign. In
JR> either nameDummy or extDummy variables a single slash is returned from the
JR> overloaded wxFileName::Assign that checks for UNC names by calling
JR> IsUNCPath(). This occurs only in release and occurs 3 times on startup.
It doesn't seem normal that either of nameDummy or extDummy gets filled
with a slash but I still don't understand why should this result in a
crash.
JR> "Vadim Zeitlin" <va...@wxwidgets.org> said "There really seems to be
JR> something wrong with your build environment. Does
JR> the minimal sample work for you (in release 64 bit build)?"
JR>
JR> That is far less minimal than the bare bones I posted, though I
understand
JR> that compiler flags etc might be configured in a way that mine might not
be.
VZ " I'm not sure I understood me correctly. By "minimal" sample I mean
samples/minimal distributed with wxWidgets. Have you tried running it?"
I understood you perfectly. The text you omitted from my last post stated
that the makefile.gcc in the minimal sample (or any samples) does not work
with MinGW64. If someone could explain how to modify it or what command
line/variables/switches to use then I will gladly try it.
VZ "Calling wxFileName::Assign() shouldn't be a problem. The fact that it
crashes is, of course."
I do not call this. wxWidgets calls wxFileName::Assign() and crashes before
wxApp.OnInit()
VZ " It doesn't seem normal that either of nameDummy or extDummy gets filled
with a slash but I still don't understand why should this result in a
crash."
BackSlash actually and not normal that it only happens in release build.
Crashes probably because it is stripping the "\" and passing "C:" and not
"C:\" back from ::Assign() as a valid path in Windows.
extDummy gets filled with the backslash from "C:\" leaving "C:" and only in
release build, then it goes on to segfault/crash. No crash in debug mode.
This happens with all my projects in release 64 build. Debug64 still works
perfectly. This never used to happen until I updated from trunk after 6
months absence.
Regards, John
JR> VZ " I'm not sure I understood me correctly. By "minimal" sample I mean
JR> samples/minimal distributed with wxWidgets. Have you tried running it?"
JR>
JR> I understood you perfectly. The text you omitted from my last post stated
JR> that the makefile.gcc in the minimal sample (or any samples) does not work
JR> with MinGW64. If someone could explain how to modify it or what command
JR> line/variables/switches to use then I will gladly try it.
If you can build your own example, can't you use the same
makefile/commands to build minimal.cpp too? I don't use mingw64 myself much
so I don't know what the problem is but I do remember being able to build
the samples whne using msys+configure+mingw64, so maybe this would be a
solution.
JR> VZ "Calling wxFileName::Assign() shouldn't be a problem. The fact that it
JR> crashes is, of course."
JR>
JR> I do not call this. wxWidgets calls wxFileName::Assign() and crashes before
JR> wxApp.OnInit()
I didn't say you called it, did I? All I meant was that there was nothing
wrong with the fact that it was called.
JR> VZ " It doesn't seem normal that either of nameDummy or extDummy gets filled
JR> with a slash but I still don't understand why should this result in a
JR> crash."
JR>
JR> BackSlash actually and not normal that it only happens in release build.
JR> Crashes probably because it is stripping the "\" and passing "C:" and not
JR> "C:\" back from ::Assign() as a valid path in Windows.
JR>
JR> extDummy gets filled with the backslash from "C:\" leaving "C:" and only in
JR> release build, then it goes on to segfault/crash. No crash in debug mode.
JR> This happens with all my projects in release 64 build. Debug64 still works
JR> perfectly. This never used to happen until I updated from trunk after 6
JR> months absence.
I.e. mingw64 worked for you correctly before? If so, it would be really
great if you could bisect this change as I have no idea about where could
such regression come from.
Thanks,
As a follow up it appears that in release64 build at least with MinGW64 a
wxWidgets.exe does not read its own executable path properly and registers
only C:\ no matter where you place the exe. I do not know why. Placing the
exe on C:\ does not help things.
In debug build it does this properly and the vars passed to previously
discussed wxFileName::Assign() contain the correct startup dir no matter
where the exe is placed.
Regards, John