g++-mp-4.2 executables bad on leopard?
I was poking around at the octave build on Leopard (bug 13686), and I'm suspicious that g++-mp-4.2 is generating bad executables. The first snipped below is a simple program that fails in the same way that "munge-texi" fails in the octave build. It's simply populating a std::map from a file with key=value pairs. Save this as "bug.cc", them compile with: /opt/local/bin/g++-mp-4.2 -g -o bug bug.cc and then give it a whirl... madchenwagen:/tmp$ ./bug foo=bar baz=bop bim=bam Segmentation fault madchenwagen:/tmp$ Has anyone else seen problems like this? My weak attempts at googling turned up nothing that seemed relevant to me. Just wanted to check before filing a new bug... thanks! chris ---8<----------------------------------------------------------------- #include <iostream> #include <map> #include <string> static std::map<std::string, std::string> my_map; int main(int argc, char* argv[]) { while (!std::cin.eof()) { char buf[256]; std::cin.getline(buf, sizeof buf); for (char *c = buf; *c; ++c) { if (*c == '=') { *c = '\0'; my_map[buf] = c + 1; break; } } } return 0; }
On Mar 7, 2008, at 9:41 PM, Chris Waterson wrote:
I was poking around at the octave build on Leopard (bug 13686), and I'm suspicious that g++-mp-4.2 is generating bad executables.
A couple additional data points: * gdb doesn't really seem to grok executables built with g++-mp-4.2 * This problem doesn't happen with Apple's "pre-release" g++-4.2 chris
On 08/03/2008, Chris Waterson <waterson@maubi.net> wrote:
I was poking around at the octave build on Leopard (bug 13686), and I'm suspicious that g++-mp-4.2 is generating bad executables.
The first snipped below is a simple program that fails in the same way that "munge-texi" fails in the octave build. It's simply populating a std::map from a file with key=value pairs. Save this as "bug.cc", them compile with:
/opt/local/bin/g++-mp-4.2 -g -o bug bug.cc
and then give it a whirl...
madchenwagen:/tmp$ ./bug foo=bar baz=bop bim=bam Segmentation fault madchenwagen:/tmp$
The latest gcc43 [gcc-4.3-20080306] doesn't seem to have this problem. agn% /opt/local/bin/g++-mp-4.3 -g -o bug bug.cc agn% ./bug foo=bar baz=bop bim=bam foo=bar ^C
participants (2)
-
Chris Waterson
-
George Nurser