>       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?
> 
> 
> Hmmm...  I see that poll() or select()-based pollset 
> implementations return APR_ENOTIMPL when 
> APR_POLLSET_THREADSAFE is spectified, and I don't know how 
> Windows could use anything else under the covers ;)
> 

This is the revised code, I now get my segfault on the
err_msg("apr_pollset_create success"):

  /* Create my incoming pollset */
  status = apr_pollset_create(&listen_channels, total_listen_channels,
global_context, APR_POLLSET_THREADSAFE);
  if(status != APR_SUCCESS)
    {
      err_msg("apr_pollset_create failed: %s");
      exit(1);
    }
  err_msg("apr_pollset_create success");
>       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.
> 
> 
> Weird...  I would expect that APR_POLLSET_THREADSAFE is only 
> needed with use of the SAME pollset on multiple threads, and 
> using libcurl from another thread wouldn't affect Ganglia's 
> use of its own pollset.
> 
> Sorry!
>  
> 
>       I have tested this with apr-1.2.7 under Cygwin now, it 
> also has the same
>       issue.
> 
> 
> Did apr-1.2.x even know about APR_POLLSET_THREADSAFE?
> 

I've just been referring to the online API docs, I didn't see version
information for this feature.

However, it definitely makes a differences if it is enabled or not.  If
I don't have this option, then gmond dies with SIGPIPE, usually at the
time when it receives an incoming TCP connection and starts writing the
response.

_______________________________________________

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.
_______________________________________________

Reply via email to