Skip to content
This repository has been archived by the owner on Sep 8, 2020. It is now read-only.

LinuxProcessList.c - sysmalloc: Assertion #166

Closed
nfnty opened this issue Feb 11, 2015 · 3 comments
Closed

LinuxProcessList.c - sysmalloc: Assertion #166

nfnty opened this issue Feb 11, 2015 · 3 comments

Comments

@nfnty
Copy link

nfnty commented Feb 11, 2015

Follow-up to #159

htop still crashes:

htop: malloc.c:2370: sysmalloc: Assertion `(old_top == (((mbinptr) (((char *) &((av)->bins[((1) - 1) * 2])) - __builtin_offsetof (struct malloc_chunk, fd)))) && old_size == 0) || ((unsigned long) (old_size) >= (unsigned long)((((__builtin__offsetof (struct malloc_chunk, fd_nextsize))+((2 *(sizeof(size_t))) - 1)) & ~((2 *(sizeof(size_t))) - 1))) && ((old_top)->size & 0x1) && ((unsigned long) old_end & pagemask) == 0)' failed.

Backtrace:

#0  0x0000029e8c09a4b7 in raise () from /usr/lib/libc.so.6
#1  0x0000029e8c09b88a in abort () from /usr/lib/libc.so.6
#2  0x0000029e8c0dd8a8 in __malloc_assert () from /usr/lib/libc.so.6
#3  0x0000029e8c0e0034 in _int_malloc () from /usr/lib/libc.so.6
#4  0x0000029e8c0e181e in malloc () from /usr/lib/libc.so.6
#5  0x0000029e8c0cf8bd in __fopen_internal () from /usr/lib/libc.so.6
#6  0x000000000041cddc in LinuxProcessList_readVServerData (process=0x1b7f010, dirname=0x42282a "/proc", name=0x1b75ebb "2") at linux/LinuxProcessList.c:339
#7  0x000000000041d701 in LinuxProcessList_processEntries (this=0x1ae5300, dirname=0x42282a "/proc", parent=0x0, period=895518, tv=...) at linux/LinuxProcessList.c:511
#8  0x000000000041e46d in ProcessList_scan (this=0x1ae5300) at linux/LinuxProcessList.c:714
#9  0x000000000040d66c in main (argc=1, argv=0x39149da0248) at htop.c:712
@hishamhm
Copy link
Owner

Crashing with a malloc() assertion error inside fopen() indicates that memory was corrupted before (assuming of course that there are no bugs in fopen() itself :) ). Can you run it with valgrind and see if we can catch something strange happening earlier on?

@nfnty
Copy link
Author

nfnty commented Feb 14, 2015

valgrind --log-file=htop.log --leak-check=full --show-leak-kinds=all htop

https://gist.github.com/nfnty/42c559db168168089675

@hishamhm
Copy link
Owner

That was perfect, thank you!!

hishamhm added a commit that referenced this issue Feb 20, 2015
hishamhm added a commit that referenced this issue Feb 23, 2015
Conflicts:
	Process.c
	Process.h
	ProcessList.c
	ScreenManager.c
	linux/LinuxProcessList.c
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants