apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Daniel.Poc...@barclayscapital.com>
Subject RE: APR_POLLSET_THREADSAFE crash on Cygwin
Date Thu, 26 Mar 2009 19:24:43 GMT

> APR_POLLSET_THREADSAFE isn't supported with all 
> implementations.  I expect that apr_pollset_create() is 
> returning APR_ENOTIMPL, and the crash is due to an 
> uninitialized pollset.

Excellent point - I should have checked for a return code, there are a
few cases like this in Ganglia where the return codes are ignored.

I've now added this check, and apr_pollset_create is returning
APR_SUCCESS

The seg fault only occurs after the first socket is added to the
pollset, maybe there is another place where return codes are ignored?

> 
> Just curious: Does Ganglia modify the pollset on a separate 
> thread than the poll (thus needing APR_POLLSET_THREADSAFE), 
> and if so why doesn't it already specify 
> APR_POLLSET_THREADSAFE *and* check the apr_pollset_create() 
> return code?  And if it doesn't need it, what do you expect 
> to gain by adding it?

Ganglia doesn't need it normally, it is just a single thread.  The seg
fault occurs during the single threaded initialisation phase where
sockets are created.

However, I am taking advantage of Ganglia's new module API, and some of
my modules start threads.  One of them, which works on Linux and
Solaris, uses libcurl from another thread, and I was getting crashes
until I added APR_POLLSET_THREADSAFE.  Now I want to run the same code
under Cygwin.

I have tested this with apr-1.2.7 under Cygwin now, it also has the same
issue.
_______________________________________________

This e-mail may contain information that is confidential, privileged or otherwise protected
from disclosure. If you are not an intended recipient of this e-mail, do not duplicate or
redistribute it by any means. Please delete it and any attachments and notify the sender that
you have received it in error. Unless specifically indicated, this e-mail is not an offer
to buy or sell or a solicitation to buy or sell any securities, investment products or other
financial product or service, an official confirmation of any transaction, or an official
statement of Barclays. Any views or opinions presented are solely those of the author and
do not necessarily represent those of Barclays. This e-mail is subject to terms available
at the following link: www.barcap.com/emaildisclaimer. By messaging with Barclays you consent
to the foregoing.  Barclays Capital is the investment banking division of Barclays Bank PLC,
a company registered in England (number 1026167) with its registered office at 1 Churchill
Place, London, E14 5HP.  This email may relate to or be sent from other members of the Barclays
Group.
_______________________________________________

Mime
View raw message