Ok i added a parameter to select how the gdal dataset should be opened
(the parameter is "shared", but could be renamed to something more
intellegible).

From what i read the GdalOpenShared is available only from version
1.6.0, so i'm doing a bit of #ifdef around that, to allow the use of
previous version of gdal too.

Let me know any consideration on the matter...

Cheers

Lucio


On Thu, May 14, 2009 at 1:14 AM, Dane Springmeyer <[email protected]> wrote:
> Hey Lucio,
>
> On May 13, 2009, at 3:26 PM, kRAkEn/gORe wrote:
>
>> hi, i thought it was a good thing to favour GdalOpenShared instead of
>> GdalOpen when using the same dataset a lot of times in the same
>> application and used mapnik in a headless server serving multiple maps
>> with the same rasters all along (and tiling).
>
>
> I think I surely is, but perhaps the problem lies in that not until gdal 1.6
> (i think I read something about that) will the behavior be predicatable...
>
> or that QGIS opens in non-shared mode and the combination is dangerous?
>
> I can predictably get crashes like the below when opening as Shared from
> mapnik, but things work fine with the previous code.
>
>> Never had any problems
>> with that.
>
> I bet it is the combo of shared and non-shared access...
>
>> I don't have qgis here but it will be not a problem to
>> install it and test it besides using gdal.input with my changes.
>
> Okay, great. Keep in mind that QGIS requires python 2.5 so mapnik will also
> need to be (re) compiled against that for you to try within the QGIS python
> console.
>
> Should work fine either way outside of QGIS console.
>
>> I'll
>> do next days to come, and do some more pushing to the plugins, gdal,
>> ogr, oracle and sqlite as i see them quite behind their shape/raster
>> counterpart.
>>
> Great.
>
>> Probably we will need to provide a gdal's datasource parameter to
>> control the kind of function to favour, shared or not shared ?
>>
>
> This was my thought as well! Have the default not be shared, but be able to
> turn it on...
>
> And here is the crash...
>
>
> - dane
>
> Thread 0 Crashed:
> 0   gdal.input                          0x146eaa4b gdal_featureset::next() +
> 347
> 1   _mapnik.so                          0x12381561
> mapnik::feature_style_processor<mapnik::agg_renderer<mapnik::Image32>
>>::apply_to_layer(mapnik::Layer const&,
> mapnik::agg_renderer<mapnik::Image32>&, mapnik::projection const&, double) +
> 2145
> 2   _mapnik.so                          0x12377e4f render2(mapnik::Map
> const&, mapnik::Image32&) + 335
> 3   _mapnik.so                          0x1237e4df
> boost::python::objects::caller_py_function_impl<boost::python::detail::caller<void
> (*)(mapnik::Map const&, mapnik::Image32&),
> boost::python::default_call_policies, boost::mpl::vector3<void, mapnik::Map
> const&, mapnik::Image32&> > >::operator()(_object*, _object*) + 191
> 4   ...python-xgcc40-mt-1_39.dylib      0x12120e74
> boost::python::objects::function::call(_object*, _object*) const + 468
> 5   ...python-xgcc40-mt-1_39.dylib      0x121226e5
> boost::detail::function::void_function_ref_invoker0<boost::python::objects::(anonymous
> namespace)::bind_return,
> void>::invoke(boost::detail::function::function_buffer&) + 37
> 6   ...python-xgcc40-mt-1_39.dylib      0x12129719
> boost::function0<void>::operator()() const + 41
> 7   ...python-xgcc40-mt-1_39.dylib      0x12128b0c
> boost::python::detail::exception_handler::operator()(boost::function0<void>
> const&) const + 204
> 8   _mapnik.so                          0x123795b4
> boost::detail::function::function_obj_invoker2<boost::_bi::bind_t<bool,
> boost::python::detail::translate_exception<mapnik::config_error, void
> (*)(mapnik::config_error const&)>, boost::_bi::list3<boost::arg<1>,
> boost::arg<2>, boost::_bi::value<void (*)(mapnik::config_error const&)> > >,
> bool, boost::python::detail::exception_handler const&,
> boost::function0<void>
> const&>::invoke(boost::detail::function::function_buffer&,
> boost::python::detail::exception_handler const&, boost::function0<void>
> const&) + 36
> 9   ...python-xgcc40-mt-1_39.dylib      0x12128bdf
> boost::python::handle_exception_impl(boost::function0<void>) + 63
> 10  ...python-xgcc40-mt-1_39.dylib      0x1211eb62 function_call + 98
> 11  org.python.python                   0x11278505 PyObject_Call + 50
> 12  org.python.python                   0x112e6832 PyEval_EvalFrameEx +
> 17904
> 13  org.python.python                   0x112e8173 PyEval_EvalCodeEx + 1638
> 14  org.python.python                   0x11292488 PyFunction_SetClosure +
> 2667
> 15  org.python.python                   0x11278505 PyObject_Call + 50
> 16  org.python.python                   0x11280e3a PyMethod_New + 2457
> 17  org.python.python                   0x11278505 PyObject_Call + 50
> 18  org.python.python                   0x112e182d
> PyEval_CallObjectWithKeywords + 211
> 19  sip.so                              0x1118051f sip_api_invoke_slot + 410
> 20  QtCore.so                           0x1138d4ef
> PyQtProxy::invokeSlot(_sipSlotConnection const&, void**) + 117
> 21  QtCore.so                           0x1139adaa
> PyQtProxy::unislot(void**) + 134
> 22  QtCore.so                           0x1139d62e
> PyQtProxy::qt_metacall(QMetaObject::Call, int, void**) + 242
> 23  QtCore                              0x00320420
> QMetaObject::activate(QObject*, int, int, void**) + 528
> 24  libqgis_gui.1.0.dylib               0x0069448e
> QgsMapCanvas::renderComplete(QPainter*) + 62
> 25  libqgis_gui.1.0.dylib               0x0067e593 QgsMapCanvas::refresh() +
> 163
> 26  gui.so                              0x11f4b48e meth_QgsMapCanvas_refresh
> + 110
> 27  org.python.python                   0x112e651e PyEval_EvalFrameEx +
> 17116
> 28  org.python.python                   0x112e6700 PyEval_EvalFrameEx +
> 17598
> 29  org.python.python                   0x112e8173 PyEval_EvalCodeEx + 1638
> 30  org.python.python                   0x11292488 PyFunction_SetClosure +
> 2667
> 31  org.python.python                   0x11278505 PyObject_Call + 50
> 32  org.python.python                   0x11280e3a PyMethod_New + 2457
> 33  org.python.python                   0x11278505 PyObject_Call + 50
> 34  org.python.python                   0x112e182d
> PyEval_CallObjectWithKeywords + 211
> 35  sip.so                              0x1118051f sip_api_invoke_slot + 410
> 36  QtCore.so                           0x1138d4ef
> PyQtProxy::invokeSlot(_sipSlotConnection const&, void**) + 117
> 37  QtCore.so                           0x1139adaa
> PyQtProxy::unislot(void**) + 134
> 38  QtCore.so                           0x1139d62e
> PyQtProxy::qt_metacall(QMetaObject::Call, int, void**) + 242
> 39  QtCore                              0x00320420
> QMetaObject::activate(QObject*, int, int, void**) + 528
> 40  QtGui                               0x009c5bb6 QAction::activated(int) +
> 70
> 41  QtGui                               0x009c77a8
> QAction::activate(QAction::ActionEvent) + 184
> 42  QtGui                               0x00e17bb6
> QToolButton::nextCheckState() + 38
> 43  QtGui                               0x00d476ba
> QAbstractButtonPrivate::click() + 74
> 44  QtGui                               0x00d47940
> QAbstractButton::mouseReleaseEvent(QMouseEvent*) + 128
> 45  QtGui                               0x00e17afc
> QToolButton::mouseReleaseEvent(QMouseEvent*) + 28
> 46  QtGui                               0x00a14978 QWidget::event(QEvent*) +
> 3736
> 47  QtGui                               0x00d48103
> QAbstractButton::event(QEvent*) + 83
> 48  QtGui                               0x00e17938
> QToolButton::event(QEvent*) + 24
> 49  QtGui                               0x009ccc1f
> QApplicationPrivate::notify_helper(QObject*, QEvent*) + 191
> 50  QtGui                               0x009ced4d
> QApplication::notify(QObject*, QEvent*) + 1309
> 51  libqgis_core.1.0.dylib              0x0137aa4c
> QgsApplication::notify(QObject*, QEvent*) + 46
> 52  QtCore                              0x0030ed01
> QCoreApplication::notifyInternal(QObject*, QEvent*) + 145
> 53  QtGui                               0x00a2571b
> QApplicationPrivate::globalEventProcessor(OpaqueEventHandlerCallRef*,
> OpaqueEventRef*, void*) + 5771
> 54  com.apple.HIToolbox                 0x923e2143
> DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) +
> 1181
> 55  com.apple.HIToolbox                 0x923e157d
> SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*,
> HandlerCallRec*) + 405
> 56  com.apple.HIToolbox                 0x923fded2 SendEventToEventTarget +
> 52
> 57  com.apple.HIToolbox                 0x924100a8
> ToolboxEventDispatcherHandler(OpaqueEventHandlerCallRef*, OpaqueEventRef*,
> void*) + 1208
> 58  com.apple.HIToolbox                 0x923e24fc
> DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) +
> 2134
> 59  com.apple.HIToolbox                 0x923e157d
> SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*,
> HandlerCallRec*) + 405
> 60  com.apple.HIToolbox                 0x923fded2 SendEventToEventTarget +
> 52
> 61  QtGui                               0x00a20521
> qt_mac_send_event(QFlags<QEventLoop::ProcessEventsFlag>, OpaqueEventRef*,
> OpaqueWindowPtr*) + 97
> 62  QtGui                               0x00a2eb62
> QEventDispatcherMac::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) +
> 658
> 63  QtCore                              0x0030e2c1
> QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 65
> 64  QtCore                              0x0030e38d
> QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 157
> 65  QtCore                              0x00312331 QCoreApplication::exec()
> + 161
> 66  org.qgis.qgis                       0x0000a09b main + 8177
> 67  org.qgis.qgis                       0x00007936 start + 54
>
>
>
>
>> Lucio
>>
>>
>> On Wed, May 13, 2009 at 6:16 PM, Dane Springmeyer <[email protected]>
>> wrote:
>>>
>>> Okay, so I just reverted my svn build to r1130 and am experiencing no
>>> crashing now:
>>>
>>> http://trac.mapnik.org/changeset/1131
>>> http://trac.mapnik.org/changeset/1132
>>>
>>> By the look of them, seems like these changes would have helped in
>>> this situation, but something must not quite be working.
>>>
>>> Kunitoki, do you have QGIS? I'll see if I can replication on linux.
>>>
>>> - Dane
>>>
>>> _______________________________________________
>>> Mapnik-devel mailing list
>>> [email protected]
>>> https://lists.berlios.de/mailman/listinfo/mapnik-devel
>>>
>
>
_______________________________________________
Mapnik-devel mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-devel

Reply via email to