Harvard Business School of Echec

Aller au contenu | Aller au menu | Aller à la recherche

mercredi, 14 mai 2008

/dev/random

About DSA-1571 openssl , I totally aggree with Eric ... openssl is just like this XKCD strip. So whatever distro you run, cross your fingers while you generate your keys from so-called uninitialized memory so it's uninitialized enough. Why don't we just drop openssl ?

PS: http://wiki.debian.org/SSLkeys gives better explanation. The problem is that one of the cleanups is harmless, while the other one actually commented the code that seeds the PRNG with real entropy. Ouch.

lundi, 5 mai 2008

Build a deb package with debug info

I often find the need to rebuild a package with debug symbols (if no -dbg is available).

sudo apt-get build-dep <package>
apt-get source <package>
cd <package>
# eventually patch sources
DEB_BUILD_OPTIONS=nostrip dpkg-buildpackage -rfakeroot -uc -us
cd ..
dpkg -i <package>.deb

Et voilà :) Now i can gdb it or run sysprof. (It's also a very fast way to start hacking on a program)

lundi, 21 avril 2008

Quelques minutes avec Fedora

Au travail, la distribution GNU/Linux validée est RHEL 4.5 sur les serveurs et les postes de travail. C'est un peu vieux (Linux 2.6.9, avec un GNOME 2.6 - 2.7), mais ça fonctionne sans problème (j'ai même était surpris que le branchement de clef USB à chaud fonctionne). À mes débuts, vers 2000, j'utilisais RedHat et Mandrake, mais depuis que j'ai découvert Debian, je n'avais jamais ré-utilisé ce type de système.

Donc je me suis dit que j'allais tester Fedora 8, j'ai téléchargé le DVD pour installer ça sur une machine de récupération. L'installation est facile, elle est graphique et ça tient même dans du 800x600, et j'ai choisi un mode minimal (823 paquets quand même): par défaut, le partitionnement utilise LVM et SELinux est en mode strict, tout ça me plaît bien. Il y aussi icedtea dans le tas, c'est sympathique. Quelques minutes plus tard, j'arrive sur mon bureau GNOME 2.20. C'est mignon et très standard. Je veux rajouter un disque dur pour étendre mon / mais je n'arrive pas à trouver d'outils dans le menu, je finis donc par un petit pvcreate/vgextend/lvextend/resize2fs, rien de bien sorcier.

En passant, il n'y a pas de sudo configuré par défaut, on tape donc le mot de passe root pour les gestes d'admin.

Ensuite je me mets en tête de tester frysk et systemtap puisque qu'apparemment c'est installé: impossible de mettre la main dessus. Rien dans mon PATH, les paquets sont bien installés, je lis le man, fais un gros find /, mais impossible de trouver comment les lancer. Je me dis bon je vais déinstaller/supprimer frysk au cas où: yum remove frysk fonctionne très bien, par contre yum install frysk ne connaît pas frysk, le mode search ne trouve rien. Au passage, il n'y a pas de complétion bash pour yum. Je laisse tomber puisque je vois qu'il y a une entrée dans le menu Applications pour ajouter/supprimer des logiciels.

J'ai déménagé deux fois en un mois, je n'ai pas récupéré d'accès à Internet, et quand je lance ce gestionnaire de paquets graphique, il n'arrive logiquement pas à récupérer la liste des paquets: il y a bien un bouton "Annuler" mais il ne fonctionne pas. Quand la MAJ échoue enfin, j'ai le choix entre quitter ou voir l'éditeur de la liste des dépôts. Là c'est la première farce: si je clique sur "Fermer" sans avoir fait de modification, ça quitte le gestionnaire de paquets. Après plusieurs essais, je le comprends, et je ne laisse activer que le dépôt "Install media" qui doit correspondre à mon DVD (même si les détails du dépôt sont entièrement vide). La liste des paquets est enfin disponible. Je suis déjà un peu méfiant, puisque qu'en somme le gestionnaire de paquets n'est pas (trivialement) utilisable si on est pas connecté à Internet. Très mauvais point.

J'arrive ensuite sur une liste de méta-paquets répartis en catégories. Ce sont des gros méta-paquets, il y en a peut-être une vingtaine, avec des noms simples tels que "Environnement GNOME", "Développement GNOME", etc. Impossible de savoir ce qu'il y a dedans, par contre, on peut savoir en cliquant sur le bouton "Paquets additionnels" ce qu'il n'y pas dedans. Je sélectionne donc "Développement GNOME", j'installe, c'est un ensemble de paquets très utiles, genre tous les -devel sauf que ça n'a installé aucun outil de développement un peu utile genre style gcc. Ça m'a quand même installé rcs... J'y retourne pour installer "Outils de développement". Je me promène dans les autres catégories pour personnaliser tout ça : au revoir le "Serveur web" (toujours impossible de savoir ce que ça contient), je désélectionne aussi "Bureautique/Productivité" (sic) qui selon sa description doit contenir des afficheurs PDF, etc.

Erreur monumentale.

D'abord les descriptions sont inexactes voire fausses. Ensuite, il n'y pas de gestion de dépendances entre les méta-paquets : en cliquant à droite à gauche pour alléger mon système, ça a un peu déselectionner par hasard "Environnement de bureau GNOME", sans me le dire bien sur... moi je suis un luser de base, quand on me présente une liste illisible de noms de RPM dans une petite fenêtre, je fais "Appliquer". Et là je vois l'installateur de paquets afficher des mise à jour (???), et j'aperçois des trucs importants passer à la trappe: nautilus, gnome-volume-manager, etc. Bref il est trop tard. Les applets plantent en rafale. Je me retrouve à la porte, je retombe sur GDM et tente de retourner dans ma session ... xterm. On m'avait pas le coup depuis 10 ans.

Magnifique: en quelques minutes, j'ai flingué mon système en voulant juste supprimer "Sons et vidéos", "Graphismes", "Internet basé sur texte" (sic) et quelques trucs comme ça. J'insiste, je n'ai pas fait n'importe quoi. Seulement les dépendances et RPM, même 10 ans après, ça ressemble toujours à de l'escroquerie. Une distribution avec des gestionnaires de paquets aussi défectueux, ça me paraît inutilisable (et pour cause j'ai détruit mon système) qu'on soit utilisateur de base ou ingénieur de métier. Mais qui utilise ça !?

Le DVD finira son weekend à la poubelle. Mes Debian/Sid n'ont pas à s'en faire. Une distribution, c'est des paquets, et Fedora j'ai vu. Pour bien m'assurer du problème, j'ai fait 2 fois l'installation et la manipulation. La première fois, j'ai même eu droit à un plantage du gestionnaire de paquets. Peut-être que Fedora a par ailleurs de bons outils de configuration système (j'ai regardé un peu l'intégration NIS/LDAP/Kerberos ça m'a plu), mais si le plus important est (toujours) défaillant, ça fait fuire.

Allez pour la route, une petite capture d'écran pour que vous faire une idée du niveau de crédibilité de la gestion des paquets sous Fedora 8:

armenie

(Vous pouvez aussi en déduire que personne n'utilise Fedora, en français du moins, sinon ce genre de bourdes aurait était détecté)

mardi, 18 mars 2008

WTF

system-monitor is getting famous !
(This is bug#418652.)

jeudi, 21 février 2008

Power management failure

Tonight i was hacking on my ibook on my sofa watching Extreme Makeover. Then "peeeeeeeeeeeewwwwwwwwwwwww". No more battery.
I haven't received any warning at all. Maybe gnome-power-manager is a bit broken currently on Debian/sid because of hal/s2ram/whatever on ppc. I mean s2ram and hal works, but no the way gpm likes them too (i have to manually run s2ram to suspend). But at least , I would have expected gpm to warn me, and then shutdown my laptop. Yep, i've checked, when the battery level becomes critical, it should have poweroff. But that did not happen.
Now i only trust the battery gauge LEDs.
Happy End: thanks to reiserfs and emacs, i haven't lost a single line of code :)

mercredi, 13 juin 2007

Indiana patches

Dear Sun Microsystems, I think your patches are bullshit. Please drop them or as already suggested, do fork.
As the maintainer of system-monitor and libgtop, i have already rejected stupid patches from you. They contain unkown API changes and a lot of dead code. The libgtop patch is the most scary. Here's a tip: libgtop code is OS specific (linux, bsd, solaris, etc have their own separate implementation) so copying linux code to solaris is obviously NOT going to work.
I can see that some of your patches are actually OK, but your people don't seem to understand how we work.
This reminds me of that private mail where you asked me to re-license libgtop to LGPL because you had some kind of packaging issues ... because you wanted to install libgtop in /foo/bar and instead of /foo/baz. Bad for you.

dimanche, 3 juin 2007

a system crash ruined my weekend :/

I was trying to move some Scrubs xvid from my laptop to my large screen computer using samba. I first tried gnomevfs but it was too slow : it was painfully reaching 1MiB/s using 100% CPU which is not right when moving 4.4GiB. I know i could directly use cifs instead but i switched to smbnetfs (FUSE Samba browser) which can reach easily 10MiB/s (~physical limit, i think smbnetfs has 10% overhead compared to a manual mount). smbnetfs is usually fine but using it with nautilus is the WORST idea i had since a long time. File copy did not work because nautilus claimed there was no space on device. I was about to quit but i wanted to also delete some files. I clicked 'move to trash' ... worst thing ever : my computer got instantly locked. I don't know who (gnomevfs, nautilus or fuse) started a fork bomb or a syscall storm but it was quite effective. I couldn't even log in on a tty. It's the first time since i use GNU/Linux that i lock my computer that hard. Hard reboot and data loss.

mercredi, 30 mai 2007

firefox bad ui

I don't like the way bugs are handled on Mozilla's bugzilla. The Firefox Preferences UI is totally screwed :



which is obviously an arch-dependant bug.
Edit: Thanks everyone who also reported the same bug. It is actually a 2 year old bug

dimanche, 22 avril 2007

Iterate & Erase

I have discovered a nice bug in my code. I had some stuff about iterating a std::list<> and removing some elements at the same time. Like the following :

std::list<> l;

iterator it(l.begin());

while (it != l.end()) {
	if (...)
		it = l.erase(it);
	else
		++it;
}

Then i moved from std::list<> to std::set<> (ordered set). The code didn't compile as is because std::set<>::erase returns void. The STL documentation says Erasing an element from a set also does not invalidate any iterators.... OK then, no return value.

std::set<> s;

iterator it(s.begin());

while (it != s.end()) {
	if (...)
		s.erase(it);
	++it;
}

It worked nicely for a long time. But once i got a double free crash. In order to debug it, i added many print. For example {1 2 3 5 6 7} - {3} shoud have printed {1 2 5 6 7} but instead i got {1 2 2 5 6 7} or {1 5 6 7 2} !

So i read again the documentation : Erasing an element from a set also does not invalidate any iterators, except, of course, for iterators that actually point to the element that is being erased.. Bon sang !

The correct way to do it :

std::set<> s;

iterator it(s.begin())

while (it != s.end()) {
	iterator next(it);
	++next;
	if (...)
		s.erase(it);
	it = next;
}

vendredi, 2 mars 2007

libsexy bugs

Hey chipx86, would you please have a look at libsexy bugzilla ? There are a couple of annoying bugs about sexy_treeview so I had to disable libsexy in system-monitor 2.17.x.

Thanks.

mercredi, 28 février 2007

gnome-system-monitor 2.17 has been compromised

Last night, Matthias Clasen and Shaun McCance helped me fix a gnome-doc-utils bug in gnome-system-monitor tarball. I then released gnome-system-monitor-2.17.93 because I am the maintainer.

Then, somebody, who owns a regular svn/ssh account, has commited without approval unreviewed content to gnome-system-monitor trunk. He also tagged the wrong way. And in the end, he released gnome-system-monitor-2.17.94. I don't know anything about this man. I've just got an email from him to tell what he has done. Update: he even created&closed a bug against system-monitor.

gnome-system-monitor 2.17.94 is not official and not trusted at all. DO NOT USE IT.

The following are unreviewed, not trusted and have unknown content :

  • SVN tag GNOME_SYSTEM_MONITOR_2_17_94 and revision 1935, 1936, 1937 and 1938
  • gnome-system-monitor 2.17.94 tarballs on the GNOME ftp server.

Today 28/02/2007, only the following are trusted and official :

  • SVN tag tags/GNOME_SYSTEM_MONITOR_2_17_93 and revisions up to 1934
  • gnome-system-monitor 2.17.93 tarballs on the GNOME ftp server.

Security infrastructure

It would be nice to be able to GPG-sign tarballs that are uploaded to the GNOME FTP server.

samedi, 17 février 2007

evolution + bogofilter

There is no standard bogofilter plugin for evolution. I am not happy with spamassassin/spamd/spamc CPU and RAM requirements. Like 'sa-learn --version' which takes 1.8s even on warm start...

So I wrote a tiny (stupid) ruby script to emulate SpamAssassin programs with bogofilter.

#!/usr/bin/env ruby

# 1 spam, 0 not-spam
def bogo_exec(mode)

  system 'bogofilter', '-l', mode

  exit case $?.exitstatus
    when 0
    1
    else
    0
  end
end

if ARGV.include?('--version') then
  print "SpamAssassin version 3.1.0-bogo\n"
  exit
end

if ARGV.include?('--spam') then
  bogo_exec '-s'
end

if ARGV.include?('--ham') then
  bogo_exec '-n'
end

if ARGV.include?('-c') or ARGV.include?('--exit-code') then
  bogo_exec '-u'
end

I then created symlinks {spamassassin, spamc, spamd, sa-learn} -> spam.rb in my PATH. Maybe it WAS incomplete and broken, but it NOW works. No more daemon. Mail retrieval is no longer CPU-bound. Evolution and I are happy.

Update

I have fixed the script. To feed spam/ham here is what i did :

  1. selected a bunch of messages in evolution and Saved As '/tmp/mails'
  2. run sa-learn --spam < /tmp/mails or sa-learn --ham < /tmp/mails

lundi, 12 février 2007

signedness fun

3 years ago, i deleted code that i didn't understand in libgtop. It was a mess about bitwise shift and xor. Then came these bugs about system-monitor displaying 17179869184.0 GiB. This is about available disk space (you know, the 10% reservation for root, etc). On *BSD, available disk space can be negative... so you can get df to reports negative capacity :

$ df -h /
Filesystem      Size    Used   Avail Capacity  Mounted on
/dev/ad10s1a    496M    457M   -514K   100%    /

(This reminds me of mfs fun with OpenBSD ;)

libgtop uses statvfs/statfs functions to get disk space usage : struct statvfs members' type is fsblkcnt_t which is an unsigned integer. This means that some kernels store signed values as unsigned integers. Hence the old fun code i deleted. glibtop_fsusage members are guint64 so there is not signedness mismatch between libgtop and the system.

As I was unable to get negative values with linux 2.6.20 and ext3, I dig into GNU df code and found the very same code that was in libgtop, i guess someone copy&pasted it into libgtop a long time ago. This code does funny things to handle integers with the top bit set as negative integers.

I ended to this madness by ensuring available disk space is <= to free disk space.

jeudi, 25 janvier 2007

Bézier Curves

I have commited a great but simple patch from Lucas Mazzardo Veloso . It uses Bezier Curves to draw the load graph instead of lines thanks to cairo. Sorry, dotclear 2.0-beta5.4 is buggy, i can't attach a screenshot.

jeudi, 18 janvier 2007

Art

I've killed the GNOME logo in System-Monitor's System tab to please people. I'm weak. Now it looks so empty :/

Anyway, thank you crevette, your logo was cool.

dimanche, 14 janvier 2007

tranquille

J'ai retrouvé ma tranquillité depuis que j'ai mis un filtre dans evolution pour supprimer automatiquement les mails de bugzilla provenant de bugbuddy. Je n'ai plus peur d'ouvrir mon courrier le soir quand je rentre !

mercredi, 3 janvier 2007

more bug-buddy spam

I'm back from holidays. My mailbox is full of bug-buddy spam. Again. I have killed all system-monitor bug-buddy generated bugs using bugzilla great batch interface. Nothing better than killing 20 bugs at once.

SVN

I'm re-checkouting all the gnome modules i need from devel. SVN runs just fine. I would have appreciated if the svn migration team had converted .cvsignore to svn-ignore property but that's easy to deal with. I'm using ssh ControlMaster option. It doesn't work with SVN, so needed to disable multiplexing for svn.gnome.org. It doesn't work because svn sequentially opens and closes 2/3/4 ssh connections for each command. This is quite slow on my poor high-latency DSL link. I'll look for a bug about this tomorrow. Anyway, SVN is much better than CVS :)

mercredi, 13 décembre 2006

Bugzilla fun

''What were you doing when the application crashed?
Changing clothes to get ready for work.''

For the first time, a bug makes me smile :)

dimanche, 10 décembre 2006

bugbuddy spam

Dear Bugbuddy, i would be glad if you could stop sending me half a dozen of incomplete bugs everyday. I'm not interested in bugreports without even a description and without debug symbols.

PS: if you could run the dup finder by yourself ;)

samedi, 9 décembre 2006

regex

So system-monitor cannot have regular expressions support in order to provide a decent GUI alternative to "lsof | grep". How fast is your python ?

- page 1 de 2