You are not logged in.

#1 2009-06-09 12:35:56

jaloz
Member
Registered: 2008-11-18
Posts: 25

top and htop segfault with custom kernel

Hi folks,

When I use a kernel I built myself with realtime patches "top" and "htop" segfault immediately when I try to run them.

Could someone please enlighten me as to what the cause of this might be. I'm guessing it's got to be something I missed when configuring the kernel since everything works when I boot the regular Arch kernel.

Offline

#2 2009-06-09 14:56:44

Nezmer
Member
Registered: 2008-10-24
Posts: 559
Website

Re: top and htop segfault with custom kernel

My uninformed guess :
You didn't enable proc in your kernel .config .


English is not my native language .

Offline

#3 2009-06-11 02:06:43

jaloz
Member
Registered: 2008-11-18
Posts: 25

Re: top and htop segfault with custom kernel

Thanks for the guess but I don't think that's it.

$ mount
/dev/sdb3 on / type ext3 (rw,noatime)
none on /dev type ramfs (rw)
none on /proc type proc (rw)
none on /sys type sysfs (rw)
none on /dev/pts type devpts (rw)
none on /dev/shm type tmpfs (rw)
/dev/sdb4 on /home type ext3 (rw,noatime)
/dev/sdb1 on /boot type ext2 (rw,noatime)
none on /tmp/jack type tmpfs (rw)

and

$ zgrep PROC /proc/config.gz
CONFIG_BSD_PROCESS_ACCT=y
CONFIG_BSD_PROCESS_ACCT_V3=y
CONFIG_IKCONFIG_PROC=y
# CONFIG_ACPI_PROCFS is not set
CONFIG_ACPI_PROCFS_POWER=y
CONFIG_ACPI_PROC_EVENT=y
CONFIG_ACPI_PROCESSOR=y
CONFIG_NETFILTER_XT_MATCH_RECENT_PROC_COMPAT=y
CONFIG_NF_CONNTRACK_PROC_COMPAT=y
CONFIG_IDE_PROC_FS=y
CONFIG_SCSI_PROC_FS=y
CONFIG_I2O_PROC=m
CONFIG_SND_VERBOSE_PROCFS=y
CONFIG_RTC_INTF_PROC=y
# CONFIG_REISERFS_PROC_INFO is not set
CONFIG_PROC_FS=y
CONFIG_PROC_KCORE=y
CONFIG_PROC_SYSCTL=y
CONFIG_PROC_PAGE_MONITOR=y
# CONFIG_KEYS_DEBUG_PROC_KEYS is not set

I tried running top in gdb (which I don't really know how to use) and got this

(gdb) run
Starting program: /usr/bin/top
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)

Program terminated with signal SIGKILL, Killed.
The program no longer exists.

Not particularly useful.
Any other ideas?

Offline

#4 2009-06-11 04:12:19

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: top and htop segfault with custom kernel

jaloz wrote:
...snip...

Program terminated with signal SIGKILL, Killed.
The program no longer exists.

Not particularly useful.
Any other ideas?

After the program terminates in gdb, type 'where' at the next prompt. Sometimes you'll get useful information.

Offline

#5 2009-06-11 04:42:31

jaloz
Member
Registered: 2008-11-18
Posts: 25

Re: top and htop segfault with custom kernel

Thanks for the tip skottish but all I got was "No stack."

I just tried a few more commands from the procps package and discovered more problems. "uptime", "tload" and "w" also fail with "Killed." And here's where it gets interesting. "cat /proc/uptime" works but "cat /proc/loadavg" also results in "Killed."

Crazy wild guess - could it be that the realtime patches break something required to calculate load average?

The kernel is 2.6.29.3 with rt14.

Offline

#6 2009-06-11 04:42:36

djgera
Developer
From: Buenos Aires - Argentina
Registered: 2008-12-24
Posts: 723
Website

Re: top and htop segfault with custom kernel

Normally when a program is closed unexpected witha  SIGKILL is a kernel that trigger the OOM_Killer because uses lots of memory and he system ran in out of memory.

You see some msg related to oom in the kernel log (dmesg)?

try to run with strace.

@skottish: "where" don't help here, since there are no stack at this point of program (becuse the program is not anymore in memory, like when gdb catches a SIGSEGV) sad

Offline

#7 2009-06-11 04:48:05

djgera
Developer
From: Buenos Aires - Argentina
Registered: 2008-12-24
Posts: 723
Website

Re: top and htop segfault with custom kernel

jaloz wrote:

And here's where it gets interesting. "cat /proc/uptime" works but "cat /proc/loadavg" also results in "Killed."
.

Yes, interesting, write to the author or ML of the RT project. Sure you will get a good response. smile

Offline

#8 2009-06-11 04:57:19

jaloz
Member
Registered: 2008-11-18
Posts: 25

Re: top and htop segfault with custom kernel

I just tried "uptime" again and this was dumped in /var/log/messages

Jun 11 14:47:53 rhuidean kernel: PGD 115f1a067 PUD 115ec0067 PMD 0
Jun 11 14:47:53 rhuidean kernel: CPU 0
Jun 11 14:47:53 rhuidean kernel: Modules linked in: nf_conntrack_ftp nf_conntrack_irc ipt_REJECT ipt_LOG xt_limit xt_state xt_tcpudp nf_conntrack_ipv4 nf_conntrack nf_defrag_ipv4 ipv6 iptable_filter ip_tables x_tables ext2 nvidia(P) i2c_core ohci1394 k8temp ieee1394 usbhid hid evdev sg vboxnetflt vboxdrv fuse snd_hda_codec_nvhdmi snd_seq_dummy snd_seq_oss snd_seq_midi_event snd_seq snd_seq_device snd_hda_intel snd_hda_codec snd_pcm_oss snd_pcm snd_timer snd_page_alloc snd_mixer_oss snd soundcore forcedeth ext3 jbd mbcache sd_mod sr_mod cdrom ohci_hcd ehci_hcd usbcore ahci ata_generic pata_amd pata_acpi libata scsi_mod
Jun 11 14:47:53 rhuidean kernel: Pid: 6074, comm: uptime Tainted: P      D    2.6.29-rt #3 System Product Name
Jun 11 14:47:53 rhuidean kernel: RIP: 0010:[<ffffffff802f05ae>]  [<ffffffff802f05ae>] seq_read+0xee/0x480
Jun 11 14:47:53 rhuidean kernel: RSP: 0018:ffff88011d4a3e48  EFLAGS: 00010246
Jun 11 14:47:53 rhuidean kernel: RAX: 0000000000000000 RBX: 0000000000000083 RCX: 0000000000000001
Jun 11 14:47:53 rhuidean kernel: RDX: 0000000000000001 RSI: 0000000000001000 RDI: ffff88011c2ff01a
Jun 11 14:47:53 rhuidean kernel: RBP: ffff88011e1e7e80 R08: 0000000000000000 R09: 0000000000000004
Jun 11 14:47:53 rhuidean kernel: R10: 0000000000000000 R11: 0000000000000064 R12: ffff88011d4a3f58
Jun 11 14:47:53 rhuidean kernel: R13: 0000000000000001 R14: 00000000000007ff R15: ffff88011d4a3e80
Jun 11 14:47:53 rhuidean kernel: FS:  00007fbfb8d3a6f0(0000) GS:ffff880028055000(0000) knlGS:0000000000000000
Jun 11 14:47:53 rhuidean kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
Jun 11 14:47:53 rhuidean kernel: CR2: 000000000000009b CR3: 0000000115eb1000 CR4: 00000000000006e0
Jun 11 14:47:53 rhuidean kernel: DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
Jun 11 14:47:53 rhuidean kernel: DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Jun 11 14:47:53 rhuidean kernel: Process uptime (pid: 6074, threadinfo ffff88011d4a2000, task ffff88011e45d0c0)
Jun 11 14:47:53 rhuidean kernel: 000000000000afc0 ffff880115f20970 0000000000000000 00000000000007ff
Jun 11 14:47:53 rhuidean kernel: RSP <ffff88011d4a3e48>
Jun 11 14:47:53 rhuidean kernel: ---[ end trace 046ef4ddb8bafba2 ]---

And here's the last few lines from "strace uptime"

open("/proc/loadavg", O_RDONLY)         = 4
lseek(4, 0, SEEK_SET)                   = 0
read(4,  <unfinished ...>
+++ killed by SIGKILL +++

Offline

Board footer

Powered by FluxBB