xLightsSequencer / xLights

xLights is a sequencer for Lights. xLights has usb and E1.31 drivers. You can create sequences in this object oriented program. You can create playlists, schedule them, test your hardware, convert between different sequencers.
GNU General Public License v3.0
544 stars 203 forks source link

DDP: Crash on receiving valid Discover reply #2687

Closed vanvught closed 1 week ago

vanvught commented 3 years ago

Describe the bug Crash on receiving valid Discover reply.

2021-06-23 17:57:24,046 4832882176 log_base [DEBUG] Running controller discovery.
2021-06-23 17:57:24,049 4832882176 log_base [INFO] ZCPP sending discovery packet.
2021-06-23 17:57:24,081 4832882176 log_base [DEBUG]  Valid response.
2021-06-23 17:57:24,081 4832882176 log_base [DEBUG] {"status":{"man":"www.orangepi-dmx.org","mod":"Pixel","ver":"1.0"}}
2021-06-23 17:57:24,081 4832882176 log_base [DEBUG]    IP 192.168.2.107
2021-06-23 17:57:24,082 4832882176 log_base [CRIT] Crash handler called.
2021-06-23 17:57:24,144 4832882176 log_base [CRIT] xLights version 2021.19

To Reproduce

  1. Press Discover button

Expected behavior Showing the discovered display.

Screenshots Wireshark showing the correct Discover reply Schermafbeelding 2021-06-23 om 17 59 10

LUA plugin -> https://github.com/vanvught/h3dmx512-zip/tree/master/Wireshark/LUA

Versions (please complete the following information):

Additional context Add any other context about the problem here.

Attachments

Crash report can be send on request to a personal e-mail.

dkulp commented 3 years ago

While it shouldn't crash, I believe the response packet is wrong. It's returning a "status" JSON, but in a CONFIG (250) DDP packet. Currently, xLights, doesn't query for the status packet (although it likely should).

vanvught commented 3 years ago

@dkulp Thanks for your quick reply. Much appreciated.

I believe the response packet is wrong

With reference to http://www.3waylabs.com/ddp/

Display devices will reply with something like:

dh.flags1 = DDP_FLAGS1_VER1 | DDP_FLAGS1_REPLY | DDP_FLAGS1_PUSH; dh.id = DDP_ID_STATUS; dh.offset = 0; dh.len = length of returned JSON data:

databuf: "{"status":{"man":"Minleon","mod":"NDB","ver":"1.0"}}"

That is what I am using for the reply.

Where again with reference to to http://www.3waylabs.com/ddp/

To discover all DDP devices on a network, broadcast a DDP STATUS request:

dh.flags1 = DDP_FLAGS1_VER1 | DDP_FLAGS1_QUERY; dh.id = DDP_ID_STATUS; dh.offset = 0; dh.len = 0; UDP_SEND(255.255.255.255,DDP_PORT,dh,databuf);

Where xLights is sending a CONFIG:

Schermafbeelding 2021-06-23 om 18 49 17

What would be the correct protocol here? Thanks, Arjan

dkulp commented 3 years ago

It's looking for a config packet which is described (minleon config schema) in the spec:

{"config" : { "ip": "a.b.c.d" (IP address) "nm": "a.b.c.d" (netmask) "gw": "a.b.c.d" (gateway) "ports" : [ (array of output port info) { "port": N, (port #) "ts" : N, (number of T's) "l" : N, (number of lights) "ss" : N (starting slot) }, ... ] } }

That said, the ONLY thing that xLights will pull out of there are the number of lights on each port to configure the number of channels needed.

vanvught commented 3 years ago

Ok. So the Discover button is not sending a Discover package, but a Config request instead.

vanvught commented 3 years ago

@dkulp

For [ (array of output port info) { "port": N, (port #) "ts" : N, (number of T's) "l" : N, (number of lights) "ss" : N (starting slot) }, ... ]

what would be the mapping to for example a sACN E1.31 pixel controller with 8x outputs and 1-4 Universes for each output?

Note: This https://github.com/smeighan/xLights/issues/2680 is also an issue on MacOS.

Thanks, Arjan

dkulp commented 3 years ago

There wouldn't be a mapping as this is a DDP discovery which doesn't have universes. It's assuming the controller will then take DDP data.

vanvught commented 3 years ago

@dkulp

There wouldn't be a mapping as this is a DDP discovery which doesn't have universes. It's assuming the controller will then take DDP data.

When there is no mapping to sACN E1.31 controllers possible -> Then assuming that there is pixel controller with 8 output ports where a maximum of 4*170 pixels can be controlled per output port -> Then would there be any documentation describing this JSON string in detail? What is a port? What are T's? Number of lights related to pixel count? What is astarting slot?

dkulp commented 3 years ago

I uploaded https://dankulp.com/xlights/archive/xLights-2021.19-ddp.dmg (for the Mac) which should hopefully have the crash fixed. Can you grab that and double check to make sure it doesn't crash. Should also grab info from the STATUS response as well, but I'm more concerned about getting the crash fixed.

vanvught commented 3 years ago

Herewith the outcome:

2021-06-23 20:25:30,435 4814790144 log_base [DEBUG] In Post Startup
2021-06-23 20:25:30,435 4814790144 log_base [DEBUG] User email address: <email>arjan...@gmail.com</email>

0 xLights 0x0000000110d983fc _Z11handleCrashPv + 3948 1 xLights 0x0000000110d9bbb0 _ZL20xlFatalSignalHandleri + 32 2 libsystem_platform.dylib 0x00007fff20365d7d _sigtramp + 29 3 ??? 0xf68d0000c0001003 0x0 + 17765856108267704323 4 xLights 0x00000001106a0bd4 _ZN9Discovery8DiscoverEv + 724 5 xLights 0x0000000110757b4a _ZN12xLightsFrame21OnButtonDiscoverClickER14wxCommandEvent + 426 6 xLights 0x0000000110fa5b82 _ZN12wxEvtHandler23SearchDynamicEventTableER7wxEvent + 226 7 xLights 0x0000000110fa593f _ZN12wxEvtHandler12ProcessEventER7wxEvent + 159 8 xLights 0x0000000110fa5a41 _ZN12wxEvtHandler19ProcessEventLocallyER7wxEvent + 145 9 xLights 0x0000000110fa5900 _ZN12wxEvtHandler12ProcessEventER7wxEvent + 96 10 xLights 0x0000000111164ec9 _ZN12wxWindowBase8TryAfterER7wxEvent + 233 11 xLights 0x0000000111164ec9 _ZN12wxWindowBase8TryAfterER7wxEvent + 233 12 xLights 0x0000000111164ec9 _ZN12wxWindowBase8TryAfterER7wxEvent + 233 13 xLights 0x0000000110fe4cf5 _ZN8wxButton16OSXHandleClickedEd + 213 14 AppKit 0x00007fff22e3970b -[NSApplication(NSResponder) sendAction:to:from:] + 288 15 AppKit 0x00007fff22e395af -[NSControl sendAction:to:] + 86 16 AppKit 0x00007fff22e394e1 __26-[NSCell _sendActionFrom:]_block_invoke + 131 17 AppKit 0x00007fff22e393e8 -[NSCell _sendActionFrom:] + 171 18 AppKit 0x00007fff22e3932e -[NSButtonCell _sendActionFrom:] + 96 19 AppKit 0x00007fff22e36417 NSControlTrackMouse + 1820 20 AppKit 0x00007fff22e35cd3 -[NSCell trackMouse:inRect:ofView:untilMouseUp:] + 130 21 AppKit 0x00007fff22e35b9a -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 697 22 AppKit 0x00007fff22e34ec2 -[NSControl mouseDown:] + 722 23 xLights 0x000000011106df91 _ZN17wxWidgetCocoaImpl10mouseEventEP7NSEventP6NSViewPv + 305 24 AppKit 0x00007fff22e332ae -[NSWindow(NSEventRouting) _handleMouseDownEvent:isDelayedEvent:] + 4961 25 AppKit 0x00007fff22da2a98 -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] + 2594 26 AppKit 0x00007fff22da1e56 -[NSWindow(NSEventRouting) sendEvent:] + 347 27 xLights 0x0000000111054c2b -[wxNSWindow sendEvent:] + 123 28 AppKit 0x00007fff22da0264 -[NSApplication(NSEvent) sendEvent:] + 352 29 xLights 0x0000000110fc8922 -[wxNSApplication sendEvent:] + 98 30 AppKit 0x00007fff230795fd -[NSApplication _handleEvent:] + 65 31 AppKit 0x00007fff22c0925e -[NSApplication run] + 623 32 xLights 0x0000000111049abf _ZN14wxGUIEventLoop8OSXDoRunEv + 159 33 xLights 0x0000000110f8d97d _ZN13wxCFEventLoop5DoRunEv + 29 34 xLights 0x0000000110f07df5 _ZN15wxEventLoopBase3RunEv + 85 35 xLights 0x0000000110ee9344 _ZN16wxAppConsoleBase8MainLoopEv + 116 36 xLights 0x0000000111003b61 _ZN5wxApp5OnRunEv + 49 37 xLights 0x0000000110f3b24b _Z7wxEntryRiPPw + 2075 38 xLights 0x0000000110d971ec main + 140 39 libdyld.dylib 0x00007fff2033bf5d start + 1


![Schermafbeelding 2021-06-23 om 20 33 28](https://user-images.githubusercontent.com/4319913/123150152-530a4e80-d462-11eb-8259-09621a3e1f04.png)

=> There is direct addressing to the Display (nuc-i7) requesting for a `Config`. However, as implementations details are not known, yet, there is no response.
vanvught commented 3 years ago

@dkulp

Even when returning a valid CONFIG response, xLights is still crashing with the second Discovery process.

Schermafbeelding 2021-06-28 om 16 28 44 Schermafbeelding 2021-06-28 om 16 34 50 Schermafbeelding 2021-06-28 om 16 28 57

2021-06-28 16:28:33,184 4758846976 log_base [DEBUG] Running controller discovery.
2021-06-28 16:28:33,186 4758846976 log_base [INFO] ZCPP sending discovery packet.
2021-06-28 16:28:33,200 4758846976 log_base [INFO] ArtNet Discovery strange packet received.
2021-06-28 16:28:33,206 4758846976 log_base [INFO] ArtNet Discovery strange packet received.
2021-06-28 16:28:33,231 4758846976 log_base [DEBUG]  Valid DDP Status Response.
2021-06-28 16:28:33,231 4758846976 log_base [DEBUG] {"status":{"man":"www.orangepi-dmx.org","mod":"Pixel","ver":"1.0"}}
2021-06-28 16:28:33,231 4758846976 log_base [DEBUG]    IP 192.168.2.107
2021-06-28 16:28:33,241 4758846976 log_base [DEBUG]  Valid DDP Status Response.
2021-06-28 16:28:33,241 4758846976 log_base [DEBUG] {"status":{"man":"www.orangepi-dmx.org","mod":"Pixel","ver":"1.0"}}
2021-06-28 16:28:33,250 4758846976 log_base [DEBUG]  Valid DDP Config Response.
2021-06-28 16:28:33,250 4758846976 log_base [DEBUG] {"config":{"ip":"192.168.2.107","nm":"255.255.255.0","gw":"192.168.2.1","ports":[{"port":"0","ts":"0","l":"300","ss":"0"},{"port":"1","ts":"0","l":"300","ss":"0"}]}}
2021-06-28 16:28:33,259 4758846976 log_base [DEBUG]  Valid DDP Config Response.
2021-06-28 16:28:33,259 4758846976 log_base [DEBUG] {"config":{"ip":"192.168.2.107","nm":"255.255.255.0","gw":"192.168.2.1","ports":[{"port":"0","ts":"0","l":"300","ss":"0"},{"port":"1","ts":"0","l":"300","ss":"0"}]}}
2021-06-28 16:28:33,268 4758846976 log_base [DEBUG]  Valid DDP Config Response.
2021-06-28 16:28:33,268 4758846976 log_base [DEBUG] {"config":{"ip":"192.168.2.107","nm":"255.255.255.0","gw":"192.168.2.1","ports":[{"port":"0","ts":"0","l":"300","ss":"0"},{"port":"1","ts":"0","l":"300","ss":"0"}]}}
2021-06-28 16:28:33,277 4758846976 log_base [DEBUG]  Valid DDP Config Response.
2021-06-28 16:28:33,277 4758846976 log_base [DEBUG] {"config":{"ip":"192.168.2.107","nm":"255.255.255.0","gw":"192.168.2.1","ports":[{"port":"0","ts":"0","l":"300","ss":"0"},{"port":"1","ts":"0","l":"300","ss":"0"}]}}
2021-06-28 16:28:33,649 4758846976 log_base [DEBUG] In Post Startup
2021-06-28 16:28:33,649 4758846976 log_base [DEBUG] User email address: <email>arjan[dot]van[dot]vught[at]gmail[dot]com</email>
2021-06-28 16:28:34,392 4758846976 log_base [DEBUG] Controller discovery complete.
2021-06-28 16:28:36,910 123145436422144 log_base [ERROR] Failure to access http://192.168.2.107/: 7: Couldn't connect to server.
2021-06-28 16:28:47,950 4758846976 log_base [DEBUG] Running controller discovery.
2021-06-28 16:28:47,952 4758846976 log_base [INFO] ZCPP sending discovery packet.
2021-06-28 16:28:47,962 4758846976 log_base [INFO] ArtNet Discovery strange packet received.
2021-06-28 16:28:47,968 4758846976 log_base [INFO] ArtNet Discovery strange packet received.
2021-06-28 16:28:47,993 4758846976 log_base [DEBUG]  Valid DDP Status Response.
2021-06-28 16:28:47,993 4758846976 log_base [DEBUG] {"status":{"man":"www.orangepi-dmx.org","mod":"Pixel","ver":"1.0"}}
2021-06-28 16:28:47,993 4758846976 log_base [CRIT] Crash handler called.
2021-06-28 16:28:48,041 4758846976 log_base [CRIT] xLights version 2021.19
Time: 2021-06-28T16:28:48

0   xLights                             0x0000000109e9b3fc _Z11handleCrashPv + 3948
1   xLights                             0x0000000109e9ebb0 _ZL20xlFatalSignalHandleri + 32
2   libsystem_platform.dylib            0x00007fff2041cd7d _sigtramp + 29
3   ???                                 0xf6b38000c0001002 0x0 + 17776692894871064578
4   xLights                             0x00000001097a3bd4 _ZN9Discovery8DiscoverEv + 724
5   xLights                             0x000000010985ab4a _ZN12xLightsFrame21OnButtonDiscoverClickER14wxCommandEvent + 426
6   xLights                             0x000000010a0a8b82 _ZN12wxEvtHandler23SearchDynamicEventTableER7wxEvent + 226
7   xLights                             0x000000010a0a893f _ZN12wxEvtHandler12ProcessEventER7wxEvent + 159
8   xLights                             0x000000010a0a8a41 _ZN12wxEvtHandler19ProcessEventLocallyER7wxEvent + 145
9   xLights                             0x000000010a0a8900 _ZN12wxEvtHandler12ProcessEventER7wxEvent + 96
10  xLights                             0x000000010a267ec9 _ZN12wxWindowBase8TryAfterER7wxEvent + 233
11  xLights                             0x000000010a267ec9 _ZN12wxWindowBase8TryAfterER7wxEvent + 233
12  xLights                             0x000000010a267ec9 _ZN12wxWindowBase8TryAfterER7wxEvent + 233
13  xLights                             0x000000010a0e7cf5 _ZN8wxButton16OSXHandleClickedEd + 213
14  AppKit                              0x00007fff22ef070b -[NSApplication(NSResponder) sendAction:to:from:] + 288
15  AppKit                              0x00007fff22ef05af -[NSControl sendAction:to:] + 86
16  AppKit                              0x00007fff22ef04e1 __26-[NSCell _sendActionFrom:]_block_invoke + 131
17  AppKit                              0x00007fff22ef03e8 -[NSCell _sendActionFrom:] + 171
18  AppKit                              0x00007fff22ef032e -[NSButtonCell _sendActionFrom:] + 96
19  AppKit                              0x00007fff22eed417 NSControlTrackMouse + 1820
20  AppKit                              0x00007fff22eeccd3 -[NSCell trackMouse:inRect:ofView:untilMouseUp:] + 130
21  AppKit                              0x00007fff22eecb9a -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 697
22  AppKit                              0x00007fff22eebec2 -[NSControl mouseDown:] + 722
23  xLights                             0x000000010a170f91 _ZN17wxWidgetCocoaImpl10mouseEventEP7NSEventP6NSViewPv + 305
24  AppKit                              0x00007fff22eea2ae -[NSWindow(NSEventRouting) _handleMouseDownEvent:isDelayedEvent:] + 4961
25  AppKit                              0x00007fff22e59a98 -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] + 2594
26  AppKit                              0x00007fff22e58e56 -[NSWindow(NSEventRouting) sendEvent:] + 347
27  xLights                             0x000000010a157c2b -[wxNSWindow sendEvent:] + 123
28  AppKit                              0x00007fff22e57264 -[NSApplication(NSEvent) sendEvent:] + 352
29  xLights                             0x000000010a0cb922 -[wxNSApplication sendEvent:] + 98
30  AppKit                              0x00007fff231305fd -[NSApplication _handleEvent:] + 65
31  AppKit                              0x00007fff22cc025e -[NSApplication run] + 623
32  xLights                             0x000000010a14cabf _ZN14wxGUIEventLoop8OSXDoRunEv + 159
33  xLights                             0x000000010a09097d _ZN13wxCFEventLoop5DoRunEv + 29
34  xLights                             0x000000010a00adf5 _ZN15wxEventLoopBase3RunEv + 85
35  xLights                             0x0000000109fec344 _ZN16wxAppConsoleBase8MainLoopEv + 116
36  xLights                             0x000000010a106b61 _ZN5wxApp5OnRunEv + 49
37  xLights                             0x000000010a03e24b _Z7wxEntryRiPPw + 2075
38  xLights                             0x0000000109e9a1ec main + 140
39  libdyld.dylib                       0x00007fff203f2f5d start + 1

Crashed thread the Main Thread
vanvught commented 3 years ago

Also a crash with the latest release from the Apple App Store.

021-07-18 09:29:41,975 4894719488 log_base [INFO] ******* OnInit: XLights started.
2021-07-18 09:29:42,584 4894719488 log_base [INFO] Version: 2021.21 - App Store
2021-07-18 09:29:42,584 4894719488 log_base [INFO] Bits: 64bit
2021-07-18 09:29:42,584 4894719488 log_base [INFO] Build Date: July 11, 2021
2021-07-18 09:29:42,584 4894719488 log_base [INFO] WX Version: wxWidgets 3.1.6
2021-07-18 09:29:48,727 4894719488 log_base [DEBUG] Controller discovery complete.
2021-07-18 09:29:49,589 4894719488 log_base [DEBUG] Running controller discovery.
2021-07-18 09:29:49,591 4894719488 log_base [INFO] ZCPP sending discovery packet.
2021-07-18 09:29:49,593 4894719488 log_base [INFO] ArtNet Discovery strange packet received.
2021-07-18 09:29:49,604 4894719488 log_base [INFO] ArtNet Discovery strange packet received.
2021-07-18 09:29:49,631 4894719488 log_base [DEBUG]  Valid DDP Status Response.
2021-07-18 09:29:49,631 4894719488 log_base [DEBUG] {"status":{"man":"www.orangepi-dmx.org","mod":"Pixel","ver":"1.0"}}
2021-07-18 09:29:49,631 4894719488 log_base [CRIT] Crash handler called.
2021-07-18 09:29:49,742 4894719488 log_base [CRIT] xLights version 2021.21
Time: 2021-07-18T09:29:49

0   xLights                             0x0000000111853e3c _Z11handleCrashPv + 3948
1   xLights                             0x00000001118575f0 _ZL20xlFatalSignalHandleri + 32
2   libsystem_platform.dylib            0x00007fff20641d7d _sigtramp + 29
3   ???                                 0xf6af0000c0001003 0x0 + 17775426257475866627
4   xLights                             0x00000001111593b4 _ZN9Discovery8DiscoverEv + 740
5   xLights                             0x000000011121032a _ZN12xLightsFrame21OnButtonDiscoverClickER14wxCommandEvent + 426
6   xLights                             0x0000000111a61f02 _ZN12wxEvtHandler23SearchDynamicEventTableER7wxEvent + 226
7   xLights                             0x0000000111a61cbf _ZN12wxEvtHandler12ProcessEventER7wxEvent + 159
8   xLights                             0x0000000111a61dc1 _ZN12wxEvtHandler19ProcessEventLocallyER7wxEvent + 145
9   xLights                             0x0000000111a61c80 _ZN12wxEvtHandler12ProcessEventER7wxEvent + 96
10  xLights                             0x0000000111c21249 _ZN12wxWindowBase8TryAfterER7wxEvent + 233
11  xLights                             0x0000000111c21249 _ZN12wxWindowBase8TryAfterER7wxEvent + 233
12  xLights                             0x0000000111c21249 _ZN12wxWindowBase8TryAfterER7wxEvent + 233
13  xLights                             0x0000000111aa1075 _ZN8wxButton16OSXHandleClickedEd + 213
14  AppKit                              0x00007fff2311570b -[NSApplication(NSResponder) sendAction:to:from:] + 288
15  AppKit                              0x00007fff231155af -[NSControl sendAction:to:] + 86
16  AppKit                              0x00007fff231154e1 __26-[NSCell _sendActionFrom:]_block_invoke + 131
17  AppKit                              0x00007fff231153e8 -[NSCell _sendActionFrom:] + 171
18  AppKit                              0x00007fff2311532e -[NSButtonCell _sendActionFrom:] + 96
19  AppKit                              0x00007fff23112417 NSControlTrackMouse + 1820
20  AppKit                              0x00007fff23111cd3 -[NSCell trackMouse:inRect:ofView:untilMouseUp:] + 130
21  AppKit                              0x00007fff23111b9a -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 697
22  AppKit                              0x00007fff23110ec2 -[NSControl mouseDown:] + 722
23  xLights                             0x0000000111b2a311 _ZN17wxWidgetCocoaImpl10mouseEventEP7NSEventP6NSViewPv + 305
24  AppKit                              0x00007fff2310f2ae -[NSWindow(NSEventRouting) _handleMouseDownEvent:isDelayedEvent:] + 4961
25  AppKit                              0x00007fff2307ea98 -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] + 2594
26  AppKit                              0x00007fff2307de56 -[NSWindow(NSEventRouting) sendEvent:] + 347
27  xLights                             0x0000000111b10fab -[wxNSWindow sendEvent:] + 123
28  AppKit                              0x00007fff2307c264 -[NSApplication(NSEvent) sendEvent:] + 352
29  xLights                             0x0000000111a84ca2 -[wxNSApplication sendEvent:] + 98
30  AppKit                              0x00007fff233555fd -[NSApplication _handleEvent:] + 65
31  AppKit                              0x00007fff22ee525e -[NSApplication run] + 623
32  xLights                             0x0000000111b05e3f _ZN14wxGUIEventLoop8OSXDoRunEv + 159
33  xLights                             0x0000000111a49cfd _ZN13wxCFEventLoop5DoRunEv + 29
34  xLights                             0x00000001119c4175 _ZN15wxEventLoopBase3RunEv + 85
35  xLights                             0x00000001119a56c4 _ZN16wxAppConsoleBase8MainLoopEv + 116
36  xLights                             0x0000000111abfee1 _ZN5wxApp5OnRunEv + 49
37  xLights                             0x00000001119f75cb _Z7wxEntryRiPPw + 2075
38  xLights                             0x0000000111852c2c main + 140
39  libdyld.dylib                       0x00007fff20617f5d start + 1

Crashed thread the Main Thread
cybercop23 commented 7 months ago

Can this be closed?