[Vortex] async connect issue on linux 2.4

Martin Huter m.huter at phion.com
Mon Oct 20 16:10:11 CEST 2008


Am Montag, 20. Oktober 2008 15:47:26 schrieb Francis Brosnan Blazquez:
> > hi.
>
> Hi Martin,
hi francis.
>
> > found an issue in asyncronous connecting in __vortex_connection_new:
> > i couldn't figure out why, but it seems that - at least on linux 2.4 and
> > older glibc versions - the select/poll after a non-blocking connect may
> > (in very rare cases!) result a value >0 though the connection wasn't
> > established at all.
> > i think it has something to do with the arp handling in the kernel, but
> > i'm not sure.
> > anyway, querying the SO_ERROR option on the socket results an error in
> > this case and one can find out that the connection is not established.
> > appended tiny patch queries that option in the __vortex_connection_new
> > function, and it works for me.
>
> Assuming the error happens when the err returned by
> vortex_io_waiting_invoke_wait is greater than 0 (that is, it is
> signaling connection complete), I've updated your patch to check the
> error condition only on that branch. I've attached it.
thanks, that's great. 
well you're right, it is really difficult to reporduce that situation, but the 
issue basically indeed is letal! i think the problem consists when linking 
vortex in a c-plus-plus program.
the reason is the typedef definition of bool in 
axl_decl.h.
when vortex/axl is compiled, "bool" is not defined and thus typedefed to int 
(4 bytes).
when vortex.h and its dependend header files are included in a c-plus-plus 
program, "bool" is defined and of size 1 byte! therefore a "bool" parameter - 
in most cases - is interpreted as set ("true") regardless what the parameter 
says.
this issue in combination with the fixed on above results in a freed 
VortexConnection after a vortex_connection_is_ok(conn, false) call and thats 
why the sequencer sequentially crashes.

cheers
martin


>
> Let me know your opinion and if this patch also solves your issue.

>
> Thanks Martin!
>
> > cheers
> > martin huter
> >
> > _______________________________________________
> > Vortex mailing list
> > Vortex at lists.aspl.es
> > http://lists.aspl.es/cgi-bin/mailman/listinfo/vortex
>
> --
> Francis Brosnan Blazquez <francis at aspl.es>
> Advanced Software Production Line, S.L.



-- 
Martin Huter
Unit Manager
phion AG
Eduard-Bodem-Gasse 1
A-6020 Innsbruck

Tel:     +43 (0) 508 100
Fax:     +43 (0) 508 100 20
Mail:    m.huter at phion.com
Web:     http://www.phion.com

phion AG
Vorsitzender des Aufsichtsrates: Dr. Karl  Lamprecht
Vorstand: Dr. Wieland Alge, Mag. Günter Klausner
Sitz der Gesellschaft: 6020 Innsbruck, Österreich
Handelsgericht Innsbruck Firmenbuch: 184392s
UID-Nr:: ATU47509003


More information about the Vortex mailing list