|
From: Camille T. <ca...@os...> - 2013-11-26 16:51:29
|
Hi Steve,
A little story ...
When running cpp_test built for i386.
If I comment the cpp_test.cpp:152, no error occurs.
a.send_from(st, "test1", "i", 20);
More precisely, the same happens if lo_cpp.h:138 is commented:
int r = lo_send_message_from(from, address, path, m);
Running cpp_test in lldb shows that the error occurs when lo_server_free is called:
frame #4: 0x0007eede liblo.7.dylib`lo_server_free(s=0x0014f720) + 350 at server.c:726
723 s->ai = NULL;
724 }
725 if (s->hostname) {
-> 726 free(s->hostname);
727 s->hostname = NULL;
728 }
729 if (s->path) {
At this point s->hostname == 0x9
I stepped around the call at lo_cpp.h:138 and found that the hostname field of the lo_server was as expected “” (empty string) before the call as expected, then became 0x1 when entered in the body of lo_send_message_from!
Still stepping, at send.c:541, I can see “a->errnum = geterror()“ where a is a lo_address and errnum == 0x9. It became clear that there was a problem in the function call. Going back to lo_cpp.h showed that lo_send_message_from was called with the first two arguments swapped.
“That was easy”, but took me two hours! How can we avoid that? I believe for some reason the warnings are muffled when building from the Makefile. It would be nice to enable them, but I don’t know how to fix that.
After this fix another bug arose, it looks like data corruption too, but haven’t found out why.
Best,
Cam
On 26 nov. 2013, at 10:49, Camille Troillard <ca...@os...> wrote:
>> However, when clang++ is not selected (and therefore cpp_test is not
>> built), then "make test" is successful for me. I have XCode 5.0.2
>> installed.
>>
>> By the way, another way to compile for multiple architectures is the
>> following, which also results in a successful "make test" for me on
>> 10.8:
>>
>> ./configure CFLAGS='-arch i386 -arch x86_64' CXXFLAGS='-arch i386
>> -arch x86_64' CC=clang CXX=clang++
>>
>> or, to use gcc:
>>
>> ./configure CFLAGS='-arch i386 -arch x86_64' CXXFLAGS='-arch i386
>> -arch x86_64' --disable-dependency-tracking
|