mtnbiker66
2nd July 2012, 20:37
Good afternoon --
After a little bit of time last week I finally got an older C++ app incorporated into my Qt app and compiled correctly (went back to square one and found that I was calling the C++ app with a QString parameter but it was receiving it as a char *). So, of course the next step was to run it and immediately it exited with an error code of 1.
Now I then had to learn the debugger and thankfully have a past in assembly programming, so it wasn't too Greek (and even brought back some old memories). The error occurred in my initial "QApplication a(argc, argv);" command where unexpectedly methods in one of the C++ classes were called, but seeing that there are a lot of memory allocation command, I thought, well, hopefully that's a correct behavior as there's nothing I've done that was calling them.
Stepping thru the debugger I got to a call in the stack view to "misaligned_stack_error_entering_dylb_stub_binder" function and further, in the debug log, found a "msg="mi_cmd_stack_list_frames: Not enough frames in stack." " error.
Before heading off down an incorrect path and wasting my time, knowing what a misaligned stack is and knowing my friend's C++ app is 13 years old, would it seem like a reasonable theory that the memory allocations being performed in C++ are causing this alignment issue? He's relying on size_t quite a bit and standard C++ types and doesn't appear to have anything hard coded. If this sounds logical, are their any suggestions beyond the obvious of tearing into the memory allocations?
Interestingly, if within Qt I create a project and only include the code from C++ app, the ensuing executable works fine at the command line, and if I compile and link at the command line it works as well.
It might matter that I'm working on a Mac OS 10.7.4, Qt 4.8.1, and GCC...
Thanks for any direction!
Kodi
After a little bit of time last week I finally got an older C++ app incorporated into my Qt app and compiled correctly (went back to square one and found that I was calling the C++ app with a QString parameter but it was receiving it as a char *). So, of course the next step was to run it and immediately it exited with an error code of 1.
Now I then had to learn the debugger and thankfully have a past in assembly programming, so it wasn't too Greek (and even brought back some old memories). The error occurred in my initial "QApplication a(argc, argv);" command where unexpectedly methods in one of the C++ classes were called, but seeing that there are a lot of memory allocation command, I thought, well, hopefully that's a correct behavior as there's nothing I've done that was calling them.
Stepping thru the debugger I got to a call in the stack view to "misaligned_stack_error_entering_dylb_stub_binder" function and further, in the debug log, found a "msg="mi_cmd_stack_list_frames: Not enough frames in stack." " error.
Before heading off down an incorrect path and wasting my time, knowing what a misaligned stack is and knowing my friend's C++ app is 13 years old, would it seem like a reasonable theory that the memory allocations being performed in C++ are causing this alignment issue? He's relying on size_t quite a bit and standard C++ types and doesn't appear to have anything hard coded. If this sounds logical, are their any suggestions beyond the obvious of tearing into the memory allocations?
Interestingly, if within Qt I create a project and only include the code from C++ app, the ensuing executable works fine at the command line, and if I compile and link at the command line it works as well.
It might matter that I'm working on a Mac OS 10.7.4, Qt 4.8.1, and GCC...
Thanks for any direction!
Kodi