Thursday, October 22, 2009

wxWidgets and Failed Assertions

I was writing my first GUI in C++ on linux using wxwidgets and would erratically get this message:

./../src/xcb_lock.c:33: _XCBUnlockDisplay: Assertion `xcb_get_request_sent(dpy->xcb->connection) == dpy->request' failed

it did take a couple different forms (i think there was one other), but usually had a dpy->request in it and xcb_lock.c), but this one came up quite often. it was very erratic, and would sometimes keep my gui from coming up at all.

I ultimately (thanks to the help of people in #wxWidgets on freenode) figured out it was because wxWidgets is not thread safe and my worker thread was calling member functions of my GUI.

To fix this I added wxMutexGuiEnter() and wxMutexGuiExit() around my code that access the gui and all issues were resolved.

Monday, June 29, 2009

Getting mail from gmail using fetchmail

So I wanted to setup RT on my ubuntu box. It's been rough so far, but I figured I'd document this as well.

First, I was running ubuntu 7.10 and needed to upgrade to 8.04. That was a bit tricky as i tried to do 'do-dist-upgrade' but it kept failing. I finally figured out it was because i had all the repositories in /etc/apt/sources.list enabled. Needed to pear it back to just be the first one in the file.

So, after I did that I was up to 8.04. From there, I grabbed the 'request-tracker3.6' package using apt-get. This is by far the best way to do this, as it gets everything else you need as well. These instructions were well chronicled at http://www.ubuntugeek.com/request-trackerrt-ticketing-system-for-your-support-group.html. I stupidly didn't setup the database, so got a lot of weird errors.

Next, to get email integration to work... I wanted to check a gmail mailbox for our domain. To do that you need to configure postfix, these instructions (scroll down to the end where it say "Fetchmail\nWhy Fetchmail") http://souptonuts.sourceforge.net/postfix_tutorial.html. One thing it misses is that you need to remember to copy the hashed links of your certs to /etc/ssl/certs.

I have yet to get rt-mailgate to work, though.