Showing posts with label bug. Show all posts
Showing posts with label bug. Show all posts

Saturday, September 22, 2012

Garmin etrex Vista and Linux

I have a new (to me) ancient Garmin etrex Vista handheld GPS ($30, ebay). It has a custom serial connector on the back, takes AA batteries, and happily talks in MGRS in addition to degree-minute-second. MGRS was the key - I need it to be compatible when I go out to the field with the Army Reserve.

Onboard features:
Discovering the Software Version and Unit ID: Main Menu -> Setup -> System -> (Zoom) Software Version.

Problem #1:
The date is showing as 2051. That's a known bug, and this page shows how to fix it by hard-resetting the device.

Gpsbabel:
The gpsbabel package, in the Debian Archives and Ubuntu Repositories, can transfer waypoints, tracks, and routes (but not maps) to/from the device. See the online documentation. It's a command-line application. Here are some example commands:

gpsbabel -D9                                                           # Debug verbose flag
gpsbabel -i garmin,get_posn -f /dev/ttyUSB0 -o kml -F myposition.kml   # Get current position
gpsbabel -o garmin,power_off -F /dev/ttyS0                             # Send power-off command


Tuesday, August 28, 2012

Kernel hibernate bug

Bah. Got bit by a kernel bug preventing wakeup from hibernation.
3.0.0-12-generic wakes up fine.
3.2.0-30-generic doesn't wake up.
Seeing lots of flurry about various similar kernel bugs. So much activity that I'm not going to add to the confusion by trying to troubleshoot or see if it's already reported or fixed upstream. I'll just stay downgraded for now...

Since Ubuntu doesn't remove old kernels yet, it's easy. Simply remove the newest kernel, and use update-grub to boot from the last (known working) kernel. Then I reboot.

sudo apt-get remove linux-image-3.2.0-30-generic linux-headers-3.2.0-30*
sudo update-grub
sudo shutdown -r now 

Tuesday, May 1, 2012

More about Bug 931181



Back in this post, I discussed Launchpad Bug #931181, a SHA1 implementation mistake that broke Debian/Ubuntu Simutrans multiplayer support. So Ubuntu and Debian players could share a game, but cold not connect to any other non-Debian server.

16 Feb 2011, the original patch that broke network play was applied.
12 Feb 2012, I reported the bug.
19 Feb 2012, a Simutrans dev noticed that the issue seemed to be endianness in the SHA1 hash used to communicate paksets between client and server.
21 Mar 2012, Version 111.2.2 of Simutrans is released
29 Apr 2012, the Debian package maintainer created a patch to fix the bug, and applied it to the 111.2.2 upload.

Today, Debian sid and testing (wheezy) and Ubuntu 12.10 have the patched version...but it still doesn't work.

For a clean set of tests, I installed a Debian 7 (testing) VM.

1) Test the Packages: Install the stock Debian Testing packages of simutrans 111.2.2 and simutrans-pak64 111.2 right out of the repos.

# apt-get install simutrans simutrans-pak64
$ simutrans -debug 3 &> s-package.log


Result: Fails to connect to the a.64.simutrans.entropy.me.uk server game. The UI claims the same pakset incompatibility as before. Here's the logfile.

As a check, let's take a look at one SHA1 hash:

PostOffice -> sha1 = 263C0CB8C858272A12FF54FC64F57292AF8ADAB7



2) Test the manual install: Install the upstream Simutrans versions of Simutrans 111.2.2 and Pak64 from the release announcement on the upstream website.

$ mkdir manual
$ cd manual
$ wget http://sourceforge.net/projects/simutrans/files/simutrans/111-2-2/simulinux-111-2-2.zip
$ wget http://sourceforge.net/projects/simutrans/files/pak64/111-2/simupak64-111-2.zip
$ unzip simulinux-111-2-2.zip
$ unzip simupak64-111-2.zip
$ chmod -R +Xr simutrans/pak       # This fixes the pakset's permissions
$ simutrans/simutrans -debug 3 &> ~/s-manual.log

Result: Succesful connection to the a.64.simutrans.entropy.me.uk server game. Here's the logfile.

Let's compare SHA1 hashes to see if the original issue (Launchpad Bug #931181, SHA1 endinaness ) has been fixed, or if this is a separate issue...

PostOffice -> sha1 = 263C0CB8C858272A12FF54FC64F57292AF8ADAB7

The hashes are the same. The original SHA1 issue has been fixed. There is a different bug or misconfiguration.

3) Is the Pakset good? Let's eliminate a possibility -- the packaged Pak64. Use the manually-installed Simutrans from #2 with the packaged Pak64 from #1.

$ simutrans/simutrans -debug 3 -object /usr/share/games/simutrans/pak &> ~/s-crossover.log

Result: Succesful connection to the a.64.simutrans.entropy.me.uk server game. Here's the logfile. The packaged pakset is not the problem. It's the correct version, and compiled properly. The problem is in Simutrans itself somewhere....

Monday, February 20, 2012

Simutrans packaging bug

After a bit of scratching my head, I finally figured out that Simutrans 110.0.1 (the version in Ubuntu 11.10) and the Debian-packaged version that is actually in Ubuntu have a weird incompatibility.

About a year ago, Simutrans added a network-multiplayer-server feature. But Debian/Ubuntu-packaged clients can only communicate with Debian/Ubuntu-packaged servers. Similarly, manually-installed clients can only talk to manually installed servers.

Well, that's certainly not intended behavior - all the servers should be able to talk to all the clients, regardless of whether they were packaged or not!

So I filed LP #931181, because the Debian Games Team needs to know.
And I opened a thread on the developer's forum.

Clue: One developer immediately noted that it seemed to be a checksum issue. (Thanks, Dwachs!)

Well, let's check that. Let's take one item in the pakset, building.PostOffice.pak, and see how it checksum:

Let's hash it manually first:
$ openssl sha1 ~/simutrans110/simutrans/pak/building.PostOffice.pak 
SHA1(/home/me/simutrans110/simutrans/pak/building.PostOffice.pak)= 8b1b5caa71013474039f357094cd1716bd3800bd

$ openssl sha1 /usr/share/games/simutrans/pak/building.PostOffice.pak 
SHA1(/usr/share/games/simutrans/pak/building.PostOffice.pak)= 8b1b5caa71013474039f357094cd1716bd3800bd
So the those pakset items (and, by extension, probably the entire pakset) are identical.

Next, let's check the logs of success and failure:

Succesful (Ubuntu 11.10) server: Message: pakset_info_t::debug: PostOffice -> sha1 = B80C3C262A2758C8FC54FF129272F564B7DA8AAF

Succesful (Ubuntu 11.10) client: Message: pakset_info_t::debug: PostOffice -> sha1 = B80C3C262A2758C8FC54FF129272F564B7DA8AAF

Failed (Manually-installed) server: Message: pakset_info_t::debug: PostOffice -> sha1 = 263C0CB8C858272A12FF54FC64F57292AF8ADAB7

Failed (Ubuntu 11.10) client: Message: pakset_info_t::debug: PostOffice -> sha1 = B80C3C262A2758C8FC54FF129272F564B7DA8AAF

It seems that Dwachs put me on the right track. Given identical files to checksum, the two binaries checksum differently, and both do it differently than Ubuntu's default method, even though each claim to be using the same sha1!


Next, let's look for the changed sha-1 patch at the Debian Games Team git repository.

Aha! February 16, 2011: Add replacement for non-free SHA-1 implementation
Aha! February 16, 2011: get-orig-source: Remove non-free SHA-1 implementation.

The patch, is clearly a replacement for the original Simutrans trunk/utils/sha1.cc
And, looking at the current tree, the patch is still applied.

Er, did I just walk into a year-old dispute between Debian and Simutrans devs?

Next, I need to prove that the patch is the culprit. I need to apply the patch to a stock simutrans source, compile it, run it as a server (in debug mode), successfully join the game from a debian-install client.


Happily, I already have a stock 110.0.1 source, setup, and pakset in my simutrans110 directory, from earlier troubleshooting. Full instructions on how to compile are in this post.

Let's build the unpatched (stock) version first. This should be compatible with a manual install, and incompatible with the Debian version.
$ cp simutrans110 r4359-stock
$ cd r4359-stock/svn/trunk
$ make clean
$ make
$ strip sim
$ cp sim ~/r4359-stock/simutrans/sim-unpatched

Now, let's build a patched version. This should be compatible with the Debian version, and incompatible with a manual install.
$ sudo apt-get install libssl-dev
$ cp simutrans110 r4359-patched
$ cp Desktop/debian_patches_sha1-replacement.diff r4359-patched/svn/trunk
$ cd r4359-patched/svn/trunk

  --- Apply the patch ---
$ rm utils/sha1.*
$ patch Makefile debian_patches_sha1-replacement.diff 
$ patch utils/checksum.h debian_patches_sha1-replacement.diff
$ nano utils/sha1.cc
$ nano utils/sha1.h

$ make clean
$ make
$ strip sim
$ cp sim ~/r4359-stock/simutrans/sim-patched

Finally, we test.

Ubuntu 11.10's package install of Simutrans 110.0.1 can join a game served by sim-patched, but not a game served by sim-unpatched.

A manually-installed version of 110.0.1 is, as expected, the reverse. It can join a game served by sim-unpatched, but not a game served by sim-patched.

Thursday, October 27, 2011

Update Problem - one bug, three symptoms

Upon upgrading in one afternoon from 10.10 to 11.04 and then to 11.10, I found a couple problems.


1) No boot! Nooooo!

I suspect I got bit by bug 858122. The workaround is in comment #22, and works.

But it made me wonder...

See, you can simply rename the symlinks for shutdown, but then the next time a package manager runs "update-rc.d", everything will get hosed again. Looks like each of 5 init.d scripts needs to be patched to show accurate #stop init information, and those patched pushed upstream...if upstream even has the problem.

That's why Comment #22 is a workaround instead of a fix.


2) Very slow boot

According to syslog,
Oct 19 13:54:06 cheesebot-supremo kernel: [ 3.362104] EXT3-fs (sda1): mounted filesystem with ordered data mode
Oct 19 13:54:06 cheesebot-supremo kernel: [ 33.253915] lp: driver loaded but no devices found
So let's try commenting out the lp driver in /etc/modules
I wonder...will CUPS still work after that?

Answer: Turns out to bot be an issue, but another arcane symptom of the same bug.


3) Boot Message "Waiting for Network Configuration"

Not really finding anything on it, seems polluted with #1.

Could there have been an initscripts install failure during an upgrade?

Answer: Turns out to not be an issue, but yet another arcane symptom of the same bug.

The takeaway: A reminder to be methodical attacking bugs. Fix one, test it, and move on.

Monday, April 27, 2009

The Evolution plugin for Mail Notification doesn't work/exist (LP#355209)

In mail-notification 5.4 in Ubuntu Jaunty (9.04), the following files are installed to /usr/lib/evolution/2.24/plugins/ instead of /usr/lib/evolution/2.26/plugins/:
liborg-jylefort-mail-notification.so
org-jylefort-mail-notification.eplug


    A simple workaround:
  1. Copy or link the files to the correct directory:
    sudo ln -s /usr/lib/evolution/2.24/plugins/org-jylefort-mail-notification.eplug /usr/lib/evolution/2.26/plugins/
    sudo ln -s /usr/lib/evolution/2.24/plugins/liborg-jylefort-mail-notification.so /usr/lib/evolution/2.26/plugins/
  2. Restart evolution and go to Edit -> Plugins -> Jean-Yves Lefort's Mail Notification. Check the box.
  3. Right-click on the Mail-Notification icon -> Properties. Add your evolution e-mailbox.

Saturday, April 25, 2009

Upgrading from Xubuntu 8.04 to 9.04

It's finally time to reinstall to dist-upgrade, which I haven't done in a year.
Burning the 9.04 CD: Instead of installing Brasero or another burner, I used the command wodim dev=$PATH-TO-DEVICE driveropts=burnfree -v -data $PATH-TO-ISO, so in my case wodim dev=/dev/scd0 driveropts=burnfree -v -data /home/me/Ubuntu\ Images/xubuntu-9.04-desktop-i386.iso. Very easy and fast that way.

Using the 9.04 LiveCD installer: Very simple. One hiccup when automatic partitioning failed. I chose to reuse my existing partition *without* formatting it first, and (COOL!) my /home directory was untouched. All my preferences and saved fies were still there...as if they had been migrated. Networking and sound worked immediately from the default installation.

Enabling Medibuntu and debtorrent: Medibuntu is for non-free packages like skype. Debtorrent is a method of using torrents instead of mirrors to download. Both require changes to the /etc/apt/sources.list file. debtorrent instructions

sudo cp /etc/apt/sources.list /etc/apt/sources.list~   # Backup the sources.list file
sudo mousepad /etc/apt/sources.list &                  # Open the sources.list file in an editing window

  ## In sources.list, append the following two lines at the bottom, then save (don't close it)
  ## Medibuntu
  deb debtorrent://localhost:9988/packages.medibuntu.org/ jaunty free non-free

sudo apt-get update
sudo sudo apt-get install medibuntu-keyring debtorrent apt-transport debtorrent

  ## In sources.list, substitute each occurrence of the string 'deb http://' prefix with 'deb debtorrent://localhost:9988/'
  ## Save and close the sources.list file.

sudo apt-get update

Bringing back my favorite apps: Using this table, it's pretty easy to figure out what to install and remove. Downloading all this stuff took about 40 minutes.

The droid fonts are nice, but not special.
SubjectPackages I RemovedPackages I AddedInstall Notes
E-Mailthunderbirdevolution
spamassassin
mail-notification-evolution
Evolution needed a couple restarts to start working properly
Scriptingbluefish
d-feet
curl
devscripts
Fontsmsttcorefonts
ttf-droid
Codecsgstreamer0.10-ffmpeg
gstreamer0.10-plugins-ugly
gstreamer0.10-plugins-bad
libdvdcss2
Download-at-first-need for audio also works well.
Printingcups-pdf
GPSgpsd
python-gps
Remote desktopvinagreopenssh-server
xtightvncviewer
xtightvncviewer required manual config: sudo update-alternatives --set vncviewer /usr/bin/xtightvncviewer
Networktransmission-gtk
xchat
deluge
skype
Officeopenoffice.org
openoffice.org-gtk
Otherbluez
bluez-gnome
bluez-cups
gnome-pilot
wine
simutrans
powertop
inkscape
flashplugin-installer
pmount
blues-gnome gets rid of bluetooth-applet
pmount mounts usb drives as user instead of root
Non-Ubuntuskype4pidginhttp://eion.robbmob.com/skype4pidgin.deb

Several launcher icons were missing - the launchers were still in the right place and fully functional, but the application (like bluefish) was gone. After reinstallation, most images came back automatically. A couple needed to be reassociated with the image by right-clicking on 'properties'.

Two important shortcuts were missing.
  • The Home folder icon on the desktop was gone - fixed by right clicking on the desktop, then Desktop Settings -> Icons.
  • The shortcut to my imadison script was missing from /bin. Easy to replace with sudo cp -l imadison.py /bin/imadison

The crontab was gone and had to be recreated.

The mail-notification icon couldn't find evolution (Bug 355209). The bug report has the simple workaround.

Monday, October 13, 2008

Creating a patch to fix an Ubuntu bug

Today I'm preparing a patch to fix Launchpad Bug #117984, which is also Gnome Bug #451734.

References: Ubuntu Wiki, Ubuntu Packaging Guide

It turns out that to do it properly, you need to make two patches. The first one is a .diff file for Debian and upstream. The second creates a .debdiff patch for Ubuntu.

There are circumstances, of course, where one of the patches is not neccessary, and some of these steps can be skipped.

    Note: Use steps 1-9 & 14-15 for just an upstream (.diff) patch. Use steps 1-4,5-7,11-13 & 15 for just an Ubuntu (.debdiff) patch.
  1. Open a terminal window
  2. Create a working directory with the command mkdir working
  3. Move to the working directory with the command cd working
  4. Download the latest source package using the command apt-get source packagename. This method automatically appends an '.orig' suffix, and unpacks the file, too. DON'T download the source from packages.ubuntu.com; instead ADD the repos to your Software Sources control panel using the instructions at the Ubuntu Wiki
  5. Make a copy of the unpacked folder with cp -r package-folder package-folder-orig
  6. Go into the unpacked folder (not the orig) with cd package-folder.
  7. Edit the file using nano path/to/file/to/fix. Fix the file
  8. Return to the working directory with cd ..
  9. Use diff -Nurp package-folder-orig package-folder > upstream-bug#.diff to create the upstream patch.
  10. Go back into the unpacked folder (not the orig) with cd package-folder.
  11. Use the command dch -i to update the changelog. Show the change and list the bug# fixed.
  12. Use debuild -S -us -uc to create the debdiff patch.
  13. Attach the .debdiff patch to the bug in Launchpad.
  14. Attach the upstream .diff patch to the Launchpad bug AND the upstream bug.
  15. Delete the working directory, and all contents.
Update February 5, 2009: Accepted and fixed!

Tuesday, July 22, 2008

Fixing a broken cron job

I am afflicted by Ubuntu Bug #189462, and so I'm getting occasional e-mails from cron that tell me:

/etc/cron.daily/slocate:
slocate: fatal error: load_file: Could not open file: /etc/updatedb.conf: No such file or directory

It turns out to have a trivial solution: touch /etc/updatedb.conf

Update: August 2011 - Finally fixed in Debian.

Thursday, July 17, 2008

Configuring Wine in Xubuntu

Wine 1.0 bugs and fixes.

  • 'Browse C Drive' fails with url not found. This is because Thunar doesn't do bash-style completion, and chokes on a '~' in a config file.

    Fix:
    1. sudo mousepad /usr/share/applications/wine-browsedrive.desktop
    2. Change the line Exec=xdg-open ~/.wine/drive_c to Exec=xdg-open /home/USERNAME/.wine/drive_c
    3. Save and close.

Thursday, February 28, 2008

Ubuntu Bug #158706 Verified

A couple months ago I submitted a bug. Today they confirmed it. (I made a good report)

When installing the package netatalk 2.0.3-6ubuntu1 on Ubuntu 7.10, the following errors occur:

hostname: Unknown host
invoke-rc.d: initscript netatalk, action "stop" failed.
dpkg: warning - old pre-removal script returned error exit status 1
dpkg - trying script from the new package instead ...
hostname: Unknown host
invoke-rc.d: initscript netatalk, action "stop" failed.
dpkg: error processing /var/cache/apt/archives/netatalk_2.0.3-6ubuntu1_i386.deb (--unpack):
 subprocess new pre-removal script returned error exit status 1
hostname: Unknown host
invoke-rc.d: initscript netatalk, action "start" failed.
dpkg: error while cleaning up:
 subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/netatalk_2.0.3-6ubuntu1_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install. Trying to recover:
dpkg: error processing netatalk (--configure):
 Package is in a very bad inconsistent state - you should
 reinstall it before attempting configuration.
Errors were encountered while processing:
 netatalk
Press return to continue.


How to fix it:

  1. edit /etc/default/netatalk

    FROM: ATALK_NAME=`/bin/hostname --short`

    TO: ATALK_NAME=`/bin/hostname`
  2. edit /etc/init.d/netatalk

    FROM: ATALK_NAME=`/bin/hostname --short`

    TO: ATALK_NAME=`/bin/hostname`


Updates:

  • Submitted Feb 28, 2008
  • Marked as a duplicate of Bug 109917 on October 10, 2010

Wednesday, February 27, 2008

Ubuntu Startup: services-admin prompts for password

Every time I login to my Ubuntu 7.10 laptop, I get the 'happy login' music and the screen begins to populate with my desktop.

Then it vanishes (before I can click on anything), and services-admin prompts me for my password. Whether I enter the password or simply cancel, the system thinks for a moment, then brings up the network and brings back the desktop.

The only difference I've noticed is that CUPS seems to be active only when I've entered my password, and isn't if I cancelled instead. If all it's starting is CUPS, then I don't care if services-admin starts or not; I can start it manually. I'm annoyed by services-admin prompting me.

Result: Nothing in bugs, nothing in forums. Left a post at www.ubuntu-forums.com to see if anyone can help.

Update April 2009: Upgrading to 8.04 eliminated the problem. The ubuntuforums thread was never answered.