Commit Graph

53413 Commits

Author SHA1 Message Date
Michael Lotz
3b7b927dd0 libbnetapi: Add BNetworkRoute to replace use of route_entry.
The BNetworkRoute class manages a route_entry and the sockaddr's
associated with it. It replaces the direct use of route_entry in the
BNetworkInterface API.

Using route_entry is fragile and inconvenient as it only holds pointers
to the sockaddr's. When getting a list of routes from the kernel, each
route_entry is set up so that its pointers point into the single flat
buffer that is passed around. Creating a copy of the route_entry and
then deleting the flat buffer makes the pointers in the copy stale.
Returning these route entries therefore always lead to a use-after-free
when they were eventually used.

BNetworkRoute also takes over the code and functionallity of getting
routes from RouteSupport. The corresponding method in BNetworkRoster is
replaced by a static method in BNetworkRoute.

Also distinguish between the default route and gateway of an interface.
GetDefaultRoute() now gets the default BNetworkRoute for the interface
while GetDefaultGateway() gets the associated gateway address within
that default route. Adjust network preferences panel to this change.

Note that we currently only seem to have per interface default routes
and not an actual global default route. This was already the case before
these changes and I did not further investigate what this means.
2015-04-12 18:50:00 +02:00
PulkoMandy
7d82b5d4ab arm/mmu: Fix boot on beagle-xm
* The changes for pi2 support led to the virtual addresses overlapping
with the page table again on the beagle, because the kernel address
space overlaps with the physical RAM identity mapped. Try to find a
memory range in a way that will work in both cases.
2015-04-12 17:52:24 +02:00
Alexander von Gluck IV
9c5e234cb3 arm: Initial Cubieboard4 work
* SD cards are "blessed" with a boot0 spl and boot1 u-boot
  at fixed locations.
* Allwinner's u-boot is lacking a lot.
* Upstream u-boot should be better at some point. WIP:
  http://lists.denx.de/pipermail/u-boot/2015-January/201537.html
2015-04-11 16:53:04 -05:00
Michael Lotz
97ebc043a6 Remove empty file probably accidentally added in hrev47198. 2015-04-11 23:37:55 +02:00
Michael Lotz
8f9d4cad45 syscalls: Remove get_stack_trace syscall again.
This reverts the other half of b959d46dbd.
2015-04-11 23:37:55 +02:00
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