[Vortex] Vortex on Mac OS X
Adam Cox
extreme.boredom at gmail.com
Mon Apr 5 11:02:37 CEST 2010
On 5 Apr 2010, at 08:50, Francis Brosnan Blazquez wrote:
>> Hi,
>
> Hi Adam,
>
>> I have been trying without success to get the Vortex library
>> to run on Mac OS X (10.6.3). At first I was unable to get it
>> to build at all, but with some archived messages from this
>> mailing list and some Google searching I have managed to get
>> it into a compiled and installed state. However it crashes
>> every time I attempt to run the listener regression test. This
>> is what the output looks like from gdb:
>>
>> Starting
>> program: /Users/adamcox/Development/Vortex/svn/svn-vortex/test/.libs/vortex-regression-listener
>> Reading symbols for shared
>> libraries .+++++++++++++++.......... done
>> ready and waiting..
>>
>> Program received signal EXC_BAD_ACCESS, Could not access
>> memory.
>> Reason: KERN_PROTECTION_FAILURE at address: 0x00000000
>> [Switching to process 49688]
>> 0xffff061a in __bzero ()
>> (gdb) bt
>> #0 0xffff061a in __bzero ()
>> #1 0x0002cbfd in __vortex_io_waiting_poll_clear
>> (__fd_group=0x404a20) at vortex_io.c:312
>> #2 0x0002f6b4 in __vortex_reader_run (ctx=0x800000) at
>> vortex_reader.c:1300
>> #3 0x987d7a19 in _pthread_start ()
>> #4 0x987d789e in thread_start ()
>
> This is exactly the same error that was reported by Dave Dribin at:
>
> http://lists.aspl.es/pipermail/vortex/2008-April/000554.html
>
> ..but it seems the solution was no reported.
You are correct.
>
>> Contrary to what the path says, this isn't an svn checkout,
>> it's the latest Vortex version from sourceforge (1.1.3).
>
> Ok,
>
>> In order to get to a built state, I had to make a number of
>> modifications to the Makefile and source.
>>
>> In the Makefile I had to change the $PTHREAD_CFLAGS variable
>> to be empty instead of the string 'none'. I also had to set
>> the python builds to use only i386 instead of also building
>> x86_64 and ppc.
>
> Could you post those modifications Adam?
In each of the Makefiles I made these changes:
PTHREAD_CFLAGS = none
PTHREAD_LIBS = -lpthread
to
PTHREAD_CFLAGS = -pthread
PTHREAD_LIBS = -lpthread
Apparently this was the last option I tried. I did also try:
PTHREAD_CFLAGS =
PTHREAD_LIBS = -lpthread
and some other combinations which I neglected to write down. They all compiled and gave the same results in gdb.
I also changed:
PYTHON_CFLAGS = -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -arch ppc
to
PYTHON_CFLAGS = -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386
>
>> In the source files I corrected a number of warnings, mostly
>> printf statements without formatting strings. I also corrected
>> formatting strings where the arguments were of a different
>> type due to platform differences (e.g. off_t is 64 bit on OS
>> X).
>
> I think this issues are already fixed on svn. Maybe you can also post
> this changes to check if they can be integrated into SVN.
Sure, here is the output of a diff between my modified version and a clean copy from the tarball (with the build files removed from the listing):
Defiant:svn adamcox$ diff -r svn-vortex vortex-1.1.3.b4295.g4297
… build files …
diff -r svn-vortex/py-vortex/src/py_vortex.c vortex-1.1.3.b4295.g4297/py-vortex/src/py_vortex.c
798c798
< fprintf (stdout, "%s", str);
---
> fprintf (stdout, str);
… build files …
diff -r svn-vortex/test/vortex-client-connections.c vortex-1.1.3.b4295.g4297/test/vortex-client-connections.c
43c43
< printf ("%s",message);
---
> printf (message);
196c196
< count, stop.tv_sec, (long int)stop.tv_usec);
---
> count, stop.tv_sec, stop.tv_usec);
…build files …
diff -r svn-vortex/test/vortex-client.c vortex-1.1.3.b4295.g4297/test/vortex-client.c
136c136
< printf ("%s",ans);
---
> printf (ans);
154c154
< printf ("%s",ans);
---
> printf (ans);
… build files …
diff -r svn-vortex/test/vortex-regression-client.c vortex-1.1.3.b4295.g4297/test/vortex-regression-client.c
2850,2851c2850,2851
< fprintf (stdout, "Unable to properly read the file, size expected to read %lld, wasn't fulfilled",
< (long long)status.st_size);
---
> fprintf (stdout, "Unable to properly read the file, size expected to read %ld, wasn't fulfilled",
> status.st_size);
3705c3705
< TEST_03_MSGSIZE * 10, (TEST_03_MSGSIZE * 10) / 1024 , result.tv_sec, (long int)result.tv_usec);
---
> TEST_03_MSGSIZE * 10, (TEST_03_MSGSIZE * 10) / 1024 , result.tv_sec, result.tv_usec);
4506c4506
< size, result.tv_sec, (long int)result.tv_usec);
---
> size, result.tv_sec, result.tv_usec);
4518c4518
< vortex_frame_get_payload_size (frame), result.tv_sec, (long int)result.tv_usec);
---
> vortex_frame_get_payload_size (frame), result.tv_sec, result.tv_usec);
5216c5216
< printf ("Test 02-h: ..transfer %d bytes done in %ld segs + %ld microsegs (window size 4096, step 4096.\n", amount, result.tv_sec, (long int)result.tv_usec);
---
> printf ("Test 02-h: ..transfer %d bytes done in %ld segs + %ld microsegs (window size 4096, step 4096.\n", amount, result.tv_sec, result.tv_usec);
5231c5231
< printf ("Test 02-h: ..transfer %d bytes done in %ld segs + %ld microsegs (window size 8192, step 4096.\n", amount, result.tv_sec, (long int)result.tv_usec);
---
> printf ("Test 02-h: ..transfer %d bytes done in %ld segs + %ld microsegs (window size 8192, step 4096.\n", amount, result.tv_sec, result.tv_usec);
5246c5246
< printf ("Test 02-h: ..transfer %d bytes done in %ld segs + %ld microsegs (window size 16384, step 4096.\n", amount, result.tv_sec, (long int)result.tv_usec);
---
> printf ("Test 02-h: ..transfer %d bytes done in %ld segs + %ld microsegs (window size 16384, step 4096.\n", amount, result.tv_sec, result.tv_usec);
5261c5261
< printf ("Test 02-h: ..transfer %d bytes done in %ld segs + %ld microsegs (window size 32768, step 4096.\n", amount, result.tv_sec, (long int)result.tv_usec);
---
> printf ("Test 02-h: ..transfer %d bytes done in %ld segs + %ld microsegs (window size 32768, step 4096.\n", amount, result.tv_sec, result.tv_usec);
5276c5276
< printf ("Test 02-h: ..transfer %d bytes done in %ld segs + %ld microsegs (window size 65536, step 4096.\n", amount, result.tv_sec, (long int)result.tv_usec);
---
> printf ("Test 02-h: ..transfer %d bytes done in %ld segs + %ld microsegs (window size 65536, step 4096.\n", amount, result.tv_sec, result.tv_usec);
5299c5299
< printf ("Test 02-h: ..transfer %d bytes done in %ld segs + %ld microsegs (window size 32768, step 4096.\n", amount, result.tv_sec, (long int)result.tv_usec);
---
> printf ("Test 02-h: ..transfer %d bytes done in %ld segs + %ld microsegs (window size 32768, step 4096.\n", amount, result.tv_sec, result.tv_usec);
6466c6466
< stop.tv_sec, (long int)stop.tv_usec, total_bytes);
---
> stop.tv_sec, stop.tv_usec, total_bytes);
6504c6504
< stop.tv_sec, (long int)stop.tv_usec, total_bytes);
---
> stop.tv_sec, stop.tv_usec, total_bytes);
9260c9260
< result.tv_sec, (long int)result.tv_usec);
---
> result.tv_sec, result.tv_usec);
9265c9265
< printf ("%s: %s [ OK ] (finished in %ld secs, %ld microseconds)\n", test_name, message, result.tv_sec, (long int)result.tv_usec);
---
> printf ("%s: %s [ OK ] (finished in %ld secs, %ld microseconds)\n", test_name, message, result.tv_sec, result.tv_usec);
… build files …
diff -r svn-vortex/test/vortex-regression-common.c vortex-1.1.3.b4295.g4297/test/vortex-regression-common.c
88,89c88,89
< fprintf (stdout, "Unable to properly read the file, size expected to read %lld (but found %ld), wasn't fulfilled\n",
< (long long)status.st_size, requested);
---
> fprintf (stdout, "Unable to properly read the file, size expected to read %ld (but found %ld), wasn't fulfilled\n",
> status.st_size, requested);
… build files …
diff -r svn-vortex/xml-rpc-gen/exarg.c vortex-1.1.3.b4295.g4297/xml-rpc-gen/exarg.c
456c456
< /*int vsnprintf(char *str, size_t size, const char *format, va_list ap);*/
---
> int vsnprintf(char *str, size_t size, const char *format, va_list ap);
898c898
< printf ("%s", __exarg_usage_header);
---
> printf (__exarg_usage_header);
920c920
< printf ("%s", __exarg_post_usage_header);
---
> printf (__exarg_post_usage_header);
1015c1015
< printf ("%s",__exarg_help_header);
---
> printf (__exarg_help_header);
1036c1036
< printf ("%s",__exarg_post_help_header);
---
> printf (__exarg_post_help_header);
…. Build files
>
>> I have tried using the Makefile from the previous OS X thread
>> with no luck either.
>>
>> Has anyone else had more luck that me in getting this to work?
>
> We have reports from users using Vortex on Mac OS/X without problems
> (but using Xcode). The interesting thing of your backtrace is that
> __vortex_io_waiting_poll_clear receives a valid __fd_group (0x404a20),
> or at least something not pointing to 0x0 (contrary to Dave Dribin
> report).
>
> I'd recommend breaking on __vortex_io_w4aiting_poll_clear and display
> poll variable content. You could try something like:
>
> (gdb) b __vortex_io_waiting_poll_clear
> (gdb) run
> (* once reached poll_clear *)
> (gdb) n
> (gdb) display poll
> (gdb) display poll->length
> (gdb) display poll->set
> (gdb) display poll->max
>
> ...you'll have to adapt these instructions to your context.
(gdb) b __vortex_io_waiting_poll_clear
Breakpoint 1 at 0xa29bd9: file vortex_io.c, line 311.
(gdb) run
Starting program: /Users/adamcox/Development/Vortex/svn/svn-vortex/test/.libs/vortex-regression-listener
Reading symbols for shared libraries .+++++++++++++++.......... done
ready and waiting..
[Switching to process 75802]
Breakpoint 1, __vortex_io_waiting_poll_clear (__fd_group=0x409160) at vortex_io.c:311
311 poll->length = 0;
(gdb) display poll
Unable to access variable "poll"
1: poll = <variable optimized away by compiler>
(gdb) display (VortexPoll *)__fd_group
2: (VortexPoll *) __fd_group = (VortexPoll *) 0x409160
(gdb) display ((VortexPoll *)__fd_group)->length
3: ((VortexPoll *) __fd_group)->length = 0
(gdb) display ((VortexPoll *)__fd_group)->set
4: ((VortexPoll *) __fd_group)->set = (struct pollfd *) 0x0
(gdb) display ((VortexPoll *)__fd_group)->max
5: ((VortexPoll *) __fd_group)->max = -1
(gdb) display sizeof(struct pollfd)
6: 8 = 8
(gdb) bt
#0 __vortex_io_waiting_poll_clear (__fd_group=0x409160) at vortex_io.c:311
#1 0x0002f6b4 in __vortex_reader_run (ctx=0x804e00) at vortex_reader.c:1300
#2 0x987d7a19 in _pthread_start ()
#3 0x987d789e in thread_start ()
looks to me like memset (poll->set, 0, sizeof (struct pollfd) * poll->max); is going to try to write -8 bytes to memory address 0… that can't be good. I wouldn't know where to start to work out why though.
>
> The other misterios thing is that bzero is called rather than memset
> (which is what is placed on the code). Maybe this is what is causing
> these builds to fail...:-?
>
> Give a try let us to know your progress.
>
> We have planned to release 1.1.4 soon to include latest changes. Cheers!
>
>> Thanks in advance for any help you may be able to provide.
>>
>> Kind Regards,
>>
>> Adam
> --
> Francis Brosnan Blazquez <francis at aspl.es>
> ASPL
>
Adam.
More information about the Vortex
mailing list