Opened 17 years ago

Closed 17 years ago

#1719 closed defect (invalid)

CPL HTTP thread safety issue in Apache

Reported by: hobu Owned by: warmerdam
Priority: normal Milestone: 1.5.0
Component: default Version: svn-trunk
Severity: normal Keywords:
Cc:

Description

According to http://curl.haxx.se/libcurl/c/curl_easy_init.html , curl_easy_init is not threadsafe. I am seeing an Apache process go splat when I try to do ImportFromUrl in a mod_python child. I suspect we need some sort of locking in CPLHTTPFetch. I know Nowak was complaining of things not being multi-threaded, but all I'd wish for is for things to lock/block.

I have looked at CPL Multiproc and I see how to create a mutex, so I may take a crack at just putting a Big Ass Lock (tm) around the entire fetch, but I wanted to record this bug as a starting point.

Change History (1)

comment:1 by hobu, 17 years ago

Resolution: invalid
Status: newclosed

False alarm. I was able to attribute the problem to something else, but this still may be an issue someday. I see in the curl.h header that there something that could be used for locking before doing curl_easy_init.

  /* Provide a CURLShare for mutexing non-ts data */
  CINIT(SHARE, OBJECTPOINT, 100),

I don't know if this is what we would want if we were to lock this up, but I don't have any interest in pursuing it.

Note: See TracTickets for help on using tickets.