Commit Graph

57971 Commits

Author SHA1 Message Date
Jérôme Duval
0291f00909 udis86: update to current version. 2018-01-13 15:54:21 +01:00
Jérôme Duval
9409021432 kernel: x86: add cpuid feature 7 flags. 2018-01-13 09:33:47 +01:00
Rene Gollent
ac9e464b78 Debugger: Fix various issues in the DWARF subsystem.
AttributeClasses:
- Fix typo in get_attribute_name_classes which resulted in us not
  handling DW_AT_linkage_name properly.
- Fix incorrect class specification for DW_AT_default_value due
  to inconsistencies in the DWARF documentation (the table of attribute
  classes indicates it is only a reference, but the detailed description
  indicates it also being possible to be a flag or constant, both of
  which gcc outputs).

DebugInfoEntries:
- Add accessor for DIEClassBaseType's inner types.

DwarfImageDebugInfo:
- When looking up types, create a basic target interface to pass on
  to the type context. Otherwise, type lookups that required DWARF
  expression evaluation would crash.
- When building the type name table, we now recursively walk a class's
  inner types, and add them to the list as well. This omission would
  cause the debugger to lack the type description for such classes,
  and consequently be unable to display their details in the variables
  view.
2018-01-12 22:23:57 -05:00
Andrew Aldridge
f6d25a3a81 strtod: Do not consume "x" in incomplete hex input
Adapted from upstream glibc commits:
* 405698e946dbed472491f85867eb511eb080e05a
* 43b9d657408fbf47a47934f9e7c84ed87f7f5a18

Fixes #13949
2018-01-12 16:45:14 +00:00
Jérôme Duval
a820f1f01d WebPositive: disable debug code.
should fix the debug build for WebPositive.
2018-01-12 16:46:08 +01:00
Rene Gollent
c0936b5a03 Debugger: Another set of #13800 fixes.
AbstractTable/Table/TreeTable:
- Let BColumnListView take care of deleting columns. The previous
  approach was resulting in the columns being leaked.

Debugger:
- Don't detach the UI reference, as TeamDebugger will acquire its own.

GraphicalUserInterface:
- Cleanup of file panel handler.

SourceView:
- Clean up marker manager.

*Roster:
- Clean up registered objects in destructors.

GlobalTypeLookup:
- Clean up hash tables.

NetworkTargetHostInterfaceInfo:
- Fix reference handling for settings.
2018-01-11 22:39:55 -05:00
Rene Gollent
ffe684b96c Debugger: Fix type issue in BList handler.
BListValueNode:
- BList's item count member is an int32. However, when the handler was reading
  said variable, it was mistakenly reading the number of bytes corresponding to
  to the address size of the architecture instead.This would cause the read to
  fail, and consequently BList and/or BObjectList variables to not display
  their contents properly on x86-64.
2018-01-11 22:39:55 -05:00
Jérôme Duval
bbb5a50f9b kernel: debug: map the frame_buffer for the kernel only. 2018-01-11 19:59:10 +01:00
Rene Gollent
3995592cdf Debugger: Fix #13939, more work on #13800.
- Fix various cases where OpenHashTables weren't being cleared properly.
- Fix various reference counting errors.
- Simplify FileManager reference handling.
- Fix bug in LocatableDirectory where the directory named '/' would have its
  name returned as empty. This would lead to failed lookups for entries already
  in the table, and ultimately corrupted the hash table when deleting unused
  entries, leading to #13939. This was previously never noticed due to the
  entries not being freed properly.
- AbbreviationTable wasn't clearing its entries.
2018-01-10 19:29:36 -05:00
Augustin Cavalier
e56d7050a3 docs/develop/packages: Update links and rename index.wiki to README.wiki.
Now this page is rendered when you open the directory on GitHub,
and you can use the links to open any of the files.
2018-01-10 16:54:32 -05:00
Augustin Cavalier
7a988ea15b docs/develop/packages: More fixes to syntax. 2018-01-10 16:48:08 -05:00
Augustin Cavalier
fc2b04e7e4 docs/develop/packages: Convert wiki files to MediaWiki syntax.
This is what GitHub actually is rendering pages as.
2018-01-10 16:37:28 -05:00
Augustin Cavalier
5492447a60 docs/develop: Migrate Package Management docs from Trac.
Still in Trac Wiki format (GitHub renders this well enough.)
2018-01-10 16:19:41 -05:00
Augustin Cavalier
42877d24cf makefile-engine.html: Does not belong in docs/develop.
docs/develop is for documentation about Haiku's internals. The Makefile-Engine
is public API. For now, put it in docs/misc.
2018-01-10 16:12:15 -05:00
Augustin Cavalier
e81a954787 docs/develop: Mass directory restructure.
Now vaguely follows the tree structure of "src", with the exception of
directories that described subsystems spanning more than one "kit" or
"server" (e.g. "media", "midi", "bluetooth") -- these have been left as their
own top-level directory within docs/develop.
2018-01-10 16:12:14 -05:00
Augustin Cavalier
cdf0ad6a80 docs/develop: Delete some more old/obsolete directories. 2018-01-10 16:12:14 -05:00
Augustin Cavalier
96efe3b3c0 docs/user: Migrate Axel's "Introduction to the Launch Daemon" from Trac. 2018-01-10 16:12:14 -05:00
Augustin Cavalier
4241437c83 docs/misc: Add BeIDE_ProjFileFormat.
This is the beginning of a large "move developer docs from the wiki
to the tree" operation, which will probably take some time to complete.

The general goal is to consolidate all docs that would be used by developers
(i.e., anyone working on the Haiku tree) into the tree itself. Docs on
getting started contributing, or for translators, designers, etc. will remain
on Trac and on the website.
2018-01-10 16:12:14 -05:00
Jérôme Duval
144f03cda1 random: use user_memcpy/user_strlcpy to read/write the user buffer.
* also check the user buffer address.
2018-01-10 20:57:59 +01:00
Jérôme Duval
d9e4ef3f76 dprintf: use user_memcpy/user_strlcpy to read the user buffer.
* also check the user buffer address.
2018-01-10 19:08:30 +00:00
Augustin Cavalier
a31e05bb68 MediaPlayer: Compare return value of FindMatch against B_ERROR.
Thanks Rene for the review!
2018-01-10 13:49:32 -05:00
Jérôme Duval
79707fefe0 bfs: INode::ReadAttribute() and WriteAttribute() used the user buffer directly
They now use user_memcpy(). Also copy the user buffer used to update the index.
2018-01-10 18:28:14 +00:00
Jérôme Duval
149553d727 packagefs: ReadAttribute with user_memcpy(). 2018-01-10 18:26:24 +00:00
Owen
6ba5b421a3 Add PlaylistTrackCount and PlaylistTrackTitle to scripting
PlaylistTrackCount returns the number of tracks in Playlist,
and PlaylistTrackTitle the title of a numbered track.

Also, remove B_TRANSLATE macros in scripting properties
2018-01-10 18:20:58 +00:00
Jérôme Duval
8c44fc0f65 PackageKit: tweak classes used by packagefs to write to user buffers.
when compiled in kernel mode, BMemoryIO::WriteAt() and BBufferDataReader::ReadData()
now check the buffer to write to, and eventually call user_memcpy() instead of memcpy().
2018-01-09 20:40:12 +01:00
Jérôme Duval
51051c56d3 kernel: wait_for_objects: read the user sigmask with user_memcpy() 2018-01-08 22:19:07 +01:00
Jérôme Duval
9fbffea6f4 kernel: vfs: don't use the attribute name user buffer directly.
instead copy the name on the stack.
2018-01-07 23:33:04 +01:00
Jérôme Duval
ff678dd91b kernel: image: _get_next_image_info shouldn't use a user buffer directly
_user_get_next_image_info() now copies the cookie on the stack, calls
_get_next_image_info() and copy back the cookie to the user buffer.
2018-01-07 22:57:41 +01:00
Jérôme Duval
6e28d80927 kernel: port: check USE_USER_COPY flag before masking it.
writev_port_etc() used memcpy() instead of user_memcpy() for user buffers.
The branch was even left out silently as an optimization on gcc5.
2018-01-07 22:41:39 +01:00
Jérôme Duval
da8f9c86bd kernel: disk_device_manager: no return in method returning void 2018-01-06 21:38:16 +01:00
Jérôme Duval
4644c7cc92 kernel: disk_device_manager: clean user interface
* avoid assignment in if statements
* use boolean conditions
* use copy_from_user_value/copy_to_user_value instead of user_memcpy
* no functional changes except user buffer addresses check in:
_user_get_next_disk_device_id(), _user_get_disk_system_info(),
_user_get_next_disk_system_info(), _user_find_disk_system()
* remove TODO "Add user address checks and check return values of user_memcpy()!".
2018-01-06 21:38:16 +01:00
Jérôme Duval
74fed5b52c kernel: net_notifications: check user buffer address ...
in control syscall
2018-01-06 21:38:09 +01:00
Jérôme Duval
9572fa7340 kernel: signal: check user buffer addresses...
in _user_set_signal_mask(), _user_sigaction(), _user_sigsuspend(), _user_set_signal_stack().
2018-01-06 17:15:18 +01:00
Jérôme Duval
e04d859b34 PowerStatus: call the APM syscall with the correct struct. 2018-01-06 16:13:11 +01:00
Jérôme Duval
b68d872bdb kernel: apm: check buffer parameter in apm_control syscall 2018-01-06 16:11:32 +01:00
Jérôme Duval
9c18398fe4 kernel: system_info: correctly check the user buffer...
before writing.
2018-01-06 12:05:20 +01:00
François Revol
4069b740e5 pthread: assign handle argument before resuming the created thread
It's not specified by POSIX:
http://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_create.html
"There is no requirement on the implementation that the ID of the
created thread be available before the newly created thread starts executing."

However I've run into it with MPD which assumed this, probably because
of Linux:
https://github.com/MusicPlayerDaemon/MPD/issues/188

It doesn't hurt anyway.
2018-01-06 05:07:43 +01:00
Michael Lotz
da30fdf96a kernel: Fix overflow in load tracking for very large deltas.
The scheduler uses the load tracking logic to compute the load of
threads to be enqueued into the run queue. The time delta between the
last enqueue and the next enqueue may grow very large for threads
that mostly wait on conditions. In such cases the int "n" period count
variable would become too small and wrap around, leading to an
assertion failure.

For this to happen, the thread in question would have to have slept for
at least ~25 days and then wake up. Threads often affected would be ones
waiting for some other process to end, for example shell threads waiting
for a long running process to exit.

Fixes #13558.
2018-01-05 22:48:56 +01:00
Michael Lotz
0a7f661ae2 kernel: Fix scheduler tracing formats and priority field type.
* Use format macros for printing to fix priting on 64 bit.
* Use int32 for all priority fields, some of them were truncated.
2018-01-05 22:48:56 +01:00
Michael Lotz
3084a7000f Cleanup: Remove one trailing whitespace. 2018-01-05 22:48:56 +01:00
Alexander von Gluck IV
b152a7d017 gerrit: Add .gitreview config
Change-Id: I6723891ad48b34a6a065581106a3cc648bc270eb
2018-01-04 00:04:02 -06:00
ohnx
452ac99fa7 mkdos: Handle memory allocation better
In the kernel and command-line tool, don't leak allocated memory,
even if the tool returns an error.

In the command-line tool, also handle memory allocation errors
nicely by giving the user an OOM message if allocation fails.

Fixes CID 1425367 and 1425224.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2018-01-03 22:35:58 -05:00
Jérôme Duval
e46e9fee6b vfs: check userland buffers before reading them. 2018-01-03 21:15:30 +01:00
ohnx
7766c048b3 libroot: Fix possible typo in printf_size.c
It appears as if there is a typo in printf_size.c; it makes
no sense to compare an unitialized variable in such a way.
Since `info->width` is referenced later on in the variable
assignment, it seems possible that the intended statement
was to place the larger of the values between `info->width`
and `info->prec` into `width`.

Fixes CID 609431.

korli: Patch applied in cddfcf2f87
was incomplete. This patch completes with what upstream did in 2004:
fa5753eede.patch

Signed-off-by: Jérôme Duval <jerome.duval@gmail.com>
2018-01-03 19:42:55 +01:00
Michael Lotz
36ef138ce5 kernel: Implement WEXITED for waitid.
Previously dead teams were always returned (as needed for wait/waitpid).
Using waitid it should however be possible to omit the WEXITED flag to
only get stopped (WUNTRACED | WSTOPPED) or continued (WCONTINUED) teams.

Adjust the other caller of the _kern_wait_for_child syscall, used by the
various less specific wait* functions, to always include WEXITED. This
avoids having to special case waitid in the syscall interface or with an
extra flag.

Add a check to ensure that any of these flags is set to avoid the now
possible case of nothing being specified. This fails with B_BAD_VALUE
(EINVAL) as on other systems.
2018-01-03 01:52:52 +01:00
Michael Lotz
63e2d20137 kernel: Treat WSTOPPED synonymous to WUNTRACED.
On other systems their values are usually aliased. We defined them as
two different values, but didn't handle WSTOPPED anywhere. The check
is now simply extended to cover both bits.
2018-01-03 01:22:53 +01:00
Michael Lotz
afe8d6621d kernel: Avoid double lock in wait_for_child with child == team.
When wait_for_child was called with a child argument equal to the
current team, the team was locked again to check if it was a child of
itself.

This is now handled the same way as on other systems, where this case
results in ECHILD (and not EINVAL).
2018-01-03 01:10:29 +01:00
Rene Gollent
b1ab02c434 Debugger: More memory management fixes.
DwarfImageDebugInfo:
- Type name/info entries weren't being freed properly.

BaseUnit:
- The array of entries itself was being destroyed, but not the actual
  objects. Consequently none of the DIE objects were ever being freed.

CfaRuleSet:
- The register rules array wasn't being freed.

FileManager:
- References to entries weren't being released. Some more work remains to be
  done here though, as a subset of these objects still have a non-zero ref
  count in the end.
2017-12-31 17:52:59 -05:00
Augustin Cavalier
8a9e1e0d4a Removal of non-Haiku target platform logic from build system (part 1.)
Following recent changes to use libroot_build on Haiku also, it is now
actually impossible to build Haiku components on non-Haiku platforms
(BeOS R5, Dan0, BONE, Zeta), so we can remove any logic related to this.

This is only the first part; still to be removed are:
 * SetSubDirSupportedPlatformsBeOSCompatible
 * HOST_PLATFORM_BEOS_COMPATIBLE
 * TARGET_PLATFORM_BEOS_COMPATIBLE
2017-12-31 16:14:22 -05:00
Fredrik Holmqvist
1446507ce3 Remove the code to force ACPI to shutdown on CPU0
It was discussed and introduced based on docs that some systems
need this to shutdown properly. I can find no mention of this in
ACPICA or ACPI docs.
This needs to be re-evalutad, as all my shutdowns been successful
after disabling it and I can't locate where this info came from
or if it actually helped.

See 1316462ab0 for original commit
and bug 12306 on current shutdown issue.
2017-12-31 17:43:31 +01:00