Commit Graph

53608 Commits

Author SHA1 Message Date
Michael Lotz
3dfbe1a12d guarded_heap: Use __arch_get_stack_trace() instead of syscall.
The stack base and end addresses are stored in TLS slots that are
prepared when enabling stack traces and filled in lazily on use for
each thread. This avoids the need of calling get_thread_info to get
these values.

Also simplifies the code somewhat due to proper frame skipping support.
2015-04-11 23:37:54 +02:00
Michael Lotz
c012e7e930 libroot: Add private __arch_get_stack_trace().
It can be used to get a stack trace of the current thread. Note that
this works by walking frame pointers and will not produce anything
useful if an application is compiled with the frame pointers omitted.

The stack base and end addresses have to be provided as arguments and
are used to check that the frame pointers fall within that range. These
values are thread specific and can be retrieved with get_thread_info().
No other sanity checks (like checking for loops in the linked list) are
done.

This is a simplified rewrite of the stack trace code from the kernel
debugger.

As this code is common to x86 and x86_64 but is not generic across
architectures I introduced x86_common as a directory to put such
sources.
2015-04-11 23:37:54 +02:00
Michael Lotz
9ac1c4c25e libicon: Fix leak of Icon::Gradient.
This was most prominently visible in applications that show a lot of
icons like Tracker and Deskbar.
2015-04-11 14:55:11 +02:00
Michael Lotz
abed891d1b Shortcuts: Fix use-after-free in EditWindow return.
Calling Quit() on the window deletes it, so using the fTextControl
member to get the result does not work.
2015-04-11 13:39:33 +02:00
Michael Lotz
827f11e986 Whitespace cleanup only. 2015-04-11 13:37:28 +02:00
Michael Lotz
268bbb1f8c AboutSystem: Fix leak of package credits. 2015-04-11 13:34:30 +02:00
Michael Lotz
459e651fd5 syscalls: Remove lookup_symbol syscall again.
This partially reverts b959d46dbd.
2015-04-11 11:18:51 +02:00
Michael Lotz
bd5dea318a guarded_heap: Replace symbol lookup syscall with runtime_loader.
Use the private runtime_loader API to do the symbol lookup instead of
using the syscall.
2015-04-11 11:18:51 +02:00
Michael Lotz
ebdc1d480e runtime_loader: Add imageName and exactMatch to symbol lookup.
Extend the get_nearest_symbol_at_address() private runtime_loader
export to include imageName and exactMatch arguments.

The imageName holds the SONAME of the image, if available, so cannot
neccessarily be extracted from the image path.

Whether or not there was an exact match, i.e. the symbol with its size
contains the address, is now returned in exactMatch.
2015-04-11 11:18:50 +02:00
Humdinger
215756b065 Added FilWip package. 2015-04-11 10:40:43 +02:00
Humdinger
7c6a5b81aa Added gcc4 versions of cdrtools and BurnItNow (by luroh)
luroh was so kind to compile those for gcc4. cdrtools don't build on x86_64,
so there's no reason provide a 64bit BurnItNow version either.
Corrected name of gcc2 source package of burnitnow.
2015-04-11 10:31:45 +02:00
Michael Lotz
6900f36727 Add leak_analyser shell script to analyse guarded heap info.
The script runs the guarded heap allocation output through c++filt to
demangle stack trace symbols and filters out a list of known globals
that are never freed. It also allows to exclude further patterns
provided on the command line.
2015-04-11 09:41:25 +02:00
Michael Lotz
0cf3d62115 Make guarded heap accessible through its own libroot_guarded.so.
This adds libroot_guarded.so to the HaikuDevel package. It is the same
as libroot_debug with the debug heap swapped out for the guarded heap.
The guarded heap has some useful features that make it desirable to use
while having the disadvantage of a large memory and address space
overhead which make it unusable in some situations. Therefore the
guarded heap cannot simply replace the debug heap but should still be
made available. As the heap init needs to happen even before having
environment variables, the heap to use can not be chosen dynamically.
Exposing them through their own libraries is the next best thing.
2015-04-11 09:41:25 +02:00
autonielx
1a704d4de9 Update translations from Pootle 2015-04-11 06:27:18 +02:00
Michael Lotz
74c284545b malloc_debug: Remove condition that is always true. 2015-04-10 17:11:56 +02:00
Michael Lotz
ec0190adb0 malloc_debug: Implement allocation dump on exit in guarded heap.
When enabled (using heap_debug_dump_allocations_on_exit(true) or
MALLOC_DEBUG=e) this causes a dump of all remaining allocations when
libroot_debug is unloaded. It uses terminate_after to be called as
late as possible.

When combined with alloc stack traces this makes for a nice if a bit
crude leak checker. Note that a lot of allocations usually remain
even at that stage due to statically, lazyly and globally allocated
stuff from the various system libraries where it isn't necessarily
worth the overhead to free them when the program terminates anyway.
2015-04-10 17:04:28 +02:00
Michael Lotz
e26a4e7b7a malloc_debug: Also print stack traces when dumping guarded heap. 2015-04-10 16:49:02 +02:00
Michael Lotz
607ac916de malloc_debug: Impl. heap_debug_dump_allocations in guarded heap. 2015-04-10 16:42:29 +02:00
Michael Lotz
158e20e60e malloc_debug: Implement alloc/free stack traces in guarded heap.
When configured to do so (using heap_debug_set_stack_trace_depth(depth)
or MALLOC_DEBUG=s<depth>) the guarded heap now captures stack traces on
alloc and free.

A crash due to hitting a guard page or an already freed page now dumps
these stack traces. In the case of use-after-free one can therefore see
both where the allocation was done and where it was freed.

Note that there is a hardcoded maximum stack trace depth of 50 and that
the alloc stack trace takes away space from the free stack trace which
uses up the rest of that maximum.
2015-04-10 16:28:42 +02:00
Michael Lotz
f4bd38257b Whitespace cleanup only. 2015-04-10 16:10:05 +02:00
Michael Lotz
b959d46dbd syscalls: Add get_stack_trace and lookup_symbol syscalls.
The get_stack_trace syscall generates a stack trace using the kernel
debugging facilities and copies the resulting return address array to
the preallocated buffer from userland. It is only possible to get a
stack trace of the current thread.

The lookup_symbol syscall can be used to look up the symbol and image
name corresponding to an address. It can be used to resolve symbols
from a stack trace generated by the get_stack_trace syscall. Only
symbols of the current team can be looked up. Note that this uses
the symbol lookup of the kernel debugger which does not support lookup
of all symbols (static functions are missing for example).

This is meant to be used in situations where more elaborate stack trace
generation, like done in the userland debugging helpers, is not possible
due to constraints.
2015-04-10 16:00:49 +02:00
Michael Lotz
e01de52283 More whitespace cleanup all over the place. 2015-04-10 15:05:14 +02:00
Michael Lotz
416255de4e libroot: Fix typo in static variable name. 2015-04-10 15:05:13 +02:00
Michael Lotz
47b0d5f52a <input>keyboard: Fix use-after-free on dead key completion.
When completing a dead key the already freed string was used to build
the input method changed notification. Use an ArrayDeleter to simplify
management of the two strings.
2015-04-10 15:05:13 +02:00
Michael Lotz
d6ab05e72f Whitespace cleanup only. 2015-04-10 14:41:27 +02:00
Michael Lotz
a0a1f480de libmedia: Fix leaks of dirs from find_paths in AddOnManager. 2015-04-10 14:41:27 +02:00
Michael Lotz
058d3b8267 BPathFinder: Fix leak of paths from find_paths. 2015-04-10 14:41:26 +02:00
Janus
baa27ccb30 ShowImage: Multipage images displayed in sequence.
* The correct page is displayed.
* Next/Previous/First/Last page are enabled and disable
  as Next/Previous File.
* Add in the status bar current page/ total page.
* Fixes #11959.
2015-04-09 19:21:34 +00:00
Automatic Committer
35df7c671e Update pci.ids from pciids.sourceforge.net 2015-04-09 05:20:27 +02:00
Adrien Destugues
cb6de5e19b BeagleBoard: fix compilation of dtb.
* Copy from rpi2, but this should probably be shared somewhere.
2015-04-08 21:23:33 +02:00
Humdinger
ae2192e832 Updated cdrtools. Added BurnItNow.
Opinion on IRC was to upload the packages, even though I'm not able to test
because I lack an optical drive.
2015-04-08 19:16:57 +02:00
Adrien Destugues
f49c4c0911 RemoteDesktop: fix -c handling.
hrev43649 was not completely merged during the PM merge, add the missing
line.

Fixes #11955.
2015-04-08 19:06:14 +02:00
Michael Lotz
47c5baac63 HaikuDepot: Apply logic from 2a36368 to PackageListView fields.
Rename BBitmapStringField to SharedBitmapStringField and make it
reference the SharedBitmap.
2015-04-08 18:20:25 +02:00
Michael Lotz
2bd0b27f5d Tracker: Fix use-after-free by ref filter of OpenWithPoseView.
Commit ea8b1e14 changed OpenWithPoseView from using ShouldShowPose for
filtering poses to a BRefFilter. The introduced ref filter used the
iterator handed to the BPoseView::AddPosesTask which took ownership
of that iterator and deleted it as soon as it was done. Since actually
adding the poses as well as further filtering is asynchronous and
happens after the AddPosesTask completes, the iterator was used after
it was already deleted.

Introduce BPoseView::ReturnDirentIterator() that is called after the
AddPosesTask is complete. The default version deletes the iterator,
the OpenWithPoseView overrides it and does nothing, it deletes the
iterator in the destructor instead.

Also fix leaking the ref filter. The BPoseView does not take ownership
of the filter as it usually comes from a BFilePanel which is documented
to not take ownership.
2015-04-08 16:50:02 +02:00
Michael Lotz
0a74a00526 Tracker: Remove two outdated comments, whitespace cleanup. 2015-04-08 16:48:10 +02:00
Michael Lotz
d854f235bc Tracker: Remove an old PPC STL workaround. 2015-04-08 16:42:11 +02:00
Michael Lotz
abf230a9ac malloc_debug: Set default alignment to max_align_t if available.
For it to be available we build malloc_debug in C++11 mode when not
using GCC2. Note that max_align_t is not in the std namespace in GCC4
versions prior to GCC 4.9. The extra "using namespace std" is there to
be forward compatible once we update.
2015-04-08 12:56:58 +02:00
Michael Lotz
e25776bd83 Whitespace cleanup only. 2015-04-08 12:56:58 +02:00
Michael Lotz
2a36368bda HaikuDepot: Make BitmapView use SharedBitmaps directly.
Instead of extracting a BBitmap out of the SharedBitmap and giving that
to BitmapView, set SharedBitmaps directly. When using BBitmaps we
circumvent the reference counting of the SharedBitmaps and it would be
possible for the SharedBitmap and its BBitmaps to get deleted while
one of them was still used in a BitmapView.

Fixes use-after-free when icons are updated that are already used in
BitmapViews.
2015-04-08 11:15:49 +02:00
Michael Lotz
3525a370d4 HaikuDepot: Add missing init of fSize in default constructor. 2015-04-08 11:15:49 +02:00
Michael Lotz
8708474567 HaikuDepot: Clean up trailing whitespace. 2015-04-08 11:15:29 +02:00
Michael Lotz
5c7707fc34 desklink: Use early return, no functional change. 2015-04-08 11:15:29 +02:00
Michael Lotz
77c35db9a9 desklink: Whitespace cleanup only. 2015-04-08 11:15:28 +02:00
Janus
6ea53cb5bb Showimage: Test thread ID for generic error.
* Thanks Ingo and Axel.
2015-04-07 21:21:26 +00:00
Janus
cae52eadac Showimage: Add zoom level to StatusBar.
* Improve StatusBar graphics (Same style as StyledEdit).
* Resize the StatusBar to best fit.
* Fixes #7394.
2015-04-07 17:17:32 +00:00
Janus
be63ec85a8 Showimage: Wait for loader threads on exit.
* Uses find_thread to wait for loader threads.
  (better solutions are welcome)
* As suggested by Axel the cache isn't static anymore.
* Fixes 8902.
2015-04-07 16:15:46 +00:00
Augustin Cavalier
51362d85d8 Haiku Book: Doxyfile: eat __attribute__ directives.
Without this, Doxygen attempts to parse __attribute__ directives
and often outputs garbage instead of properly parsing them, so just
exclude them from the documentation.

Fixes some incorrect function listings in BString documentation
and possibly more elsewhere.
2015-04-06 18:00:39 -04:00
Augustin Cavalier
64f7e980a4 BString docs: don't have tags in hsection titles. 2015-04-06 17:51:04 -04:00
Oliver Tappe
b63d718b1c Update beam package(s) from 1.2alpha to 1.2.
* This updates the x86_gcc2 package and adds a package for x86.
2015-04-06 19:51:31 +02:00
Adrien Destugues
839310264d Add packages for avr_gcc (and libc and binutils) 2015-04-06 17:55:35 +02:00