Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 300611 - [patch] app-admin/procinfo-18-r1: segfaults with with large number of interrupts in /proc/stat
Summary: [patch] app-admin/procinfo-18-r1: segfaults with with large number of interru...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: High normal
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-11 17:56 UTC by Markus Wagner
Modified: 2010-01-20 17:04 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
segmentation-fault buffer fix (procinfo_long_intr_line.patch,455 bytes, patch)
2010-01-11 17:58 UTC, Markus Wagner
Details | Diff
fix for whitespaces in gcc specs (procinfo_braced_version.patch,517 bytes, patch)
2010-01-11 17:59 UTC, Markus Wagner
Details | Diff
optional lsdev fix1 (procinfo_lsdev_ioport_trim.patch,325 bytes, patch)
2010-01-11 17:59 UTC, Markus Wagner
Details | Diff
optional lsdev fix2 (procinfo_lsdev_shared_interrupts.patch,633 bytes, patch)
2010-01-11 18:00 UTC, Markus Wagner
Details | Diff
optinal MSI recognition (procinfo_recognise_psi_msi_edge.patch,388 bytes, patch)
2010-01-11 18:00 UTC, Markus Wagner
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Wagner 2010-01-11 17:56:53 UTC
Running procinfo at systems with latest amd64-kernels results in a segfault.


Reproducible: Always

Steps to Reproduce:
1. 'emerge procinfo' at amd64-system with kernel >=2.6.29
2. 'strace'
3.

Actual Results:  
xen3 etc # procinfo 
Segmentation fault

dmesg:
procinfo[8599]: segfault at 7fffa2ff1976 ip 0000000000404562 sp 00007fffa2fe53c0 error 4 in procinfo[400000+a000]

Expected Results:  
Linux 2.6.31-xen-r10-dom0 (root@xen3) (gcc 4.3.4 ) #2 SMP Sat Jan 9 14:18:58 CET 2010 8CPU [xen3.(none)]

Memory:      Total        Used        Free      Shared     Buffers      
Mem:      14452736    14368328       84408           0    13405516
Swap:      8388600           0     8388600

Bootup: Sun Jan 10 15:36:54 2010    Load average: 0.67 0.71 0.71 2/146 22531

user  :       0:18:10.98   0.1%  page in :801073800  disk 1:    89422r  204210w
nice  :       0:00:00.05   0.0%  page out:907288209  disk 2: 79892938r       0w
system:       3:06:07.88   1.4%  page act:347689997  disk 3:      436r       0w
IOwait:       0:51:05.99   0.3%  page dea:  3847625  disk 4:   364670r 8823640w
hw irq:       0:00:00.00   0.0%  page flt:  9632037
sw irq:       0:11:21.14   0.0%  swap in :        0
idle  :   8d 19:46:03.79  97.0%  swap out:        0  disk 4:   364670r 8823640w
uptime:   1d  3:17:23.88         context :14963529330

irq  0:         0 0          0          irq 15:         0 0          0         
irq  1:         2 0          0          irq 16:  88952309 0          0         
irq  8:         2 0          0          irq 17:        22 0          0         
irq  9:         0 0          0          irq 18:         0 0          0         
irq 12:         3 0          0          irq 19:         0 0          0         
irq 14:         0 0          0         


Seems tp be related to large numbers in /proc/interrupts (see https://bugs.launchpad.net/ubuntu/+source/procinfo/+bug/217624).

The sscanf line in procinfo-18/routines.c, 273 seems to be broken too.

I'll attach working patches here.
Comment 1 Markus Wagner 2010-01-11 17:58:34 UTC
Created attachment 216091 [details, diff]
segmentation-fault buffer fix
Comment 2 Markus Wagner 2010-01-11 17:59:14 UTC
Created attachment 216092 [details, diff]
fix for whitespaces in gcc specs
Comment 3 Markus Wagner 2010-01-11 17:59:54 UTC
Created attachment 216094 [details, diff]
optional lsdev fix1

see http://fuzzle.org/procinfo/
Comment 4 Markus Wagner 2010-01-11 18:00:15 UTC
Created attachment 216096 [details, diff]
optional lsdev fix2

see http://fuzzle.org/procinfo/
Comment 5 Markus Wagner 2010-01-11 18:00:53 UTC
Created attachment 216097 [details, diff]
optinal MSI recognition

see http://fuzzle.org/procinfo/
Comment 6 Víctor Ostorga (RETIRED) gentoo-dev 2010-01-14 20:53:34 UTC
This seems to be caused by /proc/stat exceeding 1024 characters
Where did you find the reference to http://fuzzle.org/procinfo ?
Comment 7 Markus Wagner 2010-01-15 17:14:37 UTC
found the link at https://bugs.launchpad.net/ubuntu/+source/procinfo/+bug/217624

BTW raising the size from 1024 to 2048 should still result in the seg fault at 2.6.31.
4096 is working just fine at 4 servers and 2 workstations with 2.6.31
Comment 8 Dawid Węgliński (RETIRED) gentoo-dev 2010-01-20 17:04:02 UTC
Should be fixed now.