<div dir="ltr"><div>Hi,</div><div><br></div><div><div>preview_start=0, preview_end=-1 means that preview is not active<br>this is the result from the constructor: localsession.C:92<br> <br>There is no difference at the event layer between single and<br>double clicks. The ButtonPress/ButtonRelease events have<br>timestamps, and if the button nums matches and it is "really" quick<br>(300 ms, per bcresources.C:841) then it is a double click.<br><br>If you are seeing a deadlock type hang, (a race between locks)<br>the best way I know to try to identify the culprits is to:<br>1) start cin in gdb<br>2) run the session which hangs until it hangs.<br>3) hit ^C, which will be intercepted by gdb.<br>4) enter: "p dump()"<br>This will produce a lock trace table dump.<br>You can do this at any time.<br>On an idle system it looks like this:<br>(gdb) p dump()<br>signal_entry: lock table size=22<br> 0x5b098b0 VIconThread::draw_lock, VIconThread::run 0 0x7fffe0ab2700<br> 0x6117a10 CWindowTool::input_lock, CWindowTool::run 0x7fffdb7fe700<br> 0x625f340 PlaybackEngine::output_lock, PlaybackEngine::run 0x7fffdaffd700<br> 0x6265ce0 BC_DialogThread::active_lock, BC_DialogThread::run 0x7fffda7fc700 *<br> 0x7fffd41c4dc0 PlaybackEngine::output_lock, PlaybackEngine::run 0x7fffd97fa700<br> 0x66924d0 RecordSetChannel::change_channel, (null) 0x7fffcbfff700<br> 0x6698880 RecordCutAdsStatus::wait_lock, RecordCutAdsStatus::run 0x7fffcb7fe700<br> 0x67a52a0 ChannelInfo::scan_lock, (null) 0x7fffcaffd700<br> 0x67a68d0 SWindow::swin_lock, (null) 0x7fffca7fc700<br> 0x69dafb0 MainIndexes::input_lock, MainIndexes::run 1 0x7fffc8ff9700<br> 0x648a2d0 ResourceThread::draw_lock, ResourceThread::run 0x7fffd2ffd700<br> 0x4926280 BC_Synchronous::next_command, BC_Synchronous::run 0x7fffb2ffd700<br> 0x4923590 MWindow::run_lock, MWindow::run 0x7ffff6d43840 *<br> 0x7fffd40028c0 BC_WindowBase::event_condition, BC_WindowBase::get_event 0x7fffda7fc700<br>lock_items: 20<br>lock_frees: 3<br>$1 = void<br><br>The columns are lock_addr, lock_name, lock_loc, thread_id<br>The locks with the * on the end are waiting (maybe hung).<br><br>== To see what that thread is doing, use: "thr find <thread_id>" like this:<br>(gdb) thr find 0x7ffff6d43840<br>Thread 1 has target id 'Thread 0x7ffff6d43840 (LWP 184411)'<br>== Then switch to that thread like this:<br>(gdb) thr 1<br>[Switching to thread 1 (Thread 0x7ffff6d43840 (LWP 184411))]<br>#0 0x00007ffff7cafd45 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0<br>== Then get a backtrace to see what is on the stack.<br>(gdb) thr 1<br>(gdb) bt<br>#0 0x00007ffff7cafd45 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0<br>#1 0x0000000000d9679a in Condition::lock (this=0x6267920, location=0x2bc1b07 "BC_WindowBase::get_event") at condition.C:64<br>#2 0x0000000000d8e61b in BC_WindowBase::get_event (this=0x6265f50) at bcwindowbase.C:4557<br>#3 0x0000000000d839f1 in BC_WindowBase::dispatch_event (this=0x6265f50) at bcwindowbase.C:917<br>#4 0x0000000000d82ff3 in BC_WindowBase::run_window (this=0x6265f50) at bcwindowbase.C:741<br>#5 0x0000000000b9851f in MWindow::run (this=0x7fffffffbc80) at mwindow.C:2898<br>#6 0x0000000000b50096 in main (argc=1, argv=0x7fffffffd798) at main.C:389<br><br>In this case, it is simply a lock used by the main program running mwindow,<br>to wait for it to finish before destroying a bunch of stuff. It stays locked<br>while the program runs, until it is release by the mwindow so the destructor<br>can lock it, which prevents the destructor from running until mwindow is done.<br>Not a hang.<br><br>A live session lock trace table is more complex, this one has a playback active:<br><br>[Detaching after vfork from child process 184602]<br>^C<br>Thread 1 "ci" received signal SIGINT, Interrupt.<br>0x00007ffff7cafd45 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0<br>Missing separate debuginfos, use: dnf debuginfo-install alsa-plugins-pulseaudio-1.2.2-1.fc31.x86_64<br>(gdb) p dump()<br>signal_entry: lock table size=27<br> 0x5b098b0 VIconThread::draw_lock, VIconThread::run 0 0x7fffe0ab2700<br> 0x6117a10 CWindowTool::input_lock, CWindowTool::run 0x7fffdb7fe700<br> 0x6265ce0 BC_DialogThread::active_lock, BC_DialogThread::run 0x7fffda7fc700 *<br> 0x66924d0 RecordSetChannel::change_channel, (null) 0x7fffcbfff700<br> 0x6698880 RecordCutAdsStatus::wait_lock, RecordCutAdsStatus::run 0x7fffcb7fe700<br> 0x67a52a0 ChannelInfo::scan_lock, (null) 0x7fffcaffd700<br> 0x67a68d0 SWindow::swin_lock, (null) 0x7fffca7fc700<br> 0x4926280 BC_Synchronous::next_command, BC_Synchronous::run 0x7fffb2ffd700<br> 0x4923590 MWindow::run_lock, MWindow::run 0x7ffff6d43840 *<br> 0x7fffd41c4dc0 PlaybackEngine::output_lock, PlaybackEngine::run 0x7fffd97fa700<br> 0x69dafb0 MainIndexes::input_lock, MainIndexes::run 1 0x7fffc8ff9700<br> 0x625f340 PlaybackEngine::output_lock, PlaybackEngine::run 0x7fffdaffd700<br> 0x67a7360 BC_Repeater::pause_lock, BC_Repeater::run 0x7fffc9ffb700 0x7fffdaffd700<br> 0x648a2d0 ResourceThread::draw_lock, ResourceThread::run 0x7fffd2ffd700<br> 0x7fff78005140 AudioDevice::arm_lock, AudioDevice::arm_buffer 0x7fff68ff9700<br> 0x648a9f0 BC_WindowBase::event_condition, BC_WindowBase::get_event 0x7fffd1ffb700<br> 0x5b78cd0 BC_WindowBase::event_condition, BC_WindowBase::get_event 0x7fffe1c9b700<br> 0x5baae00 BC_WindowBase::event_condition, BC_WindowBase::get_event 0x7fffc37fe700<br> 0x67b2560 BC_WindowBase::event_condition, BC_WindowBase::get_event 0x7fffc27fc700<br> 0x69dfd10 BC_WindowBase::event_condition, BC_WindowBase::get_event 0x7fffb3fff700<br> 0x6267920 BC_WindowBase::event_condition, BC_WindowBase::get_event 0x7ffff6d43840<br> 0x7fffd40028c0 BC_WindowBase::event_condition, BC_WindowBase::get_event 0x7fffda7fc700<br> 0x648a9f0 BC_WindowBase::event_condition, BC_WindowBase::get_event 0x7fffd1ffb700<br>lock_items: 22<br>lock_frees: 5<br>AudioALSA::write_buffer err -32(Broken pipe) at sample 163840<br>$2 = void<br><br>Here you see the PlaybackEngine, BC_Synchronous (opengl video), AudioDevice (audio),<br>and a bunch of idle threads. Still a normal situation.<br><br><br>If you find a "bad" guy, it will usually be because the XDisplayLock function is<br>waiting on a locked window, and that window lock is held by a thread that wants<br>a lock that the current task owns. A waits on B, B waits on A. deadlock.<br><br>Here I used gdb to errantly set a lock on the composer canvas window<br>(gdb) p window->lock_window("bug test lock")<br>$4 = 0<br>(gdb) c<br>Continuing.<br>and then I tried playback, which hangs, and I interrupt, and see this:<br>(gdb) p dump()<br>signal_entry: lock table size=28<br> 0x5b098b0 VIconThread::draw_lock, VIconThread::run 0 0x7fffe0ab2700<br> 0x6117a10 CWindowTool::input_lock, CWindowTool::run 0x7fffdb7fe700<br> 0x6265ce0 BC_DialogThread::active_lock, BC_DialogThread::run 0x7fffda7fc700 *<br> 0x66924d0 RecordSetChannel::change_channel, (null) 0x7fffcbfff700<br> 0x6698880 RecordCutAdsStatus::wait_lock, RecordCutAdsStatus::run 0x7fffcb7fe700<br> 0x67a52a0 ChannelInfo::scan_lock, (null) 0x7fffcaffd700<br> 0x67a68d0 SWindow::swin_lock, (null) 0x7fffca7fc700<br> 0x4926280 BC_Synchronous::next_command, BC_Synchronous::run 0x7fffb2ffd700<br> 0x4923590 MWindow::run_lock, MWindow::run 0x7ffff6d43840 *<br> 0x7fffd41c4dc0 PlaybackEngine::output_lock, PlaybackEngine::run 0x7fffd97fa700<br> 0x69dafb0 MainIndexes::input_lock, MainIndexes::run 1 0x7fffc8ff9700<br> 0x67a7360 BC_Repeater::pause_lock, BC_Repeater::run 0x7fffc9ffb700 0x7fffdaffd700<br> 0x5baae00 BC_WindowBase::event_condition, BC_WindowBase::get_event 0x7fffc37fe700<br> 0x5f86cd8 Cinelerra: Compositor, BC_Repeater::run 0x7fffc17fa700<br> 0x648a2d0 ResourceThread::draw_lock, ResourceThread::run 0x7fffd2ffd700<br> 0x7fff78007be0 AudioDevice::play_lock, AudioDevice::run 1 0x7fff4ffff700<br> 0x5f86cd8 Cinelerra: Compositor, VDeviceX11::open_output 0x7fffdaffd700<br> 0x648a9f0 BC_WindowBase::event_condition, BC_WindowBase::get_event 0x7fffd1ffb700<br> 0x67b2560 BC_WindowBase::event_condition, BC_WindowBase::get_event 0x7fffc27fc700<br> 0x5b78cd0 BC_WindowBase::event_condition, BC_WindowBase::get_event 0x7fffe1c9b700<br> 0x69dfd10 BC_WindowBase::event_condition, BC_WindowBase::get_event 0x7fffb3fff700<br> 0x6267920 BC_WindowBase::event_condition, BC_WindowBase::get_event 0x7ffff6d43840<br> 0x7fffd40028c0 BC_WindowBase::event_condition, BC_WindowBase::get_event 0x7fffda7fc700<br> 0x648a9f0 BC_WindowBase::event_condition, BC_WindowBase::get_event 0x7fffd1ffb700<br>lock_items: 23<br>lock_frees: 5<br>$7 = void<br><br>Because I had a good idea where to look (drawing on the locked canvas)<br>I tried the VDeviceX11::open_output locked thread:<br><br>(gdb) thr find 0x7fffdaffd700<br>Thread 8 has target id 'Thread 0x7fffdaffd700 (LWP 184434)'<br>(gdb) thr 8<br>[Switching to thread 8 (Thread 0x7fffdaffd700 (LWP 184434))]<br>#0 0x00007ffff7cafd45 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0<br>(gdb) bt<br>#0 0x00007ffff7cafd45 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0<br>#1 0x00007ffff7e97045 in _XDisplayLockWait () from /lib64/libX11.so.6<br>#2 0x00007ffff7e974ed in _XLockDisplay () from /lib64/libX11.so.6<br>#3 0x00007ffff7e96ebb in XLockDisplay () from /lib64/libX11.so.6<br>#4 0x0000000000d8adf3 in BC_WindowBase::lock_window (this=0x5f86cd0, location=0x2b9b520 "VDeviceX11::open_output") at bcwindowbase.C:3322<br>#5 0x0000000000d8ada5 in BC_WindowBase::lock_window (this=0x60fbee0, location=0x2b9b520 "VDeviceX11::open_output") at bcwindowbase.C:3313<br>#6 0x0000000000a2c470 in Canvas::lock_canvas (this=0x60fbe00, loc=0x2b9b520 "VDeviceX11::open_output") at canvas.C:94<br>#7 0x0000000000ca2d55 in VDeviceX11::open_output (this=0x7fff78023110) at vdevicex11.C:103<br>#8 0x0000000000ca6c59 in VideoDevice::open_output (this=0x7fff7800da10, config=0x7fff78033bb0, rate=29.9700298, out_w=352, out_h=240, <br> output=0x60fbe00, single_frame=0) at videodevice.C:689<br>#9 0x0000000000c244d6 in RenderEngine::open_output (this=0x7fff7800a2d0) at renderengine.C:328<br>#10 0x0000000000c23e7c in RenderEngine::arm_command (this=0x7fff7800a2d0, command=0x5bb7f20) at renderengine.C:180<br>#11 0x0000000000bc1db3 in PlaybackEngine::arm_render_engine (this=0x4a47220) at playbackengine.C:147<br>#12 0x0000000000bc282d in PlaybackEngine::run (this=0x4a47220) at playbackengine.C:412<br>#13 0x0000000000da57bd in Thread::entrypoint (parameters=0x4a47220) at thread.C:65<br>#14 0x00007ffff7ca94e2 in start_thread () from /lib64/libpthread.so.0<br>#15 0x00007ffff75336d3 in clone () from /lib64/libc.so.6<br><br>You can see it is waiting on the XDisplayLock, probably because the composer is<br>hosed and has it. You can see the XDisplayLock owner (possible bad guy) like this:<br>(gdb) up<br>#1 0x00007ffff7e97045 in _XDisplayLockWait () from /lib64/libX11.so.6<br>(gdb) <br>#2 0x00007ffff7e974ed in _XLockDisplay () from /lib64/libX11.so.6<br>(gdb) <br>#3 0x00007ffff7e96ebb in XLockDisplay () from /lib64/libX11.so.6<br>(gdb) <br>#4 0x0000000000d8adf3 in BC_WindowBase::lock_window (this=0x5f86cd0, location=0x2b9b520 "VDeviceX11::open_output") at bcwindowbase.C:3322<br>3322 XLockDisplay(top_level->display);<br>(gdb) p /x top_level->display_lock_owner<br>$8 = 0x7fff6b7fe700<br>(gdb) thr find 0x7fff6b7fe700<br>Thread 83 has target id 'Thread 0x7fff6b7fe700 (LWP 184684)'<br>(gdb) bt<br>#0 0x00007ffff7cafd45 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0<br>#1 0x00007ffff7e97045 in _XDisplayLockWait () from /lib64/libX11.so.6<br>#2 0x00007ffff7e974ed in _XLockDisplay () from /lib64/libX11.so.6<br>#3 0x00007ffff7e96ebb in XLockDisplay () from /lib64/libX11.so.6<br>#4 0x0000000000d8adf3 in BC_WindowBase::lock_window (this=0x5f86cd0, location=0x2b9b520 "VDeviceX11::open_output") at bcwindowbase.C:3322<br>#5 0x0000000000d8ada5 in BC_WindowBase::lock_window (this=0x60fbee0, location=0x2b9b520 "VDeviceX11::open_output") at bcwindowbase.C:3313<br>#6 0x0000000000a2c470 in Canvas::lock_canvas (this=0x60fbe00, loc=0x2b9b520 "VDeviceX11::open_output") at canvas.C:94<br>#7 0x0000000000ca2d55 in VDeviceX11::open_output (this=0x7fff78023110) at vdevicex11.C:103<br>#8 0x0000000000ca6c59 in VideoDevice::open_output (this=0x7fff7800da10, config=0x7fff78033bb0, rate=29.9700298, out_w=352, out_h=240, <br> output=0x60fbe00, single_frame=0) at videodevice.C:689<br>#9 0x0000000000c244d6 in RenderEngine::open_output (this=0x7fff7800a2d0) at renderengine.C:328<br>#10 0x0000000000c23e7c in RenderEngine::arm_command (this=0x7fff7800a2d0, command=0x5bb7f20) at renderengine.C:180<br>#11 0x0000000000bc1db3 in PlaybackEngine::arm_render_engine (this=0x4a47220) at playbackengine.C:147<br>#12 0x0000000000bc282d in PlaybackEngine::run (this=0x4a47220) at playbackengine.C:412<br>#13 0x0000000000da57bd in Thread::entrypoint (parameters=0x4a47220) at thread.C:65<br>#14 0x00007ffff7ca94e2 in start_thread () from /lib64/libpthread.so.0<br>#15 0x00007ffff75336d3 in clone () from /lib64/libc.so.6<br><br>this can be a good way to narrow down the locks and threads that are in play<br>during a deadlock. It is a good idea to very carefully record what you are<br>typing and/or mousing (the xevent stream drives all of this).<br><br>There is no magic bullet to fix a deadlock that I know.<br>If you can get some p dump()'s maybe I can help narrow it down, or<br>maybe the problem will be more obvious.<br><br><br>gg<br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 2, 2020 at 11:43 AM Andrew Randrianasulu <<a href="mailto:randrianasulu@gmail.com" target="_blank">randrianasulu@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi, all<br>
<br>
So, I tried to debug non-working/freezing timebar in Compositor ....<br>
<br>
BC_WindowBase::dispatch_event 956 Cinelerra: Составитель 0xe277658 6 (MotionNotify)<br>
BC_WindowBase::dispatch_event this=0xe3d9b40 1360<br>
BC_WindowBase::dispatch_event 956 Cinelerra: Составитель 0xdae2758 4 (ButtonPress)<br>
CTimeBar:pixel_to_Position<br>
CTimeBar: pixel, 110<br>
CTimebar:pix_to_pos: Got EDL!<br>
CTimebar:pix_to_pos: prev_start 0.000000, prev_end -1.000000<br>
CTimeBar:pixel_to_pos start, 0, end 0<br>
BC_WindowBase::dispatch_event this=0xe2d10450 1360<br>
BC_WindowBase::dispatch_event this=0xe849748 1360<br>
BC_WindowBase::dispatch_event this=0xe582418 1360<br>
BC_WindowBase::dispatch_event this=0xe1480d0 1360<br>
BC_WindowBase::dispatch_event this=0xe920510 1360<br>
BC_WindowBase::dispatch_event this=0xe582418 1360<br>
<br>
additional printfs added by me:<br>
<br>
diff --git a/cinelerra-5.1/cinelerra/ctimebar.C b/cinelerra-5.1/cinelerra/ctimebar.C<br>
index b9fb0bd..e0a1ee5 100644<br>
--- a/cinelerra-5.1/cinelerra/ctimebar.C<br>
+++ b/cinelerra-5.1/cinelerra/ctimebar.C<br>
@@ -59,23 +59,30 @@ EDL* CTimeBar::get_edl()<br>
<br>
void CTimeBar::draw_time()<br>
{<br>
+ printf("CTimeBar::draw_time before draw_range");<br>
draw_range();<br>
+ printf("CTimeBar::draw_time after draw_range");<br>
}<br>
<br>
<br>
double CTimeBar::pixel_to_position(int pixel)<br>
{<br>
+ printf("CTimeBar:pixel_to_Position \n");<br>
+ printf("CTimeBar: pixel, %i \n", pixel);<br>
double start = 0, end = get_edl_length();<br>
EDL *edl = get_edl();<br>
if( edl ) {<br>
+ printf("CTimebar:pix_to_pos: Got EDL!\n");<br>
double preview_start = edl->local_session->preview_start;<br>
double preview_end = edl->local_session->preview_end;<br>
+ printf("CTimebar:pix_to_pos: prev_start %f, prev_end %f \n", preview_start, preview_end);<br>
if( preview_end >= 0 || preview_start > 0 )<br>
start = preview_start;<br>
if( preview_end >= 0 && preview_end < end )<br>
end = preview_end;<br>
}<br>
if( start > end ) start = end;<br>
+ printf("CTimeBar:pixel_to_pos start, %d, end %d \n" , start, end);<br>
return start + (double)pixel * (end - start) / get_w();<br>
}<br>
<br>
<br>
Hm, so preview end for some reason become negative???<br>
-- <br>
Cin mailing list<br>
<a href="mailto:Cin@lists.cinelerra-gg.org" target="_blank">Cin@lists.cinelerra-gg.org</a><br>
<a href="https://lists.cinelerra-gg.org/mailman/listinfo/cin" rel="noreferrer" target="_blank">https://lists.cinelerra-gg.org/mailman/listinfo/cin</a><br>
</blockquote></div>