Blog
Page: 0 1 2 3 4 5 ... 10 ... 15 ... 20 ... 25 ... 30 ... 35 ... 40 ... 45 ... 50 ... 55 ... 60 ... 65 ... 70 ... 75 ... 80 ... 85 ... 90 ... 95 ... 100 ... 105
Forums Re-style
Date: 7/5/2018
Tags: website
I've just finished a fairly major re-style of the forums just now. I hope you like it! Functionally it's still fairly much the same but it's much more modern looking. I tool a little inspiration from the Whirlpool Forums which have a nice design. But kinda blended in my own thing.

I've also added new forums for the different apps that I recently launched. And removed some old cruft as well.

The old forums are still there but I'll removed them once the new version has been tested a little more.
(3) Comments | Add Comment

Cmake stupidity...
Date: 1/12/2017
Tags: cmake
So given this snippit:
add_dependencies(my_target jansson)
I get this error:
The dependency target "jansson" of target "my_target" does not exist.
Ok so I did 'add_directory' that, so what if I did this:
add_library(jansson)
add_dependencies(my_target jansson)
Now I get:
add_library cannot create imported target "jansson" because another target with the same name already exists.
Really? It just errored out because it didn't exist? You can't have it both ways Cmake!!!

Cmake: you get what you paid for!
(1) Comment | Add Comment

UDP and Ubuntu 14/Windows incompatibility
Date: 14/9/2017
Tags: linux ubuntu networking
For the last few weeks I've been mucking around in the background with an application I've called "ClipShare" that basically sits on the network and allows you to copy and paste between different machines. It supports text, images and files at the moment. I'm sure such a thing already exists but I like how it auto-detects all the machines running it on the network via UDP broadcast and supports Windows, Mac and Linux. It's far from production ready, it still crashes a bit and hangs up during file transfers sometimes. But over time I'm sure I'll iron that out.

Things like Samba, VNC and VM's (Vmware/Virtualbox) tend to have support for things like clipboard and file sharing. But in my experience they break very easily and it's 50/50 if they'll work or not. Hence having an alternative for getting the data across.

In testing I had a Ubuntu 14 VM running on a Windows host and for the life of me couldn't get the UDP packets to go from Ubuntu to Windows. I could see the packets arriving in Windows land via Wireshark but the recvfrom wouldn't get the packet. The packet wasn't large, just 40 bytes or so. In researching the issue I found that IP packets have a checksum, so I figured out how to get Wireshark to test the checksum. It confirmed the checksum was good. I could see using 'netstat -s' that there was an increasing count of 'Received Packets Discarded'. So Windows for reasons unknown was discarding the UDP traffic from Ubuntu. I tried turning off the Windows Firewall. No difference.

So then I decided to spin up my Ubuntu 16 VM and test the exact same code there. And sure enough it's working fine. So in conclusion I believe that at the OS level, Ubuntu 14 has some busted networking code. I can't tell what's wrong. Maybe it's a Windows thing. But it's basically meant I'm moving to Ubuntu 16 for all my Linux dev stuff. The main reason I had a Ubuntu 14 environment was that I had a working Raspberry Pi cross compiler install and I hate messing with a working env just for the sake of upgrading. However that broke recently anyway so it seems that the last reason for keeping 14 just disappeared.

Fun times.
(1) Comment | Add Comment

Apple and the curse of VNC
Date: 8/9/2017
Tags: mac vnc
For many years now it's annoyed me greatly that trying to connect a Windows VNC client to a MacOSX VNC server has resulted in terrible horrible slow and glitchy performance. Mac to Mac is fine, Windows to Windows is fine, but cross platform? Nope. In fact the Mac to Mac performance is better than any of the Windows or Linux implementations. The reason being that Apple has added a range of proprietary extensions to make that use case better than normal VNC. This is also why the Windows -> Mac case is sub-optimal. It seems that the fast VNC modes that everyone else talks aren't spoken by the Apple VNC server implementation. So what to do? Well the solution that I'm employing at the moment is to... not use the Apple VNC server implementation! Turn off screen sharing in the options and install VNC connect. The cross platform performance is quite decent, running the server and client from the same vendor. Maybe 90% as fast as the all Apple case?

Embrace, extend, extinguish am I right?

You either die a hero or you live long enough to see yourself become the villain.

(I will try and find a free solution in the medium term, and will update this post if/when I do)
(0) Comments | Add Comment

sem_post funkiness on Linux
Date: 9/8/2017
Tags: linux
I moved the Linux implementation of the GThreadEvent class (.h, .cpp) over to the sem_open, sem_post, sem_wait calls a little while back.

Initially I used named semaphores and that seemed to work ok. But after a few weeks I noticed that sometimes the call to sem_post would just quietly NOT increment the semaphore count, while still returning 0 (Success). Which causes the listening thread blocking in sem_wait to never wake up. Crucially this would break the destructor / exit loop of GEventTargetThread.

Googling this didn't turn up anything useful. I believe I was using the API correctly and the documentation is very sparse. Anyway I implemented the semaphores using the sem_init/sem_destroy (anonymous) and it seems to be robust. Still, I'd like to know what the deal is with the named ones. The general pattern of behaviour I would see is:
  • Thread 1: Create using sem_open
  • Thread 2: Block on sem_wait
  • Thread 1: Start shutdown - calls sem_post (returns 0, but no increment) to tell thread 2 that it needs to exit.
  • Thread 2: Still stuck blocking on sem_wait...
Fun times. I checked it under valgrind and no weird memory accesses. Sometimes it would work ok and exit gracefully. But most of the time it would hang.
(0) Comments | Add Comment

Visual Studio 2013 crash...
Date: 9/2/2017
Tags: vs2013
This is just awesome:



The trace is something like this:
>	clr.dll!DontCallDirectlyForceStackOverflow(void)	Unknown
 	clr.dll!CLRVectoredExceptionHandler(struct _EXCEPTION_POINTERS *)	Unknown
 	clr.dll!CLRVectoredExceptionHandlerShim(struct _EXCEPTION_POINTERS *)	Unknown
 	ntdll.dll!RtlpCallVectoredHandlers()	Unknown
 	ntdll.dll!RtlDispatchException()	Unknown
 	ntdll.dll!_KiUserExceptionDispatcher@8()	Unknown
 	clr.dll!DontCallDirectlyForceStackOverflow(void)	Unknown
 	clr.dll!CLRVectoredExceptionHandler(struct _EXCEPTION_POINTERS *)	Unknown
 	clr.dll!CLRVectoredExceptionHandlerShim(struct _EXCEPTION_POINTERS *)	Unknown
 	ntdll.dll!RtlpCallVectoredHandlers()	Unknown
 	ntdll.dll!RtlDispatchException()	Unknown
 	ntdll.dll!_KiUserExceptionDispatcher@8()	Unknown
 	clr.dll!DontCallDirectlyForceStackOverflow(void)	Unknown
 	clr.dll!CLRVectoredExceptionHandler(struct _EXCEPTION_POINTERS *)	Unknown
 	clr.dll!CLRVectoredExceptionHandlerShim(struct _EXCEPTION_POINTERS *)	Unknown
 	ntdll.dll!RtlpCallVectoredHandlers()	Unknown
 	ntdll.dll!RtlDispatchException()	Unknown
 	ntdll.dll!_KiUserExceptionDispatcher@8()	Unknown
 	cpfe.dll!_corresp_init()	Unknown
 	ntdll.dll!ExecuteHandler@20()	Unknown
 	ntdll.dll!_KiUserExceptionDispatcher@8()	Unknown
 	cpfe.dll!_corresp_init()	Unknown
 	ntdll.dll!ExecuteHandler@20()	Unknown
 	....repeated a lot....
 	ntdll.dll!_KiUserExceptionDispatcher@8()	Unknown
 	cpfe.dll!_corresp_init()	Unknown
 	ntdll.dll!ExecuteHandler@20()	Unknown
 	ntdll.dll!_KiUserExceptionDispatcher@8()	Unknown
 	cpfe.dll!_corresp_init()	Unknown
 	ntdll.dll!ExecuteHandler@20()	Unknown
 	ntdll.dll!_KiUserExceptionDispatcher@8()	Unknown
 	KernelBase.dll!_RaiseException@16()	Unknown
 	[External Code]	
 	cpfe.dll!scout_parser::class_def_or_decl(struct a_source_point const &,struct a_type_specification &)	Unknown
 	cpfe.dll!scout_parser::tag_type_def_or_decl(struct a_source_point const &,struct a_type_specification &)	Unknown
 	cpfe.dll!scout_parser::type_specifier(struct a_type_specification &)	Unknown
 	cpfe.dll!scout_parser::type_specifiers(struct a_type_specification &)	Unknown
 	cpfe.dll!scout_parser::simple_declaration(struct a_type_specification &,class antlr::TokenRefCount)	Unknown
 	cpfe.dll!scout_parser::property_or_event_or_simple_declaration(struct a_type_specification &,class antlr::TokenRefCount)	Unknown
 	cpfe.dll!scout_parser::general_declaration(struct a_type_specification &,class antlr::TokenRefCount)	Unknown
 	cpfe.dll!scout_parser::general_declaration_with_error_recovery(struct a_type_specification &,class antlr::TokenRefCount)	Unknown
 	cpfe.dll!scout_parser::declaration(struct a_type_specification &,class antlr::TokenRefCount)	Unknown
 	cpfe.dll!scout_parser::declarations(void)	Unknown
 	cpfe.dll!scout_parser::translation_unit(void)	Unknown
 	cpfe.dll!_run_scout_parser()	Unknown
 	cpfe.dll!_corresp_init()	Unknown
 	cpfe.dll!_compute_il_prefix_size()	Unknown
 	cpfe.dll!_edg_main()	Unknown
 	cpfe.dll!_corresp_init()	Unknown
 	cpfe.dll!tag_parse(int,unsigned short const * *,unsigned short const *,bool,struct IEdgeSnapshotSession *,class a_scout_parser_interface *)	Unknown
 	vcpkg.dll!CExtStore::TagParseHelper(struct HBase,unsigned short const *,struct IEdgeSnapshotSession *,unsigned short const * * const,int,enum FileType)	Unknown
 	vcpkg.dll!CExtStore::TagParseCpp(struct HBase,unsigned short const *,struct IEdgeSnapshotSession *,unsigned short const * * const,int)	Unknown
 	vcpkg.dll!CCppParser::Parse(struct HBase,unsigned short const *,struct IEdgeSnapshotSession *,unsigned short const * * const,int,class CSharedPtr >)	Unknown
 	vcpkg.dll!CPopulateWorkItem::Work(void)	Unknown
 	vcpkg.dll!CWorkItem::InvokeWork(unsigned int)	Unknown
 	vcpkg.dll!CWorkQueue::Work(bool,unsigned int,unsigned int)	Unknown
 	vcpkg.dll!CWorkerThread::Work(void)	Unknown
 	vcpkg.dll!CWorkerThread::Work(void *)	Unknown
 	kernel32.dll!@BaseThreadInitThunk@12()	Unknown
 	ntdll.dll!__RtlUserThreadStart()	Unknown
 	ntdll.dll!__RtlUserThreadStart@8()	Unknown


I want to see if any one else is getting this...
(1) Comment | Add Comment