Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

htop 2.0.1 aborting when select cpu under items "Use CPUs" #493

Closed
FrankYu opened this issue May 11, 2016 · 9 comments

Comments

Projects
None yet
4 participants
@FrankYu
Copy link

commented May 11, 2016

version:

rpm -qa|grep htop

htop-2.0.1-1.fc24.x86_64

Steps:

  1. run htop
  2. type a
  3. select one cpu in "Use CPUs" area, enter "enter"
  4. htop abort

htop 2.0.1 aborting. Please report bug at http://hisham.hm/htop

Please include in your report the following backtrace:
htop(CRT_handleSIGSEGV+0x33)[0x55aed61e8fd3]
/lib64/libc.so.6(+0x36180)[0x7f38ae2d9180]
htop(Affinity_set+0x2b)[0x55aed61e2cfb]
htop(MainPanel_foreachProcess+0xb0)[0x55aed61d8e50]
htop(+0x19725)[0x55aed61e4725]
htop(+0xdc61)[0x55aed61d8c61]
htop(ScreenManager_run+0x25d)[0x55aed61df64d]
htop(main+0x4e2)[0x55aed61d65b2]
/lib64/libc.so.6(__libc_start_main+0xf1)[0x7f38ae2c3721]
htop(_start+0x29)[0x55aed61d6729]

@marcin-github

This comment has been minimized.

Copy link

commented May 17, 2016

The same on Gentoo but this happens only when I compile htop using gcc with hardened patches. After a little investigation it looks that problem is when PIE profile (specs) is used in gcc.

@hishamhm

This comment has been minimized.

Copy link
Owner

commented May 19, 2016

@marcin-github can you check if it still happens with the latest code from github? Thank you!

@marcin-github

This comment has been minimized.

Copy link

commented May 20, 2016

I'm at 645057d , got:
./htop

htop 2.0.1 aborting. Please report bug at http://hisham.hm/htop

Please include in your report the following backtrace:
./htop(CRT_handleSIGSEGV+0x61)[0x416b78cc51]
/lib64/libc.so.6(+0x34450)[0x3ac845c2450]
./htop(Affinity_set+0x3b)[0x416b785b7b]
./htop(MainPanel_foreachProcess+0xd7)[0x416b779087]
./htop(+0x1dd14)[0x416b787d14]
./htop(+0xee67)[0x416b778e67]
./htop(ScreenManager_run+0x208)[0x416b781788]
./htop(main+0x4e6)[0x416b775d76]
/lib64/libc.so.6(__libc_start_main+0x114)[0x3ac845ae734]
./htop(_start+0x29)[0x416b775f19]

Do you need objdump?

@hishamhm

This comment has been minimized.

Copy link
Owner

commented May 20, 2016

@marcin-github I was unable to reproduce this here... Could you rebuild htop with make debug, generate a core dump (run ulimit -c unlimited to ensure the core file is generated) and then run gdb ./htop core (on some distros the core file has other names than core) and produce a detailed backtrace with the bt command? Thank you in advance!

(I hope the instructions are okay, let me know if you have any questions!)

@marcin-github

This comment has been minimized.

Copy link

commented May 21, 2016

You have to compile and link with PIE (and probably with -pic) flag.

Core was generated by `./htop'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x0000005367e47acf in Affinity_set (proc=0x53697be5e0, this=0x69794a30) at Affinity.c:109
109 for (int i = 0; i < this->used; i++) {
(gdb) bt
#0 0x0000005367e47acf in Affinity_set (proc=0x53697be5e0, this=0x69794a30) at Affinity.c:109
#1 0x0000005367e353a0 in MainPanel_foreachProcess (this=0x5369789850, fn=0x5367e479fc <Affinity_set>, arg=1769556528, wasAnyTagged=0x0) at MainPanel.c:178
#2 0x0000005367e495af in actionSetAffinity (st=0x3fb369c4790) at Action.c:287
#3 0x0000005367e34fc5 in MainPanel_eventHandler (super=0x5369789850, ch=97) at MainPanel.c:98
#4 0x0000005367e41793 in ScreenManager_run (this=0x536978dcc0, lastFocus=0x0, lastKey=0x0) at ScreenManager.c:256
#5 0x0000005367e380e6 in main (argc=1, argv=0x3fb369c48b8) at htop.c:231
(gdb) bt full
#0 0x0000005367e47acf in Affinity_set (proc=0x53697be5e0, this=0x69794a30) at Affinity.c:109
i = 0
cpuset = {__bits = {0 <repeats 16 times>}}
ok = 103
#1 0x0000005367e353a0 in MainPanel_foreachProcess (this=0x5369789850, fn=0x5367e479fc <Affinity_set>, arg=1769556528, wasAnyTagged=0x0) at MainPanel.c:178
p = 0x53697be5e0
super = 0x5369789850
ok = true
anyTagged = false
#2 0x0000005367e495af in actionSetAffinity (st=0x3fb369c4790) at Action.c:287
affinity = 0x5369794a30
ok = false
panel = 0x5369789850
p = 0x53697be5e0
affinity = 0x53696a97c0
affinityPanel = 0x536978f8c0
set = 0x5369792660
#3 0x0000005367e34fc5 in MainPanel_eventHandler (super=0x5369789850, ch=97) at MainPanel.c:98
this = 0x5369789850
result = IGNORED
reaction = HTOP_OK
#4 0x0000005367e41793 in ScreenManager_run (this=0x536978dcc0, lastFocus=0x0, lastKey=0x0) at ScreenManager.c:256
prevCh = 259
result = IGNORED
quit = false
focus = 0
panelFocus = 0x5369789850
oldTime = 14638215313.27001
ch = 97
closeTimeout = 0
timedOut = false
redraw = true
rescan = false
sortTimeout = 5
resetSortTimeout = 5
#5 0x0000005367e380e6 in main (argc=1, argv=0x3fb369c48b8) at htop.c:231
lc_ctype = 0x0
flags = {pidWhiteList = 0x0, userId = 4294967295, sortKey = 0, delay = -1, useColors = true}
ut = 0x53696a74a0
pl = 0x53696a7590
settings = 0x53696a7fd0
header = 0x53696a91c0
panel = 0x5369789850
state = {settings = 0x53696a7fd0, ut = 0x53696a74a0, pl = 0x53696a7590, panel = 0x5369789850, header = 0x53696a91c0}
scr = 0x536978dcc0

@rootbert

This comment has been minimized.

Copy link

commented May 25, 2016

same here with Ubuntu 16.04 amd64 with htop from the repositories (2.0.1-1).
"""
htop 2.0.1 aborting. Please report bug at http://hisham.hm/htop

Please include in your report the following backtrace:
htop(CRT_handleSIGSEGV+0x33)[0x564b4bc3fef3]
/lib/x86_64-linux-gnu/libc.so.6(+0x354a0)[0x7f895a32c4a0]
htop(Affinity_set+0x2b)[0x564b4bc39bbb]
htop(MainPanel_foreachProcess+0xa8)[0x564b4bc2fe98]
htop(+0x195a5)[0x564b4bc3b5a5]
htop(+0xdd0f)[0x564b4bc2fd0f]
htop(ScreenManager_run+0x1dd)[0x564b4bc3645d]
htop(main+0x4f4)[0x564b4bc2d624]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f895a317830]
htop(_start+0x29)[0x564b4bc2d799]

Additionally, in order to make the above backtrace useful,
please also run the following command to generate a disassembly of your binary:

objdump -d which htop > ~/htop.objdump

and then attach the file ~/htop.objdump to your bug report.

Thank you for helping to improve htop!

Aborted (core dumped)
"""
attached the objdump:
htop.obj.zip

@hishamhm

This comment has been minimized.

Copy link
Owner

commented May 25, 2016

Ahhh!!! I see it now! Thank you @marcin-github for the backtrace!

I just commited a fix. Please confirm if it works, thank you!

@marcin-github

This comment has been minimized.

Copy link

commented May 25, 2016

Great, I can't reproduce problem now!
Dzięki.

@hishamhm

This comment has been minimized.

Copy link
Owner

commented May 26, 2016

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.