Help porting Decker to Haiku

Hi all,

This is the first time I’m posting on this forum, I’ve been checking this operating system on and off for years and it’s really nice to see it mature over time!

I’m trying to port Decker, an SDL2-based desktop sketchpad. I’m doing this in an Haiku VM.

I got Decker to build by modifying the Makefile and it can start (though slowly as it uses llvmpipe to display anything so far, but that’s another thing). However, when I try to quit the program through the usual means (Quit or clicking on the Close button), Decker freezes and I have to open the Terminal and kill -9 decker.

When I launch the program through the CLI, try to quit the program normally and then Ctrl-C, I get the option to save a report (output at the end of the post) which doesn’t happen otherwise. Meanwhile, the console outputs BMediaRoster: wait_for_thread returned error. I had this happening in UTM (QEMU frontend for macOS) and VirtualBox both in beta5 and nightly images.

Earlier today, I wanted to open a file I was working on in Decker from my Mac to my Haiku VM. Through a crash I caused trying to transfer files, I discovered that media_addon_server crashing or being killed makes Decker quit gracefully.

As I’m not a programmer, I wonder which program is causing this: SDL2, something in Haiku or Decker itself?

Here’s the report:

Debug information for team /boot/home/Decker/c/build/decker (465):
CPU(s): 2x Intel Core Processor (Skylake)
Memory: 4.00 GiB total, 406.21 MiB used
Haiku revision: hrev59477 Mar 12 2026 06:02:16 (x86_64)

Active Threads:
	thread 465: decker (main)
	thread 466: SDLTimer 
	thread 467: SDLApplication 
	thread 475: w>Decker 
	thread 476: llvmpipe-0 
	thread 477: llvmpipe-1 
	thread 478: pthread func 
	thread 479: pthread func 
	thread 508: team 465 debug task 
	thread 470: _BMediaRoster_ 
		state: Call (double free 0x27329bf5a0)

		Frame		IP			Function Name
		-----------------------------------------------
		00000000	0x6fdef5d217	_kern_debugger + 0x7 
			Disassembly:
				_kern_debugger:
				0x0000006fdef5d210:   48c7c0ed000000  mov $0xed, %rax
				0x0000006fdef5d217:             0f05  syscall <--

		0x7f6a6099f0a0	0x6fdefe9787	wrterror + 0xa7 
		0x7f6a6099f130	0x6fdefeafe2	ofree.constprop.0 + 0x772 
		0x7f6a6099f180	0x6fdefec864	free + 0x74 
		0x7f6a6099f1d0	0x1703faf5b52	BPrivate::media::PortPool::GetPort() + 0x182 
		0x7f6a6099f1f0	0x1703faf5d06	BPrivate::media::request_data::request_data() + 0x16 
		0x7f6a6099f220	0x1703fad413c	BPrivate::media::BMediaRosterEx::~BMediaRosterEx() + 0x5c 
		0x7f6a6099f240	0x1703fad419c	BPrivate::media::BMediaRosterEx::~BMediaRosterEx() + 0xc 
		0x7f6a6099f270	0x17c35cd28c8	BLooper::Quit() + 0x178 
		0x7f6a6099f330	0x17c35cd2963	BLooper::_QuitRequested(BMessage*) + 0x33 
		0x7f6a6099f380	0x17c35cd2e9e	BLooper::task_looper() + 0x28e 
		0x7f6a6099f3a0	0x17c35cd242b	BLooper::_task0_(void*) + 0x1b 
		0x7f6a6099f3c0	0x6fdef5bf07	thread_entry + 0x17 
		00000000	0x7ffd421fc258	commpage_thread_exit + 0 

		Registers:
			  rip:	0x0000006fdef5d219
			  rsp:	0x00007f6a6099eba8
			  rbp:	0x00007f6a6099f090
			  rax:	0x00000000000000ed
			  rbx:	0x0000006fdeffd006
			  rcx:	0x0000006fdef5d219
			  rdx:	0x00007f6a6099e6b8
			  rsi:	0x0000006fdeffa50f
			  rdi:	0x00007f6a6099ebd0
			   r8:	0x2525252525252525
			   r9:	0x8080808080808080
			  r10:	0x0000000000000000
			  r11:	0x0000000000000206
			  r12:	0x00007f6a6099ebd0
			  r13:	0x00000027329bf5a0
			  r14:	0x0000000000000000
			  r15:	0x000000273299abb0
			   cs:	0x002b
			   ds:	0x0000
			   es:	0x0000
			   fs:	0x0000
			   gs:	0x0000
			   ss:	0x0023
			  st0:	0
			  st1:	0
			  st2:	0
			  st3:	0
			  st4:	0
			  st5:	0
			  st6:	0
			  st7:	0
			  mm0:	{0, 0, 0, 0}
			  mm1:	{0, 0, 0, 0}
			  mm2:	{0, 0, 0, 0}
			  mm3:	{0, 0, 0, 0}
			  mm4:	{0, 0, 0, 0}
			  mm5:	{0, 0, 0, 0}
			  mm6:	{0, 0, 0, 0}
			  mm7:	{0, 0, 0, 0}
			 ymm0:	{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
			 ymm1:	{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
			 ymm2:	{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
			 ymm3:	{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
			 ymm4:	{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
			 ymm5:	{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
			 ymm6:	{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
			 ymm7:	{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
			 ymm8:	{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
			 ymm9:	{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
			ymm10:	{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
			ymm11:	{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
			ymm12:	{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
			ymm13:	{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
			ymm14:	{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
			ymm15:	{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
	thread 471: SDL Audio control 
		state: Exception (Segment violation)

		Frame		IP			Function Name
		-----------------------------------------------
		0x7f262a7443b0	0x1703fae6626	BTimeSource::GetTime(long*, long*, float*) + 0x26 
			Disassembly:
				BTimeSource::GetTime(long*, long*, float*):
				0x000001703fae6600:               55  push %rbp
				0x000001703fae6601:           4889e5  mov %rsp, %rbp
				0x000001703fae6604:             4156  push %r14
				0x000001703fae6606:           4989ce  mov %rcx, %r14
				0x000001703fae6609:             4155  push %r13
				0x000001703fae660b:           4989d5  mov %rdx, %r13
				0x000001703fae660e:             4154  push %r12
				0x000001703fae6610:           4989f4  mov %rsi, %r12
				0x000001703fae6613:               53  push %rbx
				0x000001703fae6614:         807f2400  cmpb $0x0, 0x24(%rdi)
				0x000001703fae6618:             7556  jnz 0x1703fae6670
				0x000001703fae661a:         488b4f10  movq 0x10(%rdi), %rcx
				0x000001703fae661e:           4889fb  mov %rdi, %rbx
				0x000001703fae6621:           4885c9  test %rcx, %rcx
				0x000001703fae6624:             7472  jz 0x1703fae6698
				0x000001703fae6626:             8b01  movl (%rcx), %eax <--

			Frame memory:
				[0x7f262a744380]  ........po......   d4 88 86 0d 00 00 00 00 70 6f 02 00 00 00 00 00
				[0x7f262a744390]  .0.2....`0.2'...   01 30 9c 32 00 00 00 00 60 30 9c 32 27 00 00 00
				[0x7f262a7443a0]  .Ct*&....g.?p...   e0 43 74 2a 26 7f 00 00 81 67 ae 3f 70 01 00 00
		0x7f262a7443f0	0x1703fae677c	BTimeSource::RealTimeFor(long, long) + 0x3c 
		0x7f262a7444d0	0x1703facf48e	BMediaEventLooper::ControlLoop() + 0x17e 
		0x7f262a7444f0	0x1703facf09c	BMediaEventLooper::_ControlThreadStart(void*) + 0x1c 
		0x7f262a744510	0x6fdef5bf07	thread_entry + 0x17 
		00000000	0x7ffd421fc258	commpage_thread_exit + 0 

		Registers:
			  rip:	0x000001703fae6626
			  rsp:	0x00007f262a744380
			  rbp:	0x00007f262a7443a0
			  rax:	0x000000000d8688d4
			  rbx:	0x0000002732b24000
			  rcx:	0x00000030abf95000
			  rdx:	0x00007f262a7443c8
			  rsi:	0x00007f262a7443c0
			  rdi:	0x0000002732b24000
			   r8:	0x0000000000000000
			   r9:	0x0000000000e4e1c0
			  r10:	0x00000000000000d0
			  r11:	0x0000000000000202
			  r12:	0x00007f262a7443c0
			  r13:	0x00007f262a7443c8
			  r14:	0x00007f262a7443bc
			  r15:	0x00000027329c3088
			   cs:	0x002b
			   ds:	0x0000
			   es:	0x0000
			   fs:	0x0000
			   gs:	0x0000
			   ss:	0x0023
			  st0:	0
			  st1:	0
			  st2:	0
			  st3:	0
			  st4:	0
			  st5:	0
			  st6:	0
			  st7:	0
			  mm0:	{0, 0, 0, 0}
			  mm1:	{0, 0, 0, 0}
			  mm2:	{0, 0, 0, 0}
			  mm3:	{0, 0, 0, 0}
			  mm4:	{0, 0, 0, 0}
			  mm5:	{0, 0, 0, 0}
			  mm6:	{0, 0, 0, 0}
			  mm7:	{0, 0, 0, 0}
			 ymm0:	{0x88d4, 0xd86, 0, 0, 0x4001, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
			 ymm1:	{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
			 ymm2:	{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
			 ymm3:	{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
			 ymm4:	{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
			 ymm5:	{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
			 ymm6:	{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
			 ymm7:	{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
			 ymm8:	{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
			 ymm9:	{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
			ymm10:	{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
			ymm11:	{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
			ymm12:	{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
			ymm13:	{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
			ymm14:	{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
			ymm15:	{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}

Loaded Images:
	ID		Text Base	Text End	Data Base	Data End	Type	Name
	--------------------------------------------------------------------------------
	4341	0x9ef418000	0x9ef443000	0x9ef443000	0x9ef444000	lib    	/boot/system/lib/libSDL2_image-2.0.so.0.800.8
	4365	0x26af35b000	0x26afe9a000	0x26afe9a000	0x26aff1f000	add-on 	/boot/system/add-ons/opengl/Software Pipe
	4360	0x26c5788000	0x26c5978000	0x26c5978000	0x26c598c000	lib    	/boot/system/lib/libicuuc.so.74.1
	4361	0x314c31a000	0x314c430000	0x314c430000	0x314c431000	lib    	/boot/system/lib/libzstd.so.1.5.6
	4366	0x6c63e68000	0x6c699f7000	0x6c699f7000	0x6c69f9d000	lib    	/boot/system/lib/libLLVM-12.so
	4352	0x6f48e7c000	0x6f48f21000	0x6f48f21000	0x6f48f22000	lib    	/boot/system/lib/libjpeg.so.62.3.0
	4342	0x6fdef1f000	0x6fdf02a000	0x6fdf02a000	0x6fdf041000	lib    	/boot/system/lib/libroot.so
	4351	0xa1eea2b000	0xa1eeaa9000	0xa1eeaa9000	0xa1eeaae000	lib    	/boot/system/lib/libtiff.so.6.1.0
	4349	0xa31f684000	0xa31f8b7000	0xa31f8b7000	0xa31f8cd000	lib    	/boot/system/lib/libstdc++.so.6.0.32
	4339	0xb608766000	0xb60880d000	0xb60880d000	0xb6088c2000	app    	/boot/home/Decker/c/build/decker
	4350	0xc32be23000	0xc32be42000	0xc32be42000	0xc32be43000	lib    	/boot/system/lib/libgcc_s.so.1
	4357	0xc7211dc000	0xc7211dd000	0xc7211dd000	0xc7211de000	lib    	/boot/system/lib/libicudata.so.74.1
	4367	0x100d55b0000	0x100d55e3000	0x100d55e3000	0x100d55ed000	lib    	/boot/system/lib/libnetwork.so
	4346	0x101f6b07000	0x101f6b29000	0x101f6b29000	0x101f6b2c000	lib    	/boot/system/lib/libgame.so
	4354	0x11b0343c000	0x11b0343f000	0x11b0343f000	0x11b03440000	lib    	/boot/system/lib/libwebpdemux.so.2.0.17
	4338	0x11b11bd9000	0x11b11bf8000	0x11b11bf8000	0x11b11bf9000	lib    	/boot/system/runtime_loader
	4348	0x14ee4584000	0x14ee467f000	0x14ee467f000	0x14ee4682000	lib    	/boot/system/lib/libtextencoding.so
	4345	0x1703fa63000	0x1703fb1f000	0x1703fb1f000	0x1703fb2b000	lib    	/boot/system/lib/libmedia.so
	4344	0x17c35b76000	0x17c35eb0000	0x17c35eb0000	0x17c35ede000	lib    	/boot/system/lib/libbe.so
	4343	0x187f4c62000	0x187f4ca0000	0x187f4ca0000	0x187f4ca1000	lib    	/boot/system/lib/libGL.so.1.0.0
	4364	0x19d3f729000	0x19d3f731000	0x19d3f731000	0x19d3f732000	add-on 	/boot/system/add-ons/locale/catalogs/plaintext
	4359	0x1a60c304000	0x1a60c310000	0x1a60c310000	0x1a60c312000	lib    	/boot/system/lib/libicuio.so.74.1
	4355	0x1b8738f5000	0x1b873962000	0x1b873962000	0x1b873964000	lib    	/boot/system/lib/libwebp.so.7.2.0
	4358	0x1eebe116000	0x1eebe453000	0x1eebe453000	0x1eebe467000	lib    	/boot/system/lib/libicui18n.so.74.1
	4368	0x1f0c0c58000	0x1f0c0c64000	0x1f0c0c64000	0x1f0c0c65000	lib    	/boot/system/lib/libbsd.so
	4356	0x1f76c2f0000	0x1f76c34c000	0x1f76c34c000	0x1f76c355000	lib    	/boot/system/lib/libglapi.so.0.0.0
	4362	0x2053a503000	0x2053a508000	0x2053a508000	0x2053a50a000	lib    	/boot/system/lib/libsharpyuv.so.0.1.2
	4353	0x206babf7000	0x206bac0d000	0x206bac0d000	0x206bac0e000	lib    	/boot/system/lib/libz.so.1.3.2
	4347	0x207dc621000	0x207dc630000	0x207dc630000	0x207dc631000	lib    	/boot/system/lib/libdevice.so
	4340	0x2352a102000	0x2352a29a000	0x2352a29a000	0x2352a2a7000	lib    	/boot/system/lib/libSDL2-2.0.so.0.3200.10
	4337	0x7ffd421fc000	0x7ffd42204000	0x00000000	0x00000000	system 	commpage

Areas:
	ID		Base		End			Size (KiB)	Protection	Locking			Name
	--------------------------------------------------------------------------------
	11066	0x60000000	0x60009000	        36	rw-cS      	none          	server_memory
	11068	0x68000000	0x685a0000	      5760	rw-cS      	none          	server_memory
	11005	0x9ef418000	0x9ef443000	       172	r-x        	none          	libSDL2_image-2.0.so.0.800.8_se
	11006	0x9ef443000	0x9ef444000	         4	rw-        	none          	libSDL2_image-2.0.so.0.800.8_se
	10997	0x134d1a4000	0x134d274000	       832	rw-        	none          	rld heap
	11085	0x26af35b000	0x26afe9a000	     11516	r-x        	none          	Software Pipe_seg0rx
	11086	0x26afe9a000	0x26afee8000	       312	rw-        	none          	Software Pipe_seg1rw
	11087	0x26afee8000	0x26aff1f000	       220	rw-        	none          	Software Pipe_seg2rw
	11048	0x26c5788000	0x26c5978000	      1984	r-x        	none          	libicuuc.so.74.1_seg0rx
	11049	0x26c5978000	0x26c598b000	        76	rw-        	none          	libicuuc.so.74.1_seg1rw
	11050	0x26c598b000	0x26c598c000	         4	rw-        	none          	libicuuc.so.74.1_seg2rw
	10998	0x2718d21000	0x2718d22000	         4	rw-S       	none          	_rld_debug_
	11056	0x2732998000	0x2734412000	     27112	rw-        	none          	heap area
	11057	0x300da18000	0x300f774000	     30064	r--S       	none          	libicuuc.so.74 mmap area
	11072	0x30fde42000	0x30fde4e000	        48	rw-S       	lazy          	shared buffer list clone
	11075	0x313616c000	0x313616e000	         8	rw-S       	full          	a cloned BBuffer
	11076	0x313abff000	0x313ac01000	         8	rw-S       	full          	a cloned BBuffer
	11077	0x314a99c000	0x314a99e000	         8	rw-S       	full          	a cloned BBuffer
	11100	0x314b112000	0x314b253000	      1284	rw-S       	none          	libswpipe.so mmap area
	11104	0x314b8d9000	0x314bb85000	      2736	rw-        	none          	heap large allocation
	11105	0x314bf29000	0x314c1d5000	      2736	rw-        	none          	heap large allocation
	11051	0x314c31a000	0x314c430000	      1112	r-x        	none          	libzstd.so.1.5.6_seg0rx
	11052	0x314c430000	0x314c431000	         4	rw-        	none          	libzstd.so.1.5.6_seg1rw
	11106	0x681cc94000	0x681cf40000	      2736	rw-        	none          	heap large allocation
	11107	0x684cec6000	0x684d172000	      2736	rw-        	none          	heap large allocation
	11108	0x6a793fb000	0x6a793fc000	         4	rw-        	none          	libLLVM-12.so mmap area
	11109	0x6a793fc000	0x6a793fd000	         4	r-x        	none          	libLLVM-12.so mmap area
	11110	0x6a793fd000	0x6a793fe000	         4	r--        	none          	libLLVM-12.so mmap area
	11111	0x6c5e1a5000	0x6c5e1a6000	         4	r-x        	none          	libLLVM-12.so mmap area
	11112	0x6c5e1a6000	0x6c5e1a7000	         4	r--        	none          	libLLVM-12.so mmap area
	11113	0x6c63217000	0x6c63c17000	     10240	rwx        	none          	libswpipe.so mmap area
	11114	0x6c63e08000	0x6c63e09000	         4	r-x        	none          	libLLVM-12.so mmap area
	11115	0x6c63e09000	0x6c63e0a000	         4	r--        	none          	libLLVM-12.so mmap area
	11116	0x6c63e2b000	0x6c63e2c000	         4	r-x        	none          	libLLVM-12.so mmap area
	11117	0x6c63e2c000	0x6c63e2d000	         4	r--        	none          	libLLVM-12.so mmap area
	11088	0x6c63e68000	0x6c699f7000	     93756	r-x        	none          	libLLVM-12.so_seg0rx
	11089	0x6c699f7000	0x6c69f26000	      5308	rw-        	none          	libLLVM-12.so_seg1rw
	11090	0x6c69f26000	0x6c69f9d000	       476	rw-        	none          	libLLVM-12.so_seg2rw
	11029	0x6f48e7c000	0x6f48f21000	       660	r-x        	none          	libjpeg.so.62.3.0_seg0rx
	11030	0x6f48f21000	0x6f48f22000	         4	rw-        	none          	libjpeg.so.62.3.0_seg1rw
	11007	0x6fdef1f000	0x6fdf02a000	      1068	r-x        	none          	libroot.so_seg0rx
	11008	0x6fdf02a000	0x6fdf038000	        56	rw-        	none          	libroot.so_seg1rw
	11009	0x6fdf038000	0x6fdf041000	        36	rw-        	none          	libroot.so_seg2rw
	11027	0xa1eea2b000	0xa1eeaa9000	       504	r-x        	none          	libtiff.so.6.1.0_seg0rx
	11028	0xa1eeaa9000	0xa1eeaae000	        20	rw-        	none          	libtiff.so.6.1.0_seg1rw
	11022	0xa31f684000	0xa31f8b7000	      2252	r-x        	none          	libstdc++.so.6.0.32_seg0rx
	11023	0xa31f8b7000	0xa31f8c5000	        56	rw-        	none          	libstdc++.so.6.0.32_seg1rw
	11024	0xa31f8c5000	0xa31f8cd000	        32	rw-        	none          	libstdc++.so.6.0.32_seg2rw
	10999	0xb608766000	0xb60880d000	       668	r-x        	none          	decker_seg0rx
	11000	0xb60880d000	0xb608895000	       544	rw-        	none          	decker_seg1rw
	11001	0xb608895000	0xb6088c2000	       180	rw-        	none          	decker_seg2rw
	11025	0xc32be23000	0xc32be42000	       124	r-x        	none          	libgcc_s.so.1_seg0rx
	11026	0xc32be42000	0xc32be43000	         4	rw-        	none          	libgcc_s.so.1_seg1rw
	11041	0xc7211dc000	0xc7211dd000	         4	r-x        	none          	libicudata.so.74.1_seg0rx
	11042	0xc7211dd000	0xc7211de000	         4	rw-        	none          	libicudata.so.74.1_seg1rw
	11091	0x100d55b0000	0x100d55e3000	       204	r-x        	none          	libnetwork.so_seg0rx
	11092	0x100d55e3000	0x100d55e5000	         8	rw-        	none          	libnetwork.so_seg1rw
	11093	0x100d55e5000	0x100d55ed000	        32	rw-        	none          	libnetwork.so_seg2rw
	11016	0x101f6b07000	0x101f6b29000	       136	r-x        	none          	libgame.so_seg0rx
	11017	0x101f6b29000	0x101f6b2c000	        12	rw-        	none          	libgame.so_seg1rw
	11033	0x11b0343c000	0x11b0343f000	        12	r-x        	none          	libwebpdemux.so.2.0.17_seg0rx
	11034	0x11b0343f000	0x11b03440000	         4	rw-        	none          	libwebpdemux.so.2.0.17_seg1rw
	10995	0x11b11bd9000	0x11b11bf8000	       124	r-x        	none          	runtime_loader_seg0rx
	10996	0x11b11bf8000	0x11b11bf9000	         4	rw-        	none          	runtime_loader_seg1rw
	11020	0x14ee4584000	0x14ee467f000	      1004	r-x        	none          	libtextencoding.so_seg0rx
	11021	0x14ee467f000	0x14ee4682000	        12	rw-        	none          	libtextencoding.so_seg1rw
	11014	0x1703fa63000	0x1703fb1f000	       752	r-x        	none          	libmedia.so_seg0rx
	11015	0x1703fb1f000	0x1703fb2b000	        48	rw-        	none          	libmedia.so_seg1rw
	11012	0x17c35b76000	0x17c35eb0000	      3304	r-x        	none          	libbe.so_seg0rx
	11013	0x17c35eb0000	0x17c35ede000	       184	rw-        	none          	libbe.so_seg1rw
	11010	0x187f4c62000	0x187f4ca0000	       248	r-x        	none          	libGL.so.1.0.0_seg0rx
	11011	0x187f4ca0000	0x187f4ca1000	         4	rw-        	none          	libGL.so.1.0.0_seg1rw
	11060	0x19d3f729000	0x19d3f731000	        32	r-x        	none          	plaintext_seg0rx
	11061	0x19d3f731000	0x19d3f732000	         4	rw-        	none          	plaintext_seg1rw
	11046	0x1a60c304000	0x1a60c310000	        48	r-x        	none          	libicuio.so.74.1_seg0rx
	11047	0x1a60c310000	0x1a60c312000	         8	rw-        	none          	libicuio.so.74.1_seg1rw
	11035	0x1b8738f5000	0x1b873962000	       436	r-x        	none          	libwebp.so.7.2.0_seg0rx
	11036	0x1b873962000	0x1b873963000	         4	rw-        	none          	libwebp.so.7.2.0_seg1rw
	11037	0x1b873963000	0x1b873964000	         4	rw-        	none          	libwebp.so.7.2.0_seg2rw
	11043	0x1eebe116000	0x1eebe453000	      3316	r-x        	none          	libicui18n.so.74.1_seg0rx
	11044	0x1eebe453000	0x1eebe466000	        76	rw-        	none          	libicui18n.so.74.1_seg1rw
	11045	0x1eebe466000	0x1eebe467000	         4	rw-        	none          	libicui18n.so.74.1_seg2rw
	11094	0x1f0c0c58000	0x1f0c0c64000	        48	r-x        	none          	libbsd.so_seg0rx
	11095	0x1f0c0c64000	0x1f0c0c65000	         4	rw-        	none          	libbsd.so_seg1rw
	11038	0x1f76c2f0000	0x1f76c34c000	       368	r-x        	none          	libglapi.so.0.0.0_seg0rx
	11039	0x1f76c34c000	0x1f76c354000	        32	rw-        	none          	libglapi.so.0.0.0_seg1rw
	11040	0x1f76c354000	0x1f76c355000	         4	rw-        	none          	libglapi.so.0.0.0_seg2rw
	11053	0x2053a503000	0x2053a508000	        20	r-x        	none          	libsharpyuv.so.0.1.2_seg0rx
	11054	0x2053a508000	0x2053a509000	         4	rw-        	none          	libsharpyuv.so.0.1.2_seg1rw
	11055	0x2053a509000	0x2053a50a000	         4	rw-        	none          	libsharpyuv.so.0.1.2_seg2rw
	11031	0x206babf7000	0x206bac0d000	        88	r-x        	none          	libz.so.1.3.2_seg0rx
	11032	0x206bac0d000	0x206bac0e000	         4	rw-        	none          	libz.so.1.3.2_seg1rw
	11018	0x207dc621000	0x207dc630000	        60	r-x        	none          	libdevice.so_seg0rx
	11019	0x207dc630000	0x207dc631000	         4	rw-        	none          	libdevice.so_seg1rw
	11002	0x2352a102000	0x2352a29a000	      1632	r-x        	none          	libSDL2-2.0.so.0.3200.10_seg0rx
	11003	0x2352a29a000	0x2352a2a5000	        44	rw-        	none          	libSDL2-2.0.so.0.3200.10_seg1rw
	11004	0x2352a2a5000	0x2352a2a7000	         8	rw-        	none          	libSDL2-2.0.so.0.3200.10_seg2rw
	11096	0x7f0d65712000	0x7f0d65757000	       276	rw-s       	none          	pthread func_476_stack
	11098	0x7f216c745000	0x7f216c78a000	       276	rw-s       	none          	pthread func_478_stack
	11070	0x7f262a701000	0x7f262a746000	       276	rw-s       	none          	SDL Audio control_471_stack
	10993	0x7f3ef12ea000	0x7f3ef22f0000	     16408	rw-s       	none          	decker_465_stack
	11097	0x7f5a6edb6000	0x7f5a6edfb000	       276	rw-s       	none          	pthread func_477_stack
	11099	0x7f678f6a6000	0x7f678f6eb000	       276	rw-s       	none          	pthread func_479_stack
	11069	0x7f6a6095c000	0x7f6a609a1000	       276	rw-s       	none          	_BMediaRoster__470_stack
	11062	0x7f8679142000	0x7f8679187000	       276	rw-s       	none          	pthread func_466_stack
	10992	0x7fe40eb67000	0x7fe40eb6b000	        16	rw-k       	full          	user area
	11084	0x7ff73fadf000	0x7ff73fb24000	       276	rw-s       	none          	w>Untitled_475_stack
	11063	0x7ff7db153000	0x7ff7db198000	       276	rw-s       	none          	pthread func_467_stack
	10994	0x7ffd421fc000	0x7ffd42204000	        32	r-xSk      	full          	commpage

Protection Flags: r - read, w - write, x - execute, s - stack, o - overcommit, c - cloneable, S - shared, k - kernel

Semaphores:
	ID		Count	Last Holder	Name
	------------------------------------------------------------
	2525	    0	          0	LocaleRosterData
	2526	    0	          0	BLocale
	2539	    0	        475	BMessageQueue Lock
	2540	    0	          0	AppLooperPort
	2552	    0	          0	screen list
	2553	    0	          0	clipboard
	2554	    0	          0	width buffer
	2555	    0	          0	some BLocker
	2556	    0	          0	BMessageQueue Lock
	2557	    0	          0	_BMediaRoster_
	2563	    0	          0	BTimedEventQueue
	2564	    0	          0	BTimedEventQueue
	2568	    3	       -471	buffer reclaim sem
	2582	    0	          0	BMessageQueue Lock
	2583	    0	        475	Untitled
	2589	    0	          0	some BLocker
	2593	    0	          0	BGLView draw lock
	2594	    0	          0	BGLView display lock
	2595	    0	          0	info locker
	2611	    0	          0	BMessageQueue Lock
	2612	    0	          0	offscreen bitmap
	2619	    0	          0	BMessageQueue Lock
	2620	    0	          0	offscreen bitmap

If you want to compile Decker for yourself, add this to the Makefile:

ifeq ($(UNAME),Haiku)
	# Required packages: libsdl2_devel, sdl2_image_devel, xdg_utils, vim (xxd required at build-time)
	OPEN=xdg-open
	COMPILER=gcc
	FLAGS=-std=c99 -lm -Wall -Wextra -O2
	FLAGS:=$(FLAGS) -Wno-misleading-indentation -Wno-format-truncation
endif

Have a nice day!

1 Like

Looks like a bug in the graceful exit code of the SDL Audio Control thread and the BMediaRoster looper thread.
I guess @Begasus may have a better view.

I think it has nothing related to Decker itself, everything to SDL2 Haiku port.

Not a developer remember? :wink: Having said that, I know that there are issues being reported at haikuports issue tracker regarding SDL(2), could be related there.

Also have to say that I haven’t touched SDL* in years since it’s been maintained mainly by others, best to report this at haikuports:

In case this is related to BMediaRoster mayb this should be reported at Haiku’s bugtracker:

My bad, I quickly check in Haikuports who pushed recipes and fixes, and your name came :wink:

You probably will find my name frequently in there :rofl: trying to keep things on par :slight_smile:

Tried a build, with the part in the Makefile that works fine, experiencing the freeze also (need to kill it with PC), not seeing a crash here though (Ctrl-C does nothing in Terminal for me).

I guess the best to do @salut_c_leo is to add a defect ticket on haikuports about SDL2_audio, attaching the crash report and the details to reproduce it, so the one(s) SDL2 port developer(s) got interested sooner or later.

I think the problem is that the app never calls SDL_Quit() anywhere in the code. It seems to run fine for me using these changes…

diff --git i/Makefile w/Makefile
index 0da44ca..f5737a2 100755
--- i/Makefile
+++ w/Makefile
@@ -52,6 +52,13 @@ ifeq ($(UNAME),NetBSD)
 	FLAGS=-std=c99 -lm -Wall -Wextra -O2
 	FLAGS:=$(FLAGS) -Wno-misleading-indentation -Wno-format-truncation
 endif
+ifeq ($(UNAME),Haiku)
+	# Required packages: libsdl2_devel, sdl2_image_devel, vim (xxd required at build-time)
+	OPEN=open
+	COMPILER=gcc
+	FLAGS=-std=c99 -Wall -Wextra -O2
+	FLAGS:=$(FLAGS) -Wno-misleading-indentation -Wno-format-truncation
+endif
 ifneq ("$(EXTRA_FLAGS)","")
 	FLAGS:=$(FLAGS) $(EXTRA_FLAGS)
 endif
diff --git i/c/io_sdl2.h w/c/io_sdl2.h
index bf7f0aa..25e0036 100644
--- i/c/io_sdl2.h
+++ w/c/io_sdl2.h
@@ -257,4 +257,5 @@ void io_init(void){
 }
 void io_run(lv*env){
 	while(!should_exit){tick(env);sync();}
+	SDL_Quit();
 }

3 Likes

Oh, so it’s actually an issue on decker code side?

Maybe SDL should setup via atexit() or via some singleton destructor a way to call SDL_Quit() even if the app doesn’t do it explicitly.

Finally got the time to create a ticket on haikuports. It’s strange there is no SDL_Quit() in decker and it still works on any other platform… I could imagine adding it only for Haiku could help, but it doesn’t fix the issue for other programs should it arise again.
Thanks for your help so far!

1 Like

The SDL documentation says that atexit() can be used but I don’t think Haiku should force that behavior on all SDL apps.

I would consider this a bug with Decker. It’s poor coding practice to not clean up and leave the operating system to do it. In my extensive 10 minutes of google searching, it seems that SDL_Quit() is required on many platforms to reset the hardware and other things. For example, if the game had been running in full screen in a different resolution while quitting.

Made a ticket on Decker’s repo, SDL_Quit() is now in the main branch and should be in the next release! I’ll make a PR to add Haiku to the Makefile. I’ll look into making it a Haiku package once I get the time. Thanks for your help!

3 Likes