Commit Graph

58823 Commits

Author SHA1 Message Date
Augustin Cavalier
055a35e632 tests: Add some more things to DemangleTest.
Change-Id: I6999aad2cc64650bddb7ba575536efc8878abcf2
Reviewed-on: https://review.haiku-os.org/583
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-09-18 20:02:55 +00:00
waddlesplash
2d9270e859 determine_haiku_revision: Properly get rid of the commit hash.
Change-Id: I3f57b1cd4d819e7f531001d747bf7b103954a918
Reviewed-on: https://review.haiku-os.org/581
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-09-18 19:50:52 +00:00
Augustin Cavalier
de777b79eb demangle/gcc2: Do not trust inputs.
We do not know anything about the symbols we are being asked to demangle;
it is entirely possible they are malformed, or that we parse them incorrectly,
which previously led to buffer overflows. E.g. the "2","8" in "SetTo__Q28_GLOBAL_"
is presently incorrectly parsed as a length, leading to an access 21 bytes past
the end of the string.

This caused a page fault under the guarded heap, a fact I had the misfortune
to discover when trying to attach Debugger to a guarded-heap'd application
which somehow ran the demangler under the guarded heap also, and that symbol
above was in runtime_loader, so it crashed while loading its symbols.

So now we do what the GCC3+ demangler does here, and keep track of the input
buffer through the use of a state class, which will prevent us from incrementing
past the buffer's end.

I've tested this patch using the new haikuc++filt utility against libtracker
(indeed, it took multiple rounds of testing to get the diff to be 0 bytes)
and it seems to work exactly as before, though now without out-of-bounds
accesses.

As this demangler is also used in the kernel, it's possible that some
triple-faults on x86_gcc2[h] are caused by this bug (although that would
be rare; one of the incorrectly-parsed symbols would have to be in the
stack trace, and then it would have to read past the end of the buffer
containing the symbol.)

Change-Id: I343991cebd7d2887812c8c6b3dc2e0df2fcd79fa
Reviewed-on: https://review.haiku-os.org/579
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-09-18 02:19:18 +00:00
Augustin Cavalier
adad95fa46 tests: Add a simple version of "c++filt" that uses the homegrown demanglers.
Built as "haikuc++filt" so you can keep it in PATH without replacing GCC's.

The implementation is a very close copy of "demumble", which is
under the Apache 2 license, so this is also. Most of the modifications
to "demumble" were to strip out Windows symbol support, and then
add GCC2 symbol support (this required reworking of the main loop,
as we detect GCC2 symbols in a different way than Itanium symbols.)

I've also added a command-line flag to ignore GCC2 symbols when stream-
processing, which is sometimes useful when demangling GCC3+ symbols.

Running this under guarded heap with some random SOs shows that there are
some symbols which apparently cause memory corruption in the GCC2 demangler.
I haven't yet looked into that, though.
2018-09-16 23:13:04 -04:00
Augustin Cavalier
8339f2eb89 tests: Add test boilerplate for our homegrown demanglers.
There's only one test each, for now, but adding tests is now of course
a one-line addition per test.
2018-09-16 23:06:32 -04:00
Augustin Cavalier
48a6df083d Tracker: Eliminate the double border in the OpenWithWindow.
Change-Id: I43e9b15c4cd7f4986fa7c1231cc8ca89676866bf
Reviewed-on: https://review.haiku-os.org/575
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-09-16 23:21:36 +00:00
Augustin Cavalier
497f099f5a Tracker: Clean up AddPoses threads properly.
They may still be running at the point we detach from the window, and
as we stop watching everything else at that point (and the threads
themselves depend on the window looper as the global "lock"), we
need to tear them down then.

We especially cannot do this in the destructor, as there are some
virtual methods that the threads need during their teardown which
obviously will not work in ~BPoseView.

Fixes #13371, and potentially other Tracker crashes that occured
as a result of closing the window while the add-poses tasks were
still operational.

Change-Id: Ib7ec0d1d413096be899a05887399f5b087eb8f99
Reviewed-on: https://review.haiku-os.org/574
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-09-16 23:21:36 +00:00
Autocomitter
15cb367a40 Update translations from Pootle 2018-09-16 20:27:57 +00:00
Augustin Cavalier
f436972c14 BString: Treat NULL passed as replaceWith as an empty string.
Fixes the tests added in the previous commit, and also #8552.

Change-Id: Idf9459474bc66054f94cf66065ed6fcf9c60cece
Reviewed-on: https://review.haiku-os.org/572
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-09-16 17:57:02 +00:00
Augustin Cavalier
38a133eb8a StringReplaceTest: Add (failing) invocations of Replace*() with NULL "to".
BeOS R5 treats NULL passed as the "replace with" argument as if it were
an empty string. Our BString currently does nothing.

Change-Id: I54b661e4ea8335ce531e6b6e3de2095a41112cd7
Reviewed-on: https://review.haiku-os.org/571
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-09-16 17:57:02 +00:00
Augustin Cavalier
79187c3c42 iprowifi4965: Add -100 firmware.
Should fix #14492.

Change-Id: I887995d45d2e357f0181f54396bc3c19a2158e26
Reviewed-on: https://review.haiku-os.org/567
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-09-16 00:09:14 +00:00
Augustin Cavalier
563a1a0da1 determine_haiku_revision: Rework "no tag on HEAD" output.
When HEAD is tagged, the output will be identical to what it was
before (the latest hrev tag and nothing else.) When HEAD is not tagged,
and the most recent tag is further back, we now use a format like this:

hrevXXXXX+N(+dirty)

... where N is the number of commits since hrevXXXXX, and +dirty is added
if the working tree is dirty. This is significantly shorter than the
previous model (as it does not have the Git revision.)

Fixes #14445.

Change-Id: Ide7f66cf0ac1c1f05402afc52b6be3b68b66d6dc
Reviewed-on: https://review.haiku-os.org/566
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-09-16 00:09:14 +00:00
Augustin Cavalier
6d7838a16b src/tests: Fix some incorrect filemodes.
Change-Id: I779cec1905c52eae6955bae979e32ba587e23560
Reviewed-on: https://review.haiku-os.org/565
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-09-16 00:09:14 +00:00
Michael Lotz
99888f6b69 kernel: Apply user iframe determination logic to SMAP/SMEP.
Change-Id: I394492a289f01303ac28e6d6670fbfdb326fa4db
Reviewed-on: https://review.haiku-os.org/561
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
2018-09-14 10:09:10 +00:00
Michael Lotz
8c005190c4 kernel: Determine kernel vs. user page fault depending on iframe.
The action vm_page_fault takes should depend on whether the iframe to be
handled is a user iframe or not. The check for the user flag in the
error code does however only check if the fault happend in user or
kernel space. Use IFRAME_IS_USER() instead which checks the privilege
level of the iframe. Under 32 bit x86 this also handles vm86
compatibility mode properly.

This is the same logic as used on FreeBSD (TRAPF_USERMODE).

Fixes #13930.

Change-Id: I9c348b6ab4c60daaaaa2c0fe33bcc3336aa29f7b
Reviewed-on: https://review.haiku-os.org/560
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
2018-09-14 10:08:03 +00:00
Michael Lotz
0de5a83940 Cleanup: Use symbolic names, compare != 0 and whitespace.
Change-Id: I34c60b3ab8387fe57dbcd91f9b5d278468455cf6
Reviewed-on: https://review.haiku-os.org/559
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-09-14 10:04:54 +00:00
Humdinger
8aea77d00f HDA driver: use optional settings file
Patch by Pete Goodeve, ticket #9134.
(Removed play_sample_rate and record_sample_rate as suggested in
patch review, adjusted hda.settings accordingly.)

Tune buffer size and buffer count with an optional settings file
/boot/home/config/settings/kernel/drivers/hda.settings. Same as
it's done for the auich driver.

Pete:
> I [...] request 4 buffers of 1024 frames, I get a nice 13-14ms latency.

Change-Id: I3c1c64375d22b525afb970d5e8379b22b8514438
Reviewed-on: https://review.haiku-os.org/521
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2018-09-14 06:23:48 +00:00
Augustin Cavalier
62a788f323 ethernet: Fix some more incorrect return value handlings of ioctl(). 2018-09-13 16:14:36 -04:00
Augustin Cavalier
4d5c5a7e66 libroot: More RETURN_AND_SET_ERRNO cleanup.
No functional change intended.
2018-09-13 16:05:22 -04:00
Augustin Cavalier
110ba6da3a tests: Remove the "R5" userlandfs.
Essentially untouched since 2009, and not referenced at all from the
"Haiku" userlandfs.
2018-09-13 15:56:52 -04:00
Augustin Cavalier
043b00fb2c BNetworkDevice: Fix memory leaks and address comments.
Thanks Axel and Jerome for the reviews!

Change-Id: I4f116c540cf59ba74b79d9d2f95ed40edc9c4174
Reviewed-on: https://review.haiku-os.org/557
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-09-13 19:53:33 +00:00
Augustin Cavalier
45bc01d2f7 ifconfig & Network preferences: Actually trigger scans using BNetworkDevice.
Fixes #12034, and a variety of other strange "no wireless networks
appear" bugs that have plagued Haiku for years.

Change-Id: I734cb8084e8a626b8e03511519609bf80c1559eb
Reviewed-on: https://review.haiku-os.org/552
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-09-13 04:13:19 +00:00
Augustin Cavalier
4e5aaaa700 BNetworkDevice: Implement Scan().
This depends on the previous commit to return the correct error code
from ioctl().

If there are no VAPs running (which is the case after a forced disconnect
from an access point), scans will fail. In that case, we call
IEEE80211_IOC_HAIKU_COMPAT_WLAN_UP, which will restart a VAP, and then
initiate the scan.

Change-Id: I732aefe67e386dbb0ed3d232ed9deda678132601
Reviewed-on: https://review.haiku-os.org/551
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-09-13 04:13:19 +00:00
Augustin Cavalier
e9073260a7 network/ethernet: ioctl returns -1 and stores the error in errno.
Previously, if a device driver returned an error of any kind, -1 was
propagated the rest of the way up through the stack instead of the
actual error code.

Change-Id: I6839763c6b2eb86d6112d3732e6cb80d022f1fe8
Reviewed-on: https://review.haiku-os.org/550
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-09-13 04:13:19 +00:00
Augustin Cavalier
77d2c1df0e libroot: Use RETURN_AND_SET_ERRNO from the utils header in ioctl.
No functional change intended.

Change-Id: I5e6a060fe8e036bc4d4b8b8cc95a4e8d0ea00f81
Reviewed-on: https://review.haiku-os.org/549
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-09-13 04:13:19 +00:00
Janus
aa39f874dc BColumnListView: hscrollbar matches visible columns
* _VirtualWidth() ignores invisible columns
   This makes the horizontal scrollbar match the width of the visible columns.
   Also trigger an initial update of the scrollbars.
* Fixes #14480

Change-Id: I7d4b27a8fdca58c150ac47f9b948b127fb275fdf
Reviewed-on: https://review.haiku-os.org/543
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2018-09-12 11:53:09 +00:00
JackBurton79
b070314f50 FlattenPictureTest: Fix DrawStringsWithOffset test
fixes #14481

Change-Id: I7aee0f9e1ed088d2b5253f22a55228b0fc8f16ec
Reviewed-on: https://review.haiku-os.org/546
Reviewed-by: Stefano Ceccherini <stefano.ceccherini@gmail.com>
2018-09-12 10:44:55 +00:00
Augustin Cavalier
c3ac0a72a6 BMenuItem: Remove ourselves from the super menu on destruct.
This fixes the (intermittently) crashing test added in the previous commit,
and should also fix #12024 and #14348.

Note that this is a slight behavioral departure from BeOS, though since
BeOS crashed when this was done previously, it shouldn't cause any
other problems.

Change-Id: I90b6132ff7741b8d6cb601375a9b11fc3ffacb40
Reviewed-on: https://review.haiku-os.org/541
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-09-12 01:15:48 +00:00
Augustin Cavalier
4628b6de8e tests/interface: Add a (currently crashing) BMenu "concurrency" test.
Adds/removes items as rapidly as possible from the menu from the
main thread while the menu is open. That part works. Then it deletes
all of the BMenuItems and then closes the menu, which crashes,
as the BMenuItems do not notify the BMenu they are being deleted.

I tested this on BeOS and it seems that this model crashes there also
(looking through the code comments, it seems there are a number of
testcases found throughout the years like this.) Removing the items
before deleting them indeed fixes the crashes on both BeOS
and Haiku.

Change-Id: I8624f966bdc17030ddca05b97aa57b518ab420c5
Reviewed-on: https://review.haiku-os.org/540
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-09-12 01:15:48 +00:00
David Murphy
81d0a0e0a7 BColumnListView: Always update the reference rect in ::FindVisibleRect...
...if the row is present in the list, but continue to return false if the
row is not currently visible on the screen.

Part of #11675. Cherry-picked from https://review.haiku-os.org/442.
2018-09-11 18:59:32 -04:00
Augustin Cavalier
74e882b39b kernel/fs: Flush the underlying device's write cache as part of sync().
BFS does this as part of journal management, but not as part of block
cache synchronization (which makes sense, as flushing it then would
defeat the purpose of the drive's write cache.) No other file system
seems to touch it at all, so we should do it as part of an explicit sync.

This may help with some of the filesystem corruption issues, as it seems
that on slow disks, the drive might not have enough time to flush the cache
before it is powered off (or on some SATA/AHCI based disks, it is not flushed
before close at all), so triggering it here and, as the ioctl is supposed to be
synchronous, waiting for it also, seems to make sense.

Change-Id: I7d9992c21ca4b59c839711dcc96c973b4b8df052
Reviewed-on: https://review.haiku-os.org/530
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-09-11 20:06:58 +00:00
Kacper Kasper
709c79a3f7 MediaPlayer: don't fill background for mute button
* The difference is visible when control background doesn't match
  panel background.

Change-Id: Ie3a034acaa52929becd6601520e0e05f32ecc8d8
Reviewed-on: https://review.haiku-os.org/537
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-09-11 20:03:13 +00:00
Andrew Lindesay
a609673ce8 Support : Fixes for Relative URL Handling
When URLs combine a base URL with a relative part, the relative part's
path component was being pre-processed.  This removed any ".." from the
path and in some cases in the unit test cases, the ".." should have been
retained and then only later applied to the base URL.  This changes
fixes this so that the relative part is not pre-processed and is applied
with it's path in a raw state.

Completes Fixes for #14377
Change-Id: I9cebb8599889494e11f40a3b54c87ebca3ed1a21
Reviewed-on: https://review.haiku-os.org/529
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2018-09-11 18:39:53 +00:00
JackBurton79
66f19f7201 Fix ClipToPicture() inside a BPicture
Mimic what is't done in clip_to_shape: call SetCanvasGeometry() and ResyncDrawState().

Change-Id: Ibbd77ec8cf90952d94ee35871736e145102a763e
2018-09-11 14:30:59 +02:00
Augustin Cavalier
21e99b4766 pkgman: Suppress the erroneous "aborted: No Error" messages on no internet.
Here's what happens:
 * BPackageManager created a BRefreshRepositoryRequest with a BContext
   of an empty DecisionProvider and itself.
 * Since there is no internet access, the FetchFileJobs that the refresh
   class queued fail. Specifically, the first one does, but then as the
   subsequent ones depend on it, they are all aborted.
 * As some jobs were aborted, the StateListener is notified.
 * The state listener of course has the BPackageManager class as one of
   the listeners, and so calls it, because even though the handler methods
   of BRefreshRepositoryRequest, they are powerless to stop event propagation.
 * The BPackageManager's highest subclass' implementation gets called, which is
   of course pkgman's.
 * pkgman decides to DIE() upon receiving word that a job was aborted.

There are thus four potential solutions to this issue:
 * Rewrite the package kit's event & job handling systems to not be so
   screwed up in terms of propagation. Seriously, there is way too much
   stuff that we send to the "user" in here, and as you can see, it can
   get *extremely* convoluted even for supposedly "simple" tasks. This
   is probably the best "long-term" solution; but obviously is far too
   involved for the present.
 * Only partially rework event handling; specifically in the SupportKit to
   allow JobStateListeners to stop further propagation. This is probably
   the best "medium-term" solution.
 * Do not pass the package manager as the JobStateListener to the
   RefreshRepositoryRequest. This would have the downside that the
   regular notifications about download state, etc. would not be returned
   at all, which we don't want. We could make a shim ... but that would be
   a lot of code for little benefit. The prior solution makes more sense.
 * Completely ignore "JobAborted" notices in pkgman. In fact, this is the
   solution that virtually all other consumers of this API take (although
   some of them seem to have TODOs about it), including package_daemon,
   HaikuDepot, etc., and so it's the one I've taken here. If a "job aborted"
   error is actually fatal, then it's the Package Kit's problem.

Fixes #13075.
2018-09-11 01:32:59 -04:00
Augustin Cavalier
4c7002a3d1 mime_db: Add type for HEVC elementary streams.
"Elementary streams" were introduced with MPEG-2, but did not find much use
outside of internal data interchange until now, which finds some HEVC
files being actually distributed in this format.

The first four bytes (00 00 00 01) are common to all (packetized?) elementary
streams, while the three following (40 01 0c) identify a HEVC stream. Actually
I could not find good data on these; all the HEVC files I saw (and some hex-
dumps on online mailing lists of more) contain these three bytes in common
while following ones appear to be the internal header. (I didn't dig deeply
enough into FFmpeg's source code to find out the "real deal.")

Fixes #12565.
2018-09-10 22:26:32 -04:00
Augustin Cavalier
14162168f5 mime_db: Add entries with sniff rules for DjVu and XPS.
These formats are supported by DocumentViewer.
2018-09-10 21:56:34 -04:00
Augustin Cavalier
503d889314 Remove the "Haiku" screensaver from the tree.
As discussed in #14447.
2018-09-10 19:51:02 -04:00
JackBurton79
5706737797 PictureDataWriter: Fix invert rect.
Resetting the drawing mode to B_OP_COPY was not right, since the previous mode could be anything.
Use WritePush/PopState() instead.

Change-Id: If9cba2c46bf372fd0164d951fcc49696cf72d576
2018-09-10 16:14:49 +02:00
JackBurton79
da51ebe0e5 BPicture: uncomment (and fix build) of the clip_to_picture method.
Does not seem to work, though.

Change-Id: I309d8de79a71ab8e08f4ac2f2566080b67b84800
2018-09-10 14:19:10 +02:00
JackBurton79
cb0d7a1ecd app_server: make a copy of the passed BPicture
Like the AS_DRAW_PICTURE case, make a copy of the passed BPicture also for AS_CLIP_TO_PICTURE

Change-Id: Id9a0adc48d73e5ec9c0d37e2ed85e30aa48369ab
2018-09-10 12:48:30 +02:00
JackBurton79
d1311300dc app_server: local variable was shadowing the outer variable
In the AS_CLIP_TO_PICTURE case, the "picture" variable was shadowing the outer "picture" variable.

Change-Id: I3b9de2432f93a683aaccdb899051a14ebf9b7e6e
2018-09-10 12:45:21 +02:00
Alexander von Gluck IV
7f644d106d xhci: gcc2 buildfix from hrev52319
Change-Id: I5d82059bd002c26ba372d55f5a5538ce7d19ffb2
2018-09-09 13:50:55 -05:00
Jérôme Duval
21c87a5d83 drivers: remove some non-haiku support code.
Change-Id: Ic55bb4832adabeb807f763c87ad938e74fb3a97d
Reviewed-on: https://review.haiku-os.org/520
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2018-09-09 17:32:01 +00:00
Augustin Cavalier
24ed1a79a3 AboutSystem Credits: Some updates.
* Move nielx back into Contributors
 * Move hamishm into Past Contributors
 * Add some new translation contributors
2018-09-08 20:14:26 -04:00
Augustin Cavalier
a3e22cdaa7 Installer: Rework status message view sizing logic.
* Make the status message view have a minimum height of the logo
   view's height.
 * Properly add the views to the BGroupView layout.
 * Instead of trying to set the explicit minimum size from the status
   view information, just invalidate the GroupLayout. This seems to fix
   a number of bugs relating to text overflowing the view, while it doesn't
   fix others (e.g. orphan words on their own lines are still not drawn
   in some cases, which appears to be a BTextView bug.)
 * Use BString::SetToFormat instead of snprintf in some places.

As far as I can make out, fixes #13608.
2018-09-08 19:49:03 -04:00
Augustin Cavalier
47ba82bf03 Deskbar: Add missing NULL check in SwitchWindow().
All other functions in this file that locate the TTeamGroup via FindTeam()
do a NULL check afterwards, so the fact that this one did not just looks
like an oversight.

Fixes #14457.
2018-09-08 19:03:06 -04:00
Augustin Cavalier
f960901a70 EFI: Use proper mnemnoic for retf (lret) to appease Clang. 2018-09-08 18:56:33 -04:00
Augustin Cavalier
e282a54db8 BUrl: Remove HAIKU_TARGET_PLATFORM_HAIKU from main header.
These are really only defined during the build of Haiku itself,
so we don't want them in a system header. Since none of these
functions are virtual, leaving them as declared but not defined
should be fine.
2018-09-08 18:56:33 -04:00
Augustin Cavalier
23446707de ArchitectureRules: Pass -shared to the universally to the linker when using Clang. 2018-09-08 18:56:33 -04:00