[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mico-announce
Subject:    [mico-devel] RE: Error when compiling MICO in Cygwin with
From:       "Joost Kraaijeveld" <J.Kraaijeveld () Askesis ! nl>
Date:       2004-03-26 7:04:32
Message-ID: A3D1526C98B7C1409A687E0943EAC41001E9C5 () obelix ! askesis ! nl
[Download RAW message or body]

Hi,

The problem is that Cygwin tries to dereference pthread_mutexattr_t and assumes that if 
it points to something we call pthread_mutexattr_init twice, which leads to undefined behaviour, see: 
http://www.opengroup.org/onlinepubs/007904975/functions/pthread_mutexattr_init.html 

Make the following change in the code (the memset line):

.....
MICOMT::Mutex::Mutex(MICO_Boolean locked, Attribute attr)
#ifdef DEBUG_NAMES
    : NamedObject()
#endif // DEBUG_NAMES
{
	int result;
	pthread_mutexattr_t m_attr;
	// Make sure that it points to nowhere as Cygwin expects
	memset (&m_attr, 0, sizeof(m_attr)); // <---------

Groeten,

Joost Kraaijeveld
Askesis B.V.
Molukkenstraat 14
6524NB Nijmegen
tel: 024-3888063 / 06-51855277
fax: 024-3608416
e-mail: J.Kraaijeveld@Askesis.nl
web: www.askesis.nl 


> -----Oorspronkelijk bericht-----
> Van: qduran@jazzfree.com [mailto:qduran@jazzfree.com]
> Verzonden: Thursday, March 25, 2004 16:58
> Aan: mico-devel@mico.org
> CC: Joost Kraaijeveld; kgardas@objectsecurity.com
> Onderwerp: Error when compiling MICO in Cygwin with 
> multi-thread support
> 
> 
> Dear All,
> 
> Based on a previous message written by Karel explains that if 
> qt-mt lib is
> installed in the system, then the option '--enabled-threads' should be
> included. (The page is included bellow)
> 
> Well, this is what I've tried: compile Mico with 
> multi-threading in Cygwin.
> This is the full sequence of commands used to compile Mico:
> 
> $ make distclean
> $ ./configure --with-qt=$QTDIR --enable-threads
> To note that the libraries pthread and qt-mt has been found (good!)
> 
> $ make
> 
> When Corba Name sevice is going to be compiled, then the 
> following error
> has been found:
> 
> make[1]: Entering directory `/home/Administrador/mico/mico/coss'
> for i in  naming events streams relship property trader time; 
> do make -C $i
> idlcompile || exit 1; done
> make[2]: Entering directory 
> `/home/Administrador/mico/mico/coss/naming'
> /home/Administrador/mico/mico/./idl/idl --c++-skel --name CosNaming \
> 	../../include/coss/CosNaming.idl
> [2192647572 - 0xa040020] os-thread/pthreads.cc:305: assertion failed
> Signal 6
> make[2]: *** [CosNaming.cc] Error 134
> make[2]: Leaving directory `/home/Administrador/mico/mico/coss/naming'
> make[1]: *** [idlcompile] Error 1
> make[1]: Leaving directory `/home/Administrador/mico/mico/coss'
> make: *** [system] Error 1
> 
> If any patch should be tested, or any other information is 
> needed, please,
> let me know.
> 
> Thanks and Best Regards,
> Joaquim Duran
> 
> 
> Original Message:
> -----------------
> From: Karel Gardas kgardas@objectsecurity.com
> Date: Wed, 24 Mar 2004 11:59:23 +0100 (CET)
> To: qduran@jazzfree.com, mico-devel@mico.org, J.Kraaijeveld@Askesis.nl
> Subject: Re: [mico-devel] Problem of linkage of QT in Cygwin
> 
> 
> You have to enable threads (--enable-threads) to force MICO to look at
> multi-threading Qt library. Does it make sense to check for 
> qt-mt even you
> would like to build single threaded MICO?
> 
> Cheers,
> 
> Karel
> 
> 
> --------------------------------------------------------------------
> mail2web - Check your email from the web at
> http://mail2web.com/ .
> 
> 
> 
_______________________________________________
Mico-devel mailing list
Mico-devel@mico.org
http://www.mico.org/mailman/listinfo/mico-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic