<br/><br/>I can attach a debugger, however I do not have the GStreamer debug build. So at the moment a cannot check whats happening in gst_debug_log_valist().
<br/>
<br/>The execution of the version with the protection also crashes:
<br/>
<br/><br/>With:
<br/> if (!gst_is_initialized())
<br/> {
<br/> gst_debug_set_default_threshold(GST_LEVEL_MEMDUMP);
<br/> gst_init(NULL, NULL);
<br/> gst_debug_remove_log_function(&gst_debug_log_default);
<br/> gst_debug_add_log_function(&gstLogFunction, NULL, NULL);
<br/> }
<br/>e.g.:
<br/>Stack Trace (from fault):
<br/>[ 0] 0x0000000148ae3397 C:\gstreamer\1.0\x86_64\bin\libgstbase-1.0-0.dll+00078743 gst_base_parse_merge_tags+00010871
<br/>[ 1] 0x0000000167262c57 C:\gstreamer\1.0\x86_64\bin\libgobject-2.0-0.dll+00142423 g_type_class_ref+00001175
<br/>[ 2] 0x00000001672628fd C:\gstreamer\1.0\x86_64\bin\libgobject-2.0-0.dll+00141565 g_type_class_ref+00000317
<br/>[ 3] 0x00000001672628fd C:\gstreamer\1.0\x86_64\bin\libgobject-2.0-0.dll+00141565 g_type_class_ref+00000317
<br/>[ 4] 0x000000009f95f3fe C:\gstreamer\1.0\x86_64\bin\libgstreamer-1.0-0.dll+00193534 gst_element_register+00000382
<br/>[ 5] 0x000000010c80153c C:\gstreamer\1.0\x86_64\lib\gstreamer-1.0\libgstgio.dll+00005436
<br/>[ 6] 0x000000009f97f5f4 C:\gstreamer\1.0\x86_64\bin\libgstreamer-1.0-0.dll+00325108 gst_pipeline_get_latency+00002244
<br/>[ 7] 0x000000009f9811c4 C:\gstreamer\1.0\x86_64\bin\libgstreamer-1.0-0.dll+00332228 gst_plugin_register_static_full+00003076
<br/>[ 8] 0x000000009f98d2bf C:\gstreamer\1.0\x86_64\bin\libgstreamer-1.0-0.dll+00381631 gst_query_set_context+00000495
<br/>[ 9] 0x000000009f98e76c C:\gstreamer\1.0\x86_64\bin\libgstreamer-1.0-0.dll+00386924 gst_registry_remove_plugin+00001660
<br/>[ 10] 0x000000009f98e946 C:\gstreamer\1.0\x86_64\bin\libgstreamer-1.0-0.dll+00387398 gst_registry_remove_plugin+00002134
<br/>[ 11] 0x000000009f990378 C:\gstreamer\1.0\x86_64\bin\libgstreamer-1.0-0.dll+00394104 gst_update_registry+00002808
<br/>[ 12] 0x000000009f931b9b C:\gstreamer\1.0\x86_64\bin\libgstreamer-1.0-0.dll+00007067
<br/>[ 13] 0x000000017c0fb168 C:\gstreamer\1.0\x86_64\bin\libglib-2.0-0.dll+00242024 g_option_context_parse+00000856
<br/>[ 14] 0x000000009f932557 C:\gstreamer\1.0\x86_64\bin\libgstreamer-1.0-0.dll+00009559 gst_init_check+00000215
<br/>[ 15] 0x000000009f9325a7 C:\gstreamer\1.0\x86_64\bin\libgstreamer-1.0-0.dll+00009639 gst_init+00000023
<br/>[ 16] 0x000007fef3f479ea C:\builddbg\sfunc_gstmin.mexw64+00031210 mdlInitializeSampleTimes+00000058
<br/>
<br/>
<br/>With:
<br/> if (!gst_is_initialized())
<br/> {
<br/> gst_debug_set_default_threshold(GST_LEVEL_LOG);
<br/> gst_debug_add_log_function(&gstLogFunction, NULL, NULL);
<br/> gst_debug_remove_log_function(&gst_debug_log_default);
<br/> gst_init(NULL, NULL);
<br/> }
<br/>I still did not caught any crash.
<br/>
<br/>Unfortunately this did not solve crashing if I add a little bit more to the program.
<br/>There I used the same function for initializing GStreamer and added a pipeline with a videotestsrc. Roughly like so:
<br/><br/>GstElement* pipeline = gst_pipeline_new("name");
<br/>GstBus* bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline));
<br/>gst_bus_set_sync_handler(bus, busCallBack, (gpointer)this, NULL);
<br/>gst_object_unref(bus);
<br/><br/>The busCallBack function does return GST_BUS_DROP only.
<br/><br/>GError* gerr = NULL;
<br/>GstElement* bin = gst_parse_bin_from_description("videotestsrc name=src ! capsfilter name=caps ! appsink name=sink", TRUE, NULL);
<br/>if (bin == NULL)
<br/>{
<br/> printf("Could not parse pipeline: %s", gerr->message);
<br/> g_error_free(gerr);
<br/> return;
<br/>}
<br/>gst_bin_add(GST_BIN(pipeline), bin);
<br/><br/>Stack Trace (from fault):
<br/>[ 0] 0x00000000a3461486 C:\gstreamer\1.0\x86_64\lib\gstreamer-1.0\libgstvideotestsrc.dll+00005254
<br/>[ 1] 0x00000000a346174f C:\gstreamer\1.0\x86_64\lib\gstreamer-1.0\libgstvideotestsrc.dll+00005967
<br/>[ 2] 0x0000000127e54cab C:\gstreamer\1.0\x86_64\bin\libgobject-2.0-0.dll+00150699 g_type_create_instance+00000331
<br/>[ 3] 0x0000000127e3a9d8 C:\gstreamer\1.0\x86_64\bin\libgobject-2.0-0.dll+00043480 g_object_unref+00002072
<br/>[ 4] 0x0000000127e3c44e C:\gstreamer\1.0\x86_64\bin\libgobject-2.0-0.dll+00050254 g_object_newv+00000542
<br/>[ 5] 0x000000013c42eceb C:\gstreamer\1.0\x86_64\bin\libgstreamer-1.0-0.dll+00191723 gst_element_factory_create+00000523
<br/>[ 6] 0x000000013c42eeb5 C:\gstreamer\1.0\x86_64\bin\libgstreamer-1.0-0.dll+00192181 gst_element_factory_make+00000229
<br/>[ 7] 0x000000013c493c8b C:\gstreamer\1.0\x86_64\bin\libgstreamer-1.0-0.dll+00605323 gst_parse_flags_get_type+00018411
<br/>[ 8] 0x000000013c494e67 C:\gstreamer\1.0\x86_64\bin\libgstreamer-1.0-0.dll+00609895 gst_parse_flags_get_type+00022983
<br/>[ 9] 0x000000013c48c72c C:\gstreamer\1.0\x86_64\bin\libgstreamer-1.0-0.dll+00575276 gst_parse_launch_full+00000124
<br/>[ 10] 0x000000013c47fdfe C:\gstreamer\1.0\x86_64\bin\libgstreamer-1.0-0.dll+00523774 gst_parse_bin_from_description_full+00000302
<br/>[ 11] 0x000000013c47ff54 C:\gstreamer\1.0\x86_64\bin\libgstreamer-1.0-0.dll+00524116 gst_parse_bin_from_description+00000020
<br/>[ 12] 0x000007fee24cb932 C:\builddbg\sfunc_videotestsrc.mexw64+00047410 VideoTestSrc::setUp+00000130
<br/><br/>
<br/>
<br/><br/><br/><br/>Gesendet: Mittwoch, 06. Januar 2016 um 08:56 Uhr
<br/>Von: "Sebastian Dröge-3 [via GStreamer-devel]" <<a href="/user/SendEmail.jtp?type=node&node=4675132&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>>
<br/>An: pfarmer <<a href="/user/SendEmail.jtp?type=node&node=4675132&i=1" target="_top" rel="nofollow" link="external">[hidden email]</a>>
<br/>Betreff: Re: Aw: Re: Re: GStreamer application access violation in random locations
<br/>On Di, 2016-01-05 at 06:13 -0800, pfarmer wrote:
<br/>> Thanks!
<br/>> It seems to work better. I noticed though that both logging function
<br/>> are active in that case (tested ith a standalone application).
<br/>>
<br/>> The crashing does never happend in a standalone application, so
<br/>> unfortunetly i cannot reproduce it there. It may also arrise from
<br/>> multiple calling, so I added a protection like so:
<br/>> [...]
<br/><br/>Does it also not crash with that multiple-call protection if you change
<br/>the order to what you had before?
<br/><br/>If you can ever catch a crash in a debugger, it would be good to see
<br/>what exactly is called there from gst_debug_log_valist().
<br/><br/>--
<br/>Sebastian Dröge, Centricular Ltd · <a href="http://www.centricular.com" target="_top" rel="nofollow" link="external">http://www.centricular.com</a><br/><br/><br/>_______________________________________________
<br/>gstreamer-devel mailing list
<br/>[hidden email]
<br/><a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_top" rel="nofollow" link="external">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br/> signature.asc (968 bytes) Download Attachment[<a href="http://gstreamer-devel.966125.n4.nabble.com/attachment/4675124/0/signature.asc" target="_top" rel="nofollow" link="external">http://gstreamer-devel.966125.n4.nabble.com/attachment/4675124/0/signature.asc</a>]
<br/>------------------------------------------------------------
<br/><br/>If you reply to this email, your message will be added to the discussion below:<a href="http://gstreamer-devel.966125.n4.nabble.com/GStreamer-application-access-violation-in-random-locations-tp4674999p4675124.html" target="_top" rel="nofollow" link="external">http://gstreamer-devel.966125.n4.nabble.com/GStreamer-application-access-violation-in-random-locations-tp4674999p4675124.html</a>[<a href="http://gstreamer-devel.966125.n4.nabble.com/GStreamer-application-access-violation-in-random-locations-tp4674999p4675124.html" target="_top" rel="nofollow" link="external">http://gstreamer-devel.966125.n4.nabble.com/GStreamer-application-access-violation-in-random-locations-tp4674999p4675124.html</a>]
<br/>To start a new topic under GStreamer-devel, email <a href="/user/SendEmail.jtp?type=node&node=4675132&i=2" target="_top" rel="nofollow" link="external">[hidden email]</a>
<br/>To unsubscribe from GStreamer application access violation in random locations, click here[<a href="" target="_top" rel="nofollow" link="external">
<br/>NAML[<a href="http://gstreamer-devel.966125.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml" target="_top" rel="nofollow" link="external">http://gstreamer-devel.966125.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml</a>]
<br/>
<br/><hr align="left" width="300" />
View this message in context: <a href="http://gstreamer-devel.966125.n4.nabble.com/GStreamer-application-access-violation-in-random-locations-tp4674999p4675132.html">Aw: Re: Re: Re: GStreamer application access violation in random locations</a><br/>
Sent from the <a href="http://gstreamer-devel.966125.n4.nabble.com/">GStreamer-devel mailing list archive</a> at Nabble.com.<br/>