[Vortex] async connect issue on linux 2.4

Martin Huter m.huter at phion.com
Mon Oct 20 17:26:29 CEST 2008


Am Montag, 20. Oktober 2008 16:54:39 schrieb Francis Brosnan Blazquez:
> Hi Martin!
hi francis.
>
> > thanks, that's great.
>
> Good. I'll apply the patch.
>
> > 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.
>
> Ok, I see. Really good description Martin, it makes sense.
>
> One question: how did you solved this issue until now? Do you use 0 or 1
> directly rather false or true?
regardless, just 1 byte will be copied onto the stack.
i solved the issue by "wrapping" the vortex_connection_is_ok with different 
name in another .c file (with int paramter) (i know, it's not nice!).
the issue occurs only on axl/vortex functions with "bool" paramters which are 
called from c-plus-plus program.
within axl/vortex (c-code, c-caller) it is not an issue.

>
> In the other hand, I think this could it be solved by changing bool
> definition to use char. This will cause vortex and axl build to use a
> fixed single signed byte representation. It remains checking against a c
> ++ program but it should work.
>
> Another approach would be to remove the bool type definition from axl
> and vortex API. This is something we had in mind for some time, but then
> no more issues were found...maybe it is the moment to do so.
for a minor update i would prefer a typedef to a unsigned char as you 
described above.
for the next major update, i think removing the bool definition from axl and 
vortex would be the cleanest way.

cheers,
martin

>
> Let me know your opinion. Thanks Martin!
>
> > cheers
> > martin
>
> --
> 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