Problem: ogr-decode crashes when called with the --all-threads option on Linux (and probably other platforms) in terragear "next" branch.
Solution: remove calls to sglog() in a tg_contour subroutine called by ogr-decode. I have submitted a merge request against next that removes these calls. I probably added these calls originally in a previous merge request.
Bit more info on this one: for there kind of infrequent operations on logging, we use a different tactic to ensure thread safety: we have a helper to pause the logging thread and restart it.
I suspect something is not quite right in the pause logic. The idea for this slightly weird system is to avoid need a mutex to access would_log() - which is critical for performance since every log call checks that before doing string-formatting, to see if it should even bother doing the formatting.
probably the cost of using a mutex (or some atomic ints) for log-level and log-prioirty is negligible here, but the PauseLog thing has been working for years, so it's weird that it's crashing in ogr-decode.
More thinking : the PauseLog stuff doesn't actually protect from concurrent calls to setLoglevel itself. Likely we just need to gaurd against that. (You can't use m_lock for this, since it's the thread-control mutex, but you can add another mutex )
I think it makes sense to remove these calls anyway, as they are really
debugging code that has been left in. But great if it helps to solve a
multi-threading issue elsewhere.
On Mon, 27 Apr 2020 at 18:20, James Turner jmturner@users.sourceforge.net
wrote:
--
T +61 (02) 9717 9907
F +61 (02) 9717 3145
M +61 (04) 0249 4148
Related
Tickets: #2222
Honestly I'm not so keen to touch this code, so if you have a work-around or it's debug stuff, I'd say let's go with that.
Yep, absolutely these log statements can be removed with no issues. I've
just generated half of Queensland with them turned off.
On Mon, 27 Apr 2020 at 23:41, James Turner jmturner@users.sourceforge.net
wrote:
--
T +61 (02) 9717 9907
F +61 (02) 9717 3145
M +61 (04) 0249 4148
Related
Tickets: #2222