Search Results: "snd"

21 January 2007

Daniel Burrows: How to Breathe, Functionally (part 1)

David Welton writes that the problem with functional languages is that you don't get to mentally "catch your breath" between computations; piling function invocations on function invocations makes it hard to understand what's actually being calculated. He has an amusing summary of how functional code can become unreadable:


Do this with the result of this with what this produces when given this input that is derived from this function which takes the result of this other thing after calculating the result of something that is derived from the output of a function that ...


Indeed, I've seen functional code like this (much of it written by myself). Here's a particular gem:


f splitPoints = map fst $ tail $ scanl (flip ($) . snd) ([], toSplit) $
map splitAt splitPoints


I wrote this code a year ago, and I don't know what it does! It's hard to read and hard to understand. So, however, is imperative code that says


Add 5 to A, now if B is not zero we jump to where we subtract one from B and if C is less than 3 we add 4 to C otherwise we divide C by 2 and then add it to A, then we ...


The reason both pieces of pseudocode are hard to understand is that they don't use the abstraction features built into the language. Good imperative code uses meaningful variable names, uses the structured-programming primitives the language provides, and abstracts complex operations into functions.

My rule of thumb (which is, heh, not always religiously followed) is that a piece of program structure that does more than about 3-6 things is probably too complicated; it seems like that's about as much local context as I can hold in my head comfortably (and the number is more 3 than 6 these days, if you get my drift). As David puts it,


If you'll bear with a poor comparison, sometimes programming is like a song. You do the tricky section, then you go back to an easier section and catch your breath for a bit.


The problem seems to be that people trained on imperative languages, when they're tossed into the ocean of functional coding, can't find the guideposts and landmarks that would help them impose some structure on the water. Should I put this complicated expression inside a "let", or break it out into another function? When do I use a higher-order function to unify two dissimilar pieces of code? Should I write this code in terms of higher-order library functions or directly? It's easy to wander off down a chain of nested invocations of anonymous higher-order functions, or composed partially applied library functions, just "because you can" and end up forgetting what you were trying to do in the first place.

Luckily, some of the basic rules of keeping your code readable remain more or less the same: assign intermediate results to variables with meaningful names, and abstract complicated operations into separate functions. To tackle David's example:


You get sections with DoThisAndThisAndThatWithTheResultsOfSelectThisFromTableXYZ that you have to slow down to think through.

...

GoToTheNextTrickyBit where ManyThingsHappen.

All in all, you wind up with a sort of ebb and flow that works out pretty well if you're in tune with the code being written, going from intense calculations, to a line or two where you do no more than store things in a variable, take a breather, and prepare for the next important stanza.


The way to "take a breath" in a functional language is generally to assign an intermediate result to a variable, or to extract a complicated operation into a function and give it a meaningful name. One Haskell approximation to David's example is


do DoThis
AndThis
results - SelectThisFromTableXYZ
someVal - AndThat results
GoToTheNextTrickyBit someval


If you're writing pure functional code, you might write


let
results = SelectThisFromTableXYZ
someVal = AndThat results
in
GoToTheNextTrickyBit someVal


Of course, this will become unreadable if you write a huge complicated nested "let" expression in place of "AndThat". For a truly dreadful example of this kind of coding, check out the Gnucash Scheme code that generates the "Cash Flow" report (warning: read this in short bursts, or you WILL go blind). This is exactly analogous to writing too many nested loops and conditionals in imperative code, and the fix is the same: find logically distinct bits of code and extract them into separate functions.

I have a few more thoughts, but this post is getting too long, so I'll inflict them on the world in another post. The rule that short things are easier to understand applies to blog posts as well as code. :-)

21 December 2006

Enrico Zini: etch-on-asus-U5F

Debian Etch on Asus U5F Model Asus U5F, with Intel Core 2 Duo T5500 Distribution Debian Etch amd64. Summary Video: works, with 3D and everything. Audio: works, with a little config change. Wireless LAN: works, with drivers from non-free. Bluetooth: works. Ethernet: works. SD card reader: works. DVD reader/burner: works. ACPI features: various problems. Suspend: broken. Installation and wireless card To have the wireless card working you need some package from non-free that is not provided with the standard installer. I installed using the binary 1 CD, then I fetched the following packages from unstable:
firmware-ipw3945_0.3_all.deb
ipw3945d_1.7.22-2_amd64.deb
ipw3945-modules-2.6.18-3-amd64_2.6.18+1.1.2-2_amd64.deb
linux-headers-2.6.18-3_2.6.18-8_amd64.deb
linux-image-2.6.18-3-amd64_2.6.18-8_amd64.deb
Once those packages are installed, wireless just works. Video Intel 945GM/GMS/940GML It just works, with 3D and everything. To turn on AIGLX and Compiz, just follow the HOWTO in the Debian wiki. Audio Intel 82801G To make it work add:
options snd-hda-intel model=laptop-eapd
to /etc/modprobe.d/alsa-base. Rationale: this link gives the quick solution. Note: no need to reboot:
/etc/init.d/alsa unload
modprobe snd-hda-intel
The list of models available for the driver is in /usr/share/doc/alsa-base/driver/ALSA-Configuration.txt.gz A hint about the model to use can be found at the beginning of /proc/asound/card0/codec#0. CPU speed scaling Just modprobe speedstep-centrino. Then the cpufreq_ondemand module works fine. I'm a bit disappointed that it doesn't want to go below 996Mhz (60%) and it has only 3 scaling modes: 1.66 GHz, 1.33 GHz, 996 MHz. It used to display available scaling modes weirdly (it would repeat 1.66Ghz 6 times), then I updated the BIOS to version 304 and now it shows just those 3. The laptop tends to get warm, this disappoints me. I hope things will improve with newer kernels. USB Just works. SD card reader Just works. I put an SD card in and it gets mounted automatically. In the old Asus M2 the card reader was just some unsupported obscure thing. Ethernet RTL8111/8168B Gigabit Ethernet. I'm not sure it was working in the installer, but in the installed system it works out of the box. Very pleasant thing: it can cross the cable if needed. DVD reader/writer Just works. I haven't tried burning CDs or DVDs, but k3b sees it and correctly detects the writing speed. Bluetooth Just works. I connected to the bluetooth GPS just fine. ACPI Still quirky. Brightness control buttons don't work: before updating the BIOS I would get this reaction on syslog:
Dec 17 23:57:35 viaza kernel: ACPI Error (psparse-0537): Method parse/execution failed [\_SB_.PCI0.SBRG.EC0_._Q0E] (Node ffff81003e98bd90), AE_NOT_FOUND
Dec 17 23:57:35 viaza kernel: ACPI Error (psargs-0355): [\_SB_.PCI0.P0P2.VGA_.LCDD] Namespace lookup failure, AE_NOT_FOUND
After updating the BIOS I get this reaction instead:
Dec 21 21:17:38 viaza kernel: video device notify
Dec 21 21:17:38 viaza kernel: set_level status: 0
Dec 21 21:17:38 viaza kernel: compiz.real[4013]: segfault at 0000000000000060 rip 000000000040b3b0 rsp 00007fff6c47f4e0 error 4
compiz segfaults and I'm back to gdm, with the brightness unchanged. The LCD on/off button works. Controlling the LCD via software does not work:
# echo 1 > /proc/acpi/asus/lcd
Dec 21 22:22:45 viaza kernel: Asus ACPI: Error switching LCD
# cat /proc/acpi/asus/lcd
Dec 21 22:22:49 viaza kernel: Asus ACPI: Error reading LCD status
0
In fact, asus-acpi complains:
Dec 21 17:08:29 viaza kernel: Asus Laptop ACPI Extras version 0.30
Dec 21 17:08:29 viaza kernel:   unsupported model U5F, trying default values
Dec 21 17:08:29 viaza kernel:   send /proc/acpi/dsdt to the developers
Therefore, I sent the dsdt to the developers. The wireless on/off button turns on and off the wlan and bluetooth leds, and apparently also the wireless hardware. I still don't know how to turn off bluetooth and leave wlan on. Suspend Suspend to ram works, but on resume it does not turn on the LCD display. The LCD on/off button has no effect. Other things work fine, so I can blind-type a shutdown command. I have vbetool installed, but it doesn't seem to help. So far, suspend is still not usable. Modem Not tried.

9 October 2006

Martin-Éric Racine: ALSA pitfalls ... and a bounty ... or two

Daniel Jacobowitz writes about problems he's having getting proper ALSA support for his desktop computer. Boy, does that sound familiar! I myself have three computers that are partially or totally unsupported on ALSA:
  • Apple iMac rev.D a.k.a. 333MHz G3 tray-loading iMac. Partially supported by snd-powermac, except that some controls are inverted and other controls just plain don't work. Probably something as simple as the wrong offset in the bitmap used to select the control on which to act. Bug filed in the ALSA BTS. No reaction. Anyhow, sound support for Apple products is being migrated to snd-aop, which was written from scratch using a modular architecture that enables easily adding support for new sound chips. Nice idea, except that no effort is being put towards supporting pre-G4 products... Back when Ubuntu appeared on the Linux scene, Mark Shuttleworth agreed to pay a 500$ bounty to whoever made ALSA work on all PowerMac variants. Nobody took it, as far as I know. Those who are interested in taking on this challenge might wanna check my wiki page for our summary of the ALSA PowerMac situation.
  • HP 9000 series model 712. Recently supported, thanks to someone on the PA-RISC Linux mailing list having a go at coding it. Never merged by upstream ALSA, though. It's been a while since I gave it a try but, last time, only output worked.
  • AMD Geode SCx200. There is no snd-scx200 driver at all. Bug filed in the ALSA BTS. The issue of sound support on early Geode products was also mentioned on the Linux kernel mailing list, during the big OSS cleanup discussion so, at least, some people are aware of the issue. It so happens that the Geode SC is used in a number of popular embedded boards, such as the Soekris and yet, nobody tried porting the old OSS drivers available on AMD's Geode driver source page. Odd.
As we can see, there's plenty of ALSA support remaining to be coded, ported or cleaned up, and some people are willing to pay for the results. Who's gonna grab it?

10 August 2006

Erich Schubert: Going AMD64

Up to now, my dad was using my old desktop PC, a celeron 412 MHz (366 overclocked) with Linux. Unfortunately, this trusty companion started to freeze within a few minutes after boot (even in BIOS). So after some 7 years, a replacement was needed. The guys at the computer shop (Computer Gallerie in munich) tried to convince me that nvidia is best for Linux. Basically I followed this recommendation because ATI isn't better, and there are not Intel-based onboard graphics for AMD. And AMD Sempron sounded like the cheapest CPU. And definitely cheaper than an Intel Core... But dudes: Nvidia is NOT included in the kernel. Trust me on that one. Nvidia is non-free, and their drivers most likely violate the GPL. So I ended up buying an ASRock 939NF4G-VSTA mainboard and an AMD Sempron CPU. 1 GB of RAM, an HDD, an okay housing. Just below 400 Euro, that is what I had expected. After some fighting with the hardware (the HDD didn't fit into its slot, I had to bend away some metal. No docs on which way to put the power LED plug on etc.), I was finally able to boot the system. I used todays daily-build of the netinstall CD image for AMD64. I.e. the to-be etch installer. Worked like a charm. After some downloading over my 2 mbit DSL line the system was up and running. Graphics were VESA, as expected. With some fighting with the annoying non-free Nvidia drivers, I had them working, too. Ethernet worked out of the box; I don't know about S-ATA (a driver is loaded though), temperature sensors seem to work, too. Sound doesn't work yet. The snd_hda_intel driver is loaded, however there is no sound to be heard on any of the 7.1 channels. The mixer only shows "Master" and "Capture" volume controls. If anyone knows how to get sound out of a
00:10.1 Audio device: nVidia Corporation MCP51 High Definition Audio (rev a2)
Subsystem: ASRock Incorporation Unknown device 0888
device, I'd welcome any hints. Kernel is 2.6.17-1-amd64-k8. Maybe I just have to get a newer Alsa with some hardware information on this device? [Update: this is a realtek ALC 888, there is a patch for this to come in 2.6.18...] Anyway, I now have a AMD64 box, and as soon as I've setup some i386 chroot I'll have a useable build-box after all. ;-) And maybe I can do some SELinux testing on it, too. OTOH, I should get myself a diploma thesis topic now, and work on my final thesis.

9 August 2006

Ross Burton: ALSA Woes

Has anyone seen this, and know a solution, for ALSA on a ThinkPad X60:
$ esd
ALSA lib pcm_direct.c:786:(snd_pcm_direct_initialize_slave) snd_pcm_hw_params_any failed
ALSA lib pcm_dmix.c:831:(snd_pcm_dmix_open) unable to initialize slave
The sound card is a standard Intel chipset:
0000:00:1b.0 0403: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 02)

5 August 2006

Matt Brown: Working sound on an HP dc7600

Back in April I mentioned the fun and games I had trying to get a nice dual-DVI setup working with my new HP dc7600. The other problem that I’ve been experiencing since then is a complete inability to play any audio. The machine has an Intel ICH7 High Definition audio chipset onboard which is theoretically supported fine by the snd-hda-intel kernel module, and indeed everything loads fine and shows up in /proc correctly. However nothing ever comes out the speakers! lspci output below
0000:00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 01)
Subsystem: Hewlett-Packard Company: Unknown device 3010
Flags: bus master, fast devsel, latency 0, IRQ 21
Memory at e0a00000 (64-bit, non-prefetchable) [size=16K]
Capabilities:
Today I sat down and tried to work out what was going on, it turns out the Realtek ALC260 chipset that is used on this motherboard supports quite a few different pinouts, so while snd-hda-intel knows how to drive it you don’t actually get any sound unless you have the correct mapping setup! The driver attempts to do this automatically for a number of different motherboards and there is a entry in the table for my particular motherboard (Subsystem 0×3010) mapping it to the ALC260_HP patching, but still nothing works! Eventually I stumbled across ALSA Bug #2157 which fixes an identical problem for a different motherboard (Subsystem 0×3012) by using the ALC260_HP_3013 mapping in the driver. So, taking a guess, I made the same change for the 0×3010 mapping, rebooted, and voila, I have sound. Patch below:
--- sound/pci/hda/patch_realtek.c.orig 2006-08-05 21:13:49.000000000 +1200
+++ sound/pci/hda/patch_realtek.c 2006-08-05 20:33:17.000000000 +1200
@@ -2951,7 +2951,7 @@
.pci_subvendor = 0x152d, .pci_subdevice = 0x0729,
.config = ALC260_BASIC , /* CTL Travel Master U553W */
.modelname = "hp", .config = ALC260_HP ,
- .pci_subvendor = 0x103c, .pci_subdevice = 0x3010, .config = ALC260_HP ,
+ .pci_subvendor = 0x103c, .pci_subdevice = 0x3010, .config = ALC260_HP_3013 ,
.pci_subvendor = 0x103c, .pci_subdevice = 0x3011, .config = ALC260_HP ,
.pci_subvendor = 0x103c, .pci_subdevice = 0x3012, .config = ALC260_HP ,
.pci_subvendor = 0x103c, .pci_subdevice = 0x3013, .config = ALC260_HP_3013 ,

4 June 2006

Enrico Zini: Dapper on XEN (part 1/1, unfinished)

I need to do some work on a Dapper system, so it's time to try out xen:
apt-get install linux-image-2.6-xen-686 xen-hypervisor-3.0-i386 xen-utils-3.0 xen-tools
xen-tools tries to recommend xen, which is old and has been requested to be removed from the archive. The recommends needs to be ignored, which is not that trivial to do with aptitude. The linux-image doesn't happen to have an initrd. The bug has already been reported. One can recreate one using:
mkinitrd -o/boot/initrd-2.6.16-2-xen-686.img  2.6.16-2-xen-686
Then one adds this to /boot/grub/menu.lst:
title Xen
root (hd0,0)
kernel /boot/xen-3.0-i386.gz
module /boot/vmlinuz-2.6.16-2-xen-686 root=/dev/hda1
module /boot/initrd.img-2.6.16-2-xen-smp
And it boots lovely:
# xm list
Name                              ID Mem(MiB) VCPUs State  Time(s)
Domain-0                           0      939     2 r-----  4677.9
Now xen-tools provides xen-create-image. I'll try to create the Dapper image (deboostrap in my system has already been changed to be able to install dapper):
xen-create-image --size=4G --swap=128M --dhcp --volume=marvin \
                 --hostname=cavazza --dist=dapper --fs=xfs
But I get:
[...]
Creating swapfile : /dev/marvin/cavazza-swap
Done
Creating disk image: /dev/marvin/cavazza-root
Done
Creating xfs filesystem
Done
Installing the base system.   This will take a while!
Copying files from host to image.
Finished
Something went wrong with the debootstrap installation
Aborting
I love detailed error messages. This one is not. So I'll have to do by hand. The documentation says:
Before you can start an additional domain, you must create a configuration file. We provide two example files which you can use as a starting point:
  • /etc/xen/xmexample1 is a simple template configuration file for describing a single VM.
  • /etc/xen/xmexample2 file is a template description that is intended to be reused for multiple virtual machines. Setting the value of the vmid variable on the xm command line fills in parts of this template.
But in Debian there's no trace of the two example files. I've reported to Guido Trotter. Then I googled for the two files and found them. Now, on to adapt Dapper to run under Xen. The good Ubuntu wiki has an HOWTO which crudely makes you install the Tarballed Pre-built installations of Xen 3.0. It's sad that xen-enabled kernels didn't make it into Dapper roper. I can make this:
kernel = "/boot/vmlinuz-xen-domu"
memory = 128
name = "Dapper"
disk = [ 'phy:marvin/dapper,hda1,w' ]
dhcp="dhcp"
root = "/dev/hda1 ro"
I used the pre-built kernel as a domU, but:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(3,1)
Sigh. I'll try with the Debian Xen-enabled kernels. Installing yaird and linux-image-2.6.16-2-xen-686_2.6.16-14_i386.deb and linux-modules-2.6.16-2-xen-686. It WORKS! Now, that's not Dapper: that's a debootstrap install of it. No user, no root password, no desktop, no shiny Ubuntu custom config. How to finish the installation? No idea. In the past, I could run base-config, but now it doesn't exist anymore. It seems that the best bet is not to use debootstrap, but to install the CD in the LVM partition using QEMU and then chroot into it and then install the debian xen kernel to boot it. A QEMU install will take ages, and I expect some trouble, like getting partman to see LVM. Maybe I better install on a disk image file and then use tar and netcat to bring the ubuntu installation out of the disk image and into the LVM image. For today, I didn't make it. This job slips another day. Frustration. I hope that at least this description of my efforts so far can be helpful to someone trying similar things. One suggestion I got was to boot the Dapper CD and install from there. I can't: this computer has no bootable CD. Update: I found out http://xensource.com/summerofcode.html and it says:
Project Idea 3: Xen Desktop Outside of Domain 0 This project would deliver a Xen desktop to the user of a client system that presents an abstraction of a virtual desktop to the user in which multiple guests share the virtual desktop, each with a subset of the desktop resources (pixels, etc). Smart management of the sound drivers would allow mixing of sound from multiple guests to the single device used for output. Microphone input could be broadcast to all guests. Technologies such as ALSA already emulate playback settings by downsampling for the hardware etc. so its not hard to imagine a xen-snd-front device munging the data to a common format used for the internal sound card. Issues: synchronization of playback.
So, what I'm trying to do has been proposed as a SoC project and (I guess) is something that can't be done overnight. Although I was planning to run a diskless gdm accessed with XDMCMP from domain0's X server, and to just hand out the audio card to the domU using pciback, so my task would have been easier. Thus I give up using Xen for this one. I'll work around the lack-of-bootable-cd limitation of this computer by installing Ubuntu using QEMU. Which I found out requires using the "Alternate install" CD. The desktop install CD is a live CD installing with Ubuntu Expresso, and the live CD doesn't seem to work in QEMU. Or, I'll install in a LVM partition in the laptop and then move it around using the network. This one's probably faster. Could this experience be an interesting use case for Edgy Eft?

2 June 2006

Uwe Hermann: OS Install Experiences - Part 3: PC-BSD [Update]


Note: This article is part of my OS Install Experiences series.
I'll continue with the recently released operating system PC-BSD 1.1, which is based on FreeBSD 6.1. This is actually the first time I installed a BSD-like OS, so I thought it would be a bit of a hassle. But I was surprised to find that the install was really pretty easy (which is a major goal of PC-BSD, as I understand it). I didn't even read a manual or installation instructions or anything... Install
  1. First, I downloaded a PC-BSD 1.1 CD #1 image, burned it on a CD, and booted from that.
  2. The first installer screen is text-based (later it's graphical), and allows you to choose between a normal install ("boot FreeBSD"), install "with ACPI", "safe mode", "single user mode", and "with verbose logging". You can also "escape to loader prompt", or "reboot".
  3. While the installer runs, it merely shows a nice desktop background, pressing any key shows you the boot messages.
  4. After a while you can select a screen resolution for the graphical installer, run fdisk, escape into an "emergency shell", chroot into the root partition, or reboot. Default is to start the installation at a pre-selected screen resolution.
  5. You can choose the language and keyboard layout. Although you can click "back" to return to previous steps in the installer, you can not go back to the language/keyboard selection later!
  6. Partitioning. First, you can choose on which disk to install, then choose the partition to use. The list only shows the primary partitions and an "extended DOS" partition. Device names for disks are a bit different in BSD world. /dev/ad0 (counting starts at 0) is the first disk, /dev/ad0s1 (counting starts at 1) the first "partition" (called "slice" in BSD). It doesn't seem to be possible to install PC-BSD on an extended partition (please correct me if I'm wrong), so I installed it on /dev/hda2 (/dev/ad0s2 in BSD-speak), which is a primary partition. To make things more complex and confusing, a BSD slice can contain multiple "partitions" (not the same as Linux partitions!). I now have /dev/ad0s2a, which is the boot partition, and /dev/ad0s2b, the swap partition. Confused? Me too.
  7. Note that changes made to the partition table seem to be effective immediately, there's no way to go back without losing data! Debian's installer is better at this. The default PC-BSD file system is UFS, btw.
  8. The hardware will be automatically detected (worked quite well for me).
  9. You can now choose to either install the BSD bootloader in the MBR, or install no bootloader at all. Not sure what the best thing for me is here, but I decided to install the BSD bootloader (overwriting GRUB). I might have to re-install GRUB (and tell it about PC-BSD) if the BSD bootloader cannot boot the other (Linux) OSes.
  10. Now I must enter the root password, and I can also create another user. I noticed that passwords can only contain alpha-numeric characters (no %$ ,.#+!? and so on). WTF? They can't be serious... Also, you must enter a real name for the normal user, it won't let you continue until you type something... Pretty annoying. There's a checkbox called "Auto-Login User?" which is enabled by default, but I didn't find out what exactly that does...
  11. The network is successfully auto-configured via DHCP. I was not asked for a hostname, but typed hostname after the install and I got PCBSD.localhost.
  12. Reboot. The CD is not ejected automatically, you have to remove it manually before booting up.
  13. I'm asked to insert CD 2 (language packs), which I don't have (or want), as I only burned CD 1. Clicking "abort" does the trick, and I can continue with English as the default language.
  14. Finally, I'm dropped into a KDE session, and that's it.
Security That's it. Comments, suggestions, flames? Update 2006-06-02: Added IPv6 netstat/sockstat output.

27 April 2006

Steve Kemp: All my people

udev? I upgraded my machine last night and it decided it didn’t like the look of hotplug anymore installing udev instead. Fine. I can be brave. Rebooting and hoping for the best all seemed well. Until I noticed that /dev/dsp wasn’t recreated. My working system had the following modules loaded:
i810_audio             31028  0
ac97_codec             17004  1 i810_audio
soundcore               8672  2 snd,i810_audio
The system has an SIS audio system:
0000:00:02.7 Multimedia audio controller: Silicon Integrated Systems [SiS] Sound Controller (rev a0)
So how do I persuade udev to use this? Right now I have no /dev/dsp device. If I manually install some modules I can make the dsp device appear - but surely I shouldn’t have to do that?
root@itchy:~# ls /dev/dsp
ls: /dev/dsp: No such file or directory
root@itchy:~# modprobe  snd_intel8x0  snd_pcm
root@itchy:~# modprobe snd_pcm_oss
root@itchy:~# modprobe snd_intel8x0
root@itchy:~# ls /dev/dsp
/dev/dsp
root@itchy:~# ls /dev/dsp -l
crw-rw---- 1 root audio 14, 3 Apr 27 10:26 /dev/dsp
(Obviously if this is what I’m supposed to do I can add the module names to /etc/modules - it just seems strange to me!)

7 January 2006

Martin F. Krafft: Unstable Linux

One thing I will never understand about this Linux hype are the operating system's miserable failures in the wake of hardware problems. Coming home from dinner, I find this all over my consoles:
Message from syslogd@piper at Sat Jan  7 22:53:35 2006 ...
piper kernel: Oops: 0002 [18] 
Message from syslogd@piper at Sat Jan  7 22:53:35 2006 ...
piper kernel: CR2: 0000004000000004
Since then, I cannot start new processes anymore (though apache2 and old processes work just fine), which means I cannot SSH into the box (which is far away from where I am right now), and thus it's become useless. The problem could be anything: corrupt memory, a broken CPU, a harddrive with bad blocks in the swap area, etc... since Linux obviously seems to be able to wall in response to a problem, I would only wish it wouldn't pout as a consequence but handle the event more gracefully. If only I had the time and energy to finally wave goodbye and choose NetBSD... Update: I managed to get a dmesg output:
<1>Unable to handle kernel paging request at 0000004000000004 RIP: 
<ffffffff80152c54> find_get_pages+36 
PGD 72cee067 PUD 0 
Oops: 0002 [18] 
CPU 0 
Modules linked in: rfcomm l2cap ipv6 af_packet ipt_REJECT ipt_state
iptable_filter iptable_nat ip_conntrack ip_tables deflate zlib_deflate
twofish serpent aes blowfish des sha256 sha1 md5 crypto_null af_key usbhid
hci_usb bluetooth raid5 xor dm_mod sbp2 ide_generic ide_cd eth1394
snd_seq_dummy snd_seq_oss snd_seq_midi snd_seq_midi_event snd_seq
snd_via82xx gameport snd_ac97_codec snd_pcm_oss snd_mixer_oss snd_pcm
snd_timer snd_page_alloc snd_mpu401_uart snd_rawmidi snd_seq_device snd
i2c_viapro soundcore i2c_core ehci_hcd via82cxxx ohci1394 shpchp pci_hotplug
sk98lin uhci_hcd ide_core ieee1394 rtc parport_pc parport floppy psmouse
pcspkr serio_raw evdev xfs exportfs sr_mod cdrom sd_mod sata_via
sata_promise libata sg scsi_mod raid1 md unix fbcon tileblit font bitblit
vesafb cfbcopyarea cfbimgblt cfbfillrect softcursor
Pid: 136, comm: kswapd0 Not tainted 2.6.12-1-amd64-k8
RIP: 0010:[<ffffffff80152c54>] <ffffffff80152c54> find_get_pages+36 
RSP: 0018:ffff81007f90dcc8  EFLAGS: 00010002
RAX: 0000004000000000 RBX: ffff81007f90dd08 RCX: ffff81007f90dd10
RDX: 0000000000000001 RSI: 0000000000000002 RDI: ffff81000289f678
RBP: 0000000000000000 R08: 0000000000000000 R09: ffff81007113f670
R10: 0000000000000040 R11: 0000000000000000 R12: ffff8100705e54e0
R13: 000000000000007a R14: ffffffffffffffff R15: ffff8100705e55f8
FS:  00002aaaab730d70(0000) GS:ffffffff8040f940(0000) knlGS:0000000000000000
CS:  0010 DS: 0018 ES: 0018 CR0: 000000008005003b
CR2: 0000004000000004 CR3: 0000000072925000 CR4: 00000000000006e0
Process kswapd0 (pid: 136, threadinfo ffff81007f90c000, task ffff81007f906760)
Stack: ffff81007f90dcf8 ffffffff8015bca7 ffff8100705e54f0 ffffffff8015c905 
       ffff810001172200 0000000000000000 0000000000000000 0000000000000000 
       ffff81000289f678 0000004000000000 
Call Trace:<ffffffff8015bca7> pagevec_lookup+23 
           <ffffffff8015c905> invalidate_mapping_pages+245 
           <ffffffff8018a403> shrink_icache_memory+259 
           <ffffffff8012d144> recalc_task_prio+324 
           <ffffffff8015ca01> shrink_slab+193 
           <ffffffff8015dcaf> balance_pgdat+623 
           <ffffffff8015df37> kswapd+295 
           <ffffffff80144e00> autoremove_wake_function+0 
           <ffffffff8010f0f7> child_rip+8  <ffffffff8015de10> kswapd+0 
           <ffffffff8010f0ef> child_rip+0  
Code: ff 40 04 ff c2 48 83 c1 08 39 d6 75 f0 fb 5b 89 f0 c3 66 66 
RIP <ffffffff80152c54> find_get_pages+36  RSP <ffff81007f90dcc8>
CR2: 0000004000000004
Now, how does a mere mortal diagnose this? This was the third in a series of oopses, the others occurred in a find process... the machine runs a software RAID5, so it really could be anything, right?

Next.

Previous.