-
Notifications
You must be signed in to change notification settings - Fork 54
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
Segfault when downloading tiles #110
Comments
If you can recreate it, is it possible to do an:
And maybe do a backtrace in each thread please. |
Needless to say but I've never had any issues. One thing I don't understand in your backtrace is the parameters in "#4"
Options is repeated twice. How is this? |
Here's a log of For |
Everyday is a school day! (Learns about @entry output in gdb). I wouldn't have thought that the options pointer should change, which possibly indicates some memory issue. ATM I can't determine much wrong with commit c4c4914 However I've noticed something - attached a patch file named ".txt" format just to please github's attachment mechanism - in that the options is not quite thread robust. I don't expect this to fix your issue, but it's worth a try. |
Thanks for this. I'll have a play around and see if i can see what might be causing it. I tried the patch -- it didn't fix it unfortunately. Thought i'm not using any custom HTTP headers on my maps, so you're right it's not too surprising. |
The gdb log has changed though -- the error now happens at the end of the function:
|
I have to head out now -- but here's what i found. The map_download_thread function in vikmapslayer.c is reaching the end with handle = 1 when it segfaults. Normally handle is a 10 digit number. It then calls the clean up code, which passes the handle of 1 to curl_easy_cleanup, which crashes. |
Ok, i think i see what's changing the handle to 1. In map_download_thread in vikmapslayer.c there is
This should either be a +1 on the dimensions of the needed array, or a < instead of <= in the for loops. The error "seems" to go away with the thread-safe patch and +1 to the needed array dimensions. |
Yes well done! Needs +1 added to the array dimensions. It may be 'luck' of the draw - depending on if the out of array bounds is actually written to, and then depending on the compilation what memory the out of bounds is and what the effect of unintentionally writing to it - crashing vs data corruption vs no observable change. Such that I never noticed before. |
Fix commit SHA:c4c4914 as the 'needed' array definition size needs to bigger, otherwise it may attempt to access outside the bounds of the array.
Commit c4c4914 introduced a segfault for me. It happens in the map download call on line 1751 of vikmapslayer.c:
The complete backtrace is included below. I had a poke around, but didn't see an obvious cause of the error. Perhaps there is a race condition somewhere?
The text was updated successfully, but these errors were encountered: