More spicy

Wednesday, April 19, 2017

Spending more time trying to get to the bottom of why spicy on the Mac does not draw anything, now that I finally got debugging partially working.

Spice for Mac

Placed a breakpoint in all callbacks which seemed to make sense. None of them is called from the main loop. I may have to look directly into glib to get to the bottom of this.

Interesting that we only enter channel_new once. That seems wrong. Maybe the protocol aborts somewhere.

Spice with recorder

Made a change to the recorder so that there is no recorder.tbl in the project unless you build it. Adjusted ELFE and the version of Spice with recorder to match.

This time, I tried to make things cleanly in Makefile.am, and I ran into a couple of interesting issues. It looks like automake does not like to have sources in subdirectories much.

src/Makefile.am:215: warning: source file 'recorder/recorder.cpp' is in a subdirectory,

src/Makefile.am:215: but option 'subdir-objects' is disabled automake: warning: possible forward-incompatibility. automake: At least a source file is in a subdirectory, but the 'subdir-objects' automake: automake option hasn't been enabled. For now, the corresponding output automake: object file(s) will be placed in the top-level directory. However, automake: this behaviour will change in future Automake versions: they will automake: unconditionally cause object files to be placed in the same subdirectory automake: of the corresponding sources. automake: You are advised to start using 'subdir-objects' option throughout your automake: project, to avoid future incompatibilities.

This is theoretically fixed by adding the following to Makefile.am:

AUTOMAKE_OPTIONS = subdir-objects

Also need to add AC_PROG_CXX to configure.ac, and a switch to select C++11 from autoconf-archive:

AC_LANG([C++])

AX_CXX_COMPILE_STDCXX_11

A little more fiddling, and I finally get something that appears to work enough that I can dump the recorder in a debug session:

(lldb) p recorder_dump()

1 [222.770995:0x1000e6e34] DEBUG: New session (compiled from package spice-gtk 0.33.118-07ee-dirty) 2 [222.771062:0x1000e6ea6] DEBUG: Supported channels: 3 [222.771737:0x10011c2a4] DEBUG: auto-connect filter set to 321F244316377377"} 4 [222.791710:0x10013b1de] COROUTINE: LOCK thread 0x101614c30

5 [222.795431:0x100002417] DEBUG: connection_new (1) 6 [224.110346:0x100007ded] DEBUG: spicy_connect_dialog: #0 [host]: "A" 7 [224.111116:0x100007ded] DEBUG: spicy_connect_dialog: #1 [port]: "(null)" 8 [224.111632:0x100007ded] DEBUG: spicy_connect_dialog: #2 [tls-port]: "(null)" 9 [238.687913:0x10011cce5] DEBUG: device added 05ac:0221 (0x101630b30) 10 [238.687986:0x10011cce5] DEBUG: device added 1058:0827 (0x101617b20) 11 [238.688026:0x10011cce5] DEBUG: device added 05ac:8290 (0x101622c90) 12 [238.688056:0x10011cce5] DEBUG: device added 05ac:0274 (0x10162d940) 13 [309.296221:0x1000e9016] DEBUG: no migration in progress 14 [309.301530:0x1000f5400] CHANNEL: main-1:0: spice_channel_constructed 15 [309.301590:0x1000eaf9f] CHANNEL: main-1:0: new main channel, switching 16 [309.301619:0x1000c06de] DEBUG: Changing main channel from 0x0 to 0x1058be4f0 17 [317.330012:0x100002603] DEBUG: new channel (#0) 18 [317.330029:0x1000026c0] DEBUG: new main channel 19 [317.341971:0x1000f66ed] CHANNEL: main-1:0: Open coroutine starting 0x1058be4f0 20 [317.342027:0x10013b0f9] COROUTINE: NEW thread 0x101614c30 21 [317.342094:0x10013b626] COROUTINE: SWAP thread 0x101614c30 22 [317.342095:0x10013b444] COROUTINE: BROADCAST thread 0x101614c30 23 [317.342099:0x10013b472] COROUTINE: UNLOCK thread 0x101614c30 24 [317.342100:0x10013b4a0] COROUTINE: LOCK thread 0x101614c30 25 [317.342100:0x10013b4ea] COROUTINE: WAIT thread 0x101614c30 26 [317.342115:0x10013b296] COROUTINE: LOCK thread 0x106017590 27 [317.342131:0x10013b31a] COROUTINE: RUNNABLE thread 0x106017590 28 [317.342133:0x1000f6838] CHANNEL: main-1:0: Started background coroutine 0x1058be388 29 [317.342191:0x1000ea5f5] CHANNEL: main-1:0: Using plain text, port 5903 30 [317.342521:0x10013b6b6] COROUTINE: SWAP thread 0x106017590 31 [317.342522:0x10013b444] COROUTINE: BROADCAST thread 0x106017590 32 [317.342529:0x10013b472] COROUTINE: UNLOCK thread 0x106017590 33 [317.342550:0x10013b53b] COROUTINE: SWAPPED thread 0x101614c30 34 [317.342605:0x1000eaa6a] DEBUG: open host muse:5903 35 [317.342759:0x1000f05e1] CHANNEL: main-1:0: connecting 0x70000a2cfcd8... 36 [317.342800:0x10013b4a0] COROUTINE: LOCK thread 0x106017590 37 [317.818216:0x1000f06ee] CHANNEL: main-1:0: connect ready 38 [317.818268:0x10013b626] COROUTINE: SWAP thread 0x101614c30 39 [317.818269:0x10013b444] COROUTINE: BROADCAST thread 0x101614c30 40 [317.818270:0x10013b472] COROUTINE: UNLOCK thread 0x101614c30 41 [317.818276:0x10013b4a0] COROUTINE: LOCK thread 0x101614c30 42 [317.818286:0x10013b53b] COROUTINE: SWAPPED thread 0x106017590 43 [317.820285:0x1000f7980] CHANNEL: main-1:0: channel type 0 id 0 num common caps 0 num caps 43 44 [317.820426:0x10013b6b6] COROUTINE: SWAP thread 0x106017590 45 [317.820426:0x10013b444] COROUTINE: BROADCAST thread 0x106017590 46 [317.820427:0x10013b472] COROUTINE: UNLOCK thread 0x106017590 47 [317.820433:0x10013b4a0] COROUTINE: LOCK thread 0x106017590 48 [317.820441:0x10013b53b] COROUTINE: SWAPPED thread 0x101614c30

That does not really tell me why I have no window. Looking for the origin of the message

(spicy:93313): Gdk-WARNING **: GdkQuartzDisplay does not implement the monitor vfuncs