-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting segmentation fault when used under certain load #2
Comments
It looks like a failure to connect is either the cause or the result - hard to tell upon first glance. Overall: keep in mind that by design Mapnik Map's are not designed to be shared between threads (and therefore each rendering thread should have its own map). Can you are more details about how your rendering is working? |
I just found I even get segmentation fault for the example programs came with the mongodb c++ driver. Let me solve this first. Maybe it is the cause. By design, my tile program should fetch data from mongodb and render to tiles of size 256x256. Each request will be handled by a separate thread, and they do have separate Mapnik Map objects. What they are sharing is Mapnik parameters and layers, which should be unchanged through all threads. I'll try to fix the driver problem first. Thanks very much |
Hi Dane, I solved segmentation fault of the examples. It was because I had an old version of boost_thread-mt which is 1.41.0 that was installed long time ago. The boost_thread is newer though, 1.51.0. I have deleted the old boost_thread-mt link and created a new link boost_thread-mt to boost_thread. I also recompiled the mongodb.input and my program. I'm getting less error but still finally got segmentation fault. The good thing is that the error message is much less, following is a copy of the output:
Of which the Any ideas? Thanks |
Hi, Today I tried not to use multithreading to handle requests in the http server and it is working well, but apparently slower. So I guess the problem is related to the multithreading. Then it came to my mind that I have modified the source code of mapnik-mongo a little bit in order to compile with mongodb 2.6. I did two modifications:
My modification is change line 49 in
I'm not sure if this modification is correct and thread-safe. Any suggestions? Thanks |
Not sure, but seems like you are on the right track. I've not looked at this code for a while, but it seems important to get a handle on the reentrancy of the client connections. Also, sharing mapnik layers across threads is usually not safe so try giving each thread its own mapnik map and layer. |
@springmeyer with this issue not solved, I wonder if the plugin is considered stable? |
@lintonye - correct, this plugin is not production ready. It was written only as an experiment and has not seen much testing. Also I'm not actively maintaining it - so if someone wants to take over ownership of it, please feel free. |
Dear Authors of this plugin,
I'm using this plugin with mongodb and mapnik to render tiles. Basically my c++ program starts an http server (using libmicrohttpd) and response to requests for map tiles. It fetches data in mongodb in runtime, then render and return the image back to the client side.
The versions of the packages I'm using is as following:
Mapnik 2.3.x
Mongodb 2.6
It was working fine when I was developing, when every time I send only one or two requests to see if it works. However, when I tried to deploy my program as the backend map tile server for our map application, which generates a lot of requests, I began to have segmentation fault. This happens everytime I send requests too often, say, more than two per second.
Here is a copy of error messages I got: http://pastebin.com/NdeCK8rF
I wonder if this plugin is thread-safe, and whether there is anything I need to pay special attention when using. And what do you think that might cause this error?
Thanks very much
The text was updated successfully, but these errors were encountered: