[Vortex] Regression tests failing on FreeBSD 7.0

Skye skye at F4.ca
Tue Nov 25 18:51:20 CET 2008


I discovered the bug, it is with the INT_TO_PTR conversion macros in
axl_config.h
This will cause crashes on any platform that have sizeof(void *) = 64 bits.

Here's why:

vortex_hash_new_full(): 0x8012d01c0 <-- new connection hash created
vortex_mutex_create(): 0x8012d01c8
vortex_hash_new_full(): 0x8012d0200
vortex_mutex_create(): 0x8012d0208
vortex_hash_new_full(): 0x8012d0240
vortex_mutex_create(): 0x8012d0248
vortex_mutex_create(): 0x8012d20f0
vortex_mutex_create(): 0x8012d2100
vortex_mutex_create(): 0x8012d2110
vortex_mutex_create(): 0x8012e42a8
vortex_mutex_create(): 0x8012e42b0
vortex_mutex_create(): 0x8012e42d0
vortex_mutex_create(): 0x8012e42e8
vortex_mutex_create(): 0x8012e4210
vortex_mutex_create(): 0x8012e42f8
vortex_mutex_create(): 0x8012e4300
vortex_mutex_create(): 0x8012e4308
vortex_hash_new_full(): 0x8012d0440
vortex_mutex_create(): 0x8012d0448
vortex_mutex_lock(): 0x8012d51a8... locked
vortex_hash_lookup(): 0x8012d01c0
vortex_mutex_lock(): 0x8012d01c8... locked
vortex_mutex_lock(): 0x8012d01c8... locked
vortex_mutex_lock(): 0x8012d0208... locked
vortex_mutex_lock(): 0x801107430... locked
New connection accepted from: 127.0.0.1:52125
vortex_hash_lookup(): 0x12d01c0    <---- uh oh, dropped upper 32 bits
zsh: segmentation fault  ./vortex-simple-listener  <-- kaboom sigsegv

To fix it, I edited axl_config.h as follows:

/* was: #define INT_TO_PTR(integer)   ((axlPointer) (long) ((int)integer))
*/
#define INT_TO_PTR(integer)   ((axlPointer)(long)integer)

/* was: #define PTR_TO_INT(ptr) ((int) (long) (ptr)) */
#define PTR_TO_INT(ptr) ((long)ptr)

Then I did a clean recompile of Vortex.
I'm not sure if this solves all problems, but it makes the Vortex regression
test work finally on amd64.
Maybe there can still be problems with the hash key conversions or
something.

Skye


-- 
View this message in context: http://n2.nabble.com/Regression-tests-failing-on-FreeBSD-7.0-tp1574242p1577428.html
Sent from the Vortex -- Open Source BEEP implementation mailing list archive at Nabble.com.



More information about the Vortex mailing list