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

rateup crashes when kMG is set #3

Closed
danielluke opened this issue Oct 11, 2016 · 3 comments
Closed

rateup crashes when kMG is set #3

danielluke opened this issue Oct 11, 2016 · 3 comments

Comments

@danielluke
Copy link

With 2.17.4, I can reproduce a crash (SIGABRT from 'pointer being freed was not allocated') on Mac OS X 10.12.

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Application Specific Information:
abort() called
*** error for object 0x7f8899d001d0: pointer being freed was not allocated


Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib              0x00007fff90ef9dda __pthread_kill + 10
1   libsystem_pthread.dylib             0x00007fff90fe4797 pthread_kill + 90
2   libsystem_c.dylib                   0x00007fff90e5f440 abort + 129
3   libsystem_malloc.dylib              0x00007fff90f4f097 free + 530
4   rateup                              0x0000000105a1ee2d image + 13457
5   rateup                              0x0000000105a1b5f0 main + 4908
6   libdyld.dylib                       0x00007fff90dcb255 start + 1

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0000000000000000  rbx: 0x0000000000000006  rcx: 0x00007fff5a1e4a08  rdx: 0x0000000000000000
  rdi: 0x000000000000060b  rsi: 0x0000000000000006  rbp: 0x00007fff5a1e4a30  rsp: 0x00007fff5a1e4a08
   r8: 0x0000000000000000   r9: 0x0000000000000000  r10: 0x0000000008000000  r11: 0x0000000000000206
  r12: 0x00007f889a823800  r13: 0x0000000000000001  r14: 0x00007fff99ace3c0  r15: 0x0000000000000000
  rip: 0x00007fff90ef9dda  rfl: 0x0000000000000206  cr2: 0x00007fff90fe249b

Logical CPU:     0
Error Code:      0x02000148
Trap Number:     133
@oetiker
Copy link
Owner

oetiker commented Oct 12, 2016

this error is unfortunately not very distinctive ... what is especially odd, is that the kill happens within pthread whereas mrtg does not use threads ...

@danielluke
Copy link
Author

There's always (at least) one thread.

The important part is that it's abort()'ing in free() and saying "pointer being freed was not allocated". Since it stopped crashing when I comment out a config like that said "kMG[foo]: ,k,M,G" , I suspect rateup.c line 1136.

@therealbstern
Copy link
Contributor

I'm certain it's line 1136. It frees short_si, which is actually the copy of kMG that has been stomped upon during the first pass through image(). Later accesses will cause problems, the most benign of which is the units being incorrect for weekly/monthly/yearly graphs.

I'm working on a PR to address this right now.

therealbstern added a commit to therealbstern/mrtg that referenced this issue Jan 24, 2017
Commenting out lines 1135 - 1138 prevents `image()` from stomping on a shallow copy of kMG.  The stomping leads to a crash under OS X, as reported in upstream oetiker#3, and causes the units on weekly/monthly/yearly graphs to be wrong under more forgiving operating systems.
@oetiker oetiker closed this as completed Jan 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants