summaryrefslogtreecommitdiffstats
path: root/sigchainlib
Commit message (Collapse)AuthorAgeFilesLines
* ART: Add SetSpecialSignalHandlerFn to version-script.txtAndreas Gampe2015-06-051-0/+1
| | | | | | | | | | Expose the new function from the sigchainlib implementation. Bug: 20217701 (cherry picked from commit e089920eb0abc10eca708dbf5993134aa7e8d9b0) Change-Id: I7d21025595775e057ea703236ca88ceb07173136
* ART: Add support for special handlers in sigchainlibAndreas Gampe2015-05-313-4/+58
| | | | | | | | | | | | | | Add support for a special managed handler in sigchainlib that will be called as the first user handler. Use this support for native bridge v2. Extend test 115-native-bridge to test the functionality. Bug: 20217701 (cherry picked from commit 03c2cc89428914adf52229d6a3867eef6127911a) Change-Id: I78cc01fbdabe169154ff6b94c9f3ddb95b5c7448
* Replace NULL with nullptrMathieu Chartier2015-04-221-6/+6
| | | | | | | Also fixed some lines that were too long, and a few other minor details. Change-Id: I6efba5fb6e03eb5d0a300fddb2a75bf8e2f175cb
* ART: Fix no-return in sigchainlibAndreas Gampe2015-04-061-0/+7
| | | | | | Ignore warning in sigchain_dummy. Change-Id: I2c9ed93c0125d06b6a3d4011a794b062cf1c4093
* Delegate SIG_DFL on sigaction to libc.Dmitriy Ivanov2015-04-031-2/+3
| | | | | | | | | | | | | In the case when user registers SIG_DFL hanlder sigchainlib's handler tends to go into infinite loop because the function handling signals resets signal using by calling to signchain's own implementation. This cl fixes the problem by passing sigcations with SIG_DFL to the next sigaction (usually libc's). Bug: 19594886 Change-Id: I9eecf9afd1c7e6d1fe3cd1d4fc506383ecbebe04
* Fix formattingDmitriy Ivanov2015-04-011-8/+8
| | | | Change-Id: Id64aad5de1f911ac7e747788d586bac397f34f18
* Add options for building/testing with coverage.Dan Albert2015-01-301-0/+2
| | | | | | | | | | | acov --clean mm -B NATIVE_COVERAGE=true ART_COVERAGE=true test-art-host acov --host -B is needed because you need to be sure you rebuild *all* of ART with coverage. Change-Id: Ib94ef610bd1b44dc45624877710ed733051b7a50
* Remove libcxx.mk cruft.Dan Albert2015-01-291-1/+0
| | | | | | This is on by default now. No need to leave it in the makefiles. Change-Id: I20eab7426da4bbbf8b70ffc5b9af7b97487d885d
* Do not use clang for mips target.Chih-Hung Hsieh2015-01-071-0/+2
| | | | | | | | | | | Clang assembler cannot compile some inlined assembly code in valgrind_malloc_space-inl.h:192:5: error: used $at without ".set noat" However, clang generated assembly code for runtime/mirror/array.cc cannot be compiled by gas. BUG: 18789639 BUG: 18807290 Change-Id: Ifdeb3c50f11cefc7f0d62c1d36fdd1f8b9344fb4
* Fix sigchainlib's implementation of sigactionDmitriy Ivanov2015-01-061-3/+4
| | | | | | | | Correctly handles the case when old_action == new_action Bug: 18740478 Change-Id: I97092318439e4f6f0a2513d4336496c72f8c5599 (cherry picked from commit 797a29b334f2d311135602bf5204ae8b890f4a14)
* ART: More warningsAndreas Gampe2014-11-041-0/+5
| | | | | | | Enable -Wno-conversion-null, -Wredundant-decls and -Wshadow in general, and -Wunused-but-set-parameter for GCC builds. Change-Id: I81bbdd762213444673c65d85edae594a523836e5
* ART: Fix unused parameters in libsigchainAndreas Gampe2014-11-031-4/+10
| | | | | | The sigchain dummy implementation does not use any parameters. Change-Id: Icbb71677e5092cd5990a69ea3a62703c0747ae17
* C++11 related clean-up of DISALLOW_..Ian Rogers2014-10-221-2/+3
| | | | | | | | | | | | | | | | | | Move DISALLOW_COPY_AND_ASSIGN to delete functions. By no having declarations with no definitions this prompts better warning messages so deal with these by correcting the code. Add a DISALLOW_ALLOCATION and use for ValueObject and mirror::Object. Make X86 assembly operand types ValueObjects to fix compilation errors. Tidy the use of iostream and ostream. Avoid making cutils a dependency via mutex-inl.h for tests that link against libart. Push tracing dependencies into appropriate files and mutex.cc. x86 32-bit host symbols size is increased for libarttest, avoid copying this in run-test 115 by using symlinks and remove this test's higher than normal ulimit. Fix the RunningOnValgrind test in RosAllocSpace to not use GetHeap as it returns NULL when the heap is under construction by Runtime. Change-Id: Ia246f7ac0c11f73072b30d70566a196e9b78472b
* Link libsigchain.a instead of sigchain.oDmitriy Ivanov2014-10-201-0/+26
| | | | | | | | | | Relative paths may sometimes lead to failed builds if sources are built in particular order. Also it is possible to export symbols from static lib with LOCAL_WHOLE_STATIC_LIBRARIES variable. Change-Id: I6d62594c2e84020d67254747c1fd465e1144920e
* Add way to ensure we are at the front of the sigaction chainMathieu Chartier2014-10-164-4/+30
| | | | | | | | | | | | | | | | | | | Calling this after jni_on_load fixes the unity apps. This is not exactly correct since we may already have the following chain. Start up: Us -> debuggerd After app goes in front: App -> us -> debuggerd After we put ourself back at the front: Us -> app -> us -> app -> .... stack overflow. Bug: 17620677 Change-Id: I9183997e3d5ebd51c320b5d51425be5142e938f3 (cherry picked from commit 1f24296c7c8a6501ee2388c0d20b48f471b48660)
* Remove libsigchain from LD_PRELOADSDmitriy Ivanov2014-10-075-21/+85
| | | | | | | | | | | | Link sigchain.cc statically with dalvikvm, app_process, surfaceflinger, dex2oat, patchoat and objdump. Replace libsigchain.so with dummy implementaions to avoid situations when it is used incorrectly. Bug: 15345057 Bug: 15426766 Change-Id: If0b7f59a59824e30aa0c33dad76c7a44932180de
* Don't call dlsym from signal context in signal chainDave Allison2014-09-162-21/+63
| | | | | | | | | | | | | | | | | | | | | It is dangerous to call dlsym from within a signal context since it takes a lock and can lead to a mutex reentry attempt if timing is bad. This change adds an initialization function to the signal chain that calls dlsym for sigaction and sigprocmask from outside the signal context (from Runtime::Init()). The results are cached in a static variable and used from within the signal context if necessary. However, tests don't necessarily call Runtime::Init() so we also need to deal with the case where the signal chain is not initialized and perform a lazy initialization from inside sigaction or sigprocmask. This is always outside a signal context since we have not initialized the runtime. Bug: 17498571 Change-Id: I59eebfc67cc91c6f1d781a73e5d432ca5269ee48
* Fix mac build and signal testDave Allison2014-08-291-0/+1
| | | | Change-Id: I58311285db9095ca6339ce29a9f15e841b7c822d
* Fix signal chain to allow for signal() call to be usedDave Allison2014-08-281-4/+52
| | | | | Bug: 17320614 Change-Id: Ia917307fb1b593644f524518e11e295b3c64be01
* Handle nested signalsDave Allison2014-08-271-5/+13
| | | | | | | | | | | | | | | | | This allows for signals to be raised inside the ART signal handler. This can occur when the JavaStackTraceHandler attempts to generate a stack trace and something goes wrong. It also fixes an issue where the fault manager was not being correctly shut down inside the signal chaining code. In this case the signal handler was not restored to the original. Bug: 17006816 Bug: 17133266 (cherry picked from commit fabe91e0d558936ac26b98d2b4ee1af08f58831d) Change-Id: I10730ef52d5d8d34610a5293253b3be6caf4829e
* Fix fault handler to unregister on shutdownDave Allison2014-08-211-2/+1
| | | | | | | | | | | This fixes a problem with the fault handler where it wasn't unregistering itself during shutdown of the runtime. Bug: 17133266 (cherry picked from commit e8b9afcd0cd86b8808af29a97332038aab70c604) Change-Id: I1a4ec4292ec049046dda30769265680201729efb
* Revert "Revert "Revert "Revert "Add implicit null and stack checks for x86""""Dave Allison2014-07-162-0/+35
| | | | | | | This reverts commit 0025a86411145eb7cd4971f9234fc21c7b4aced1. Bug: 16256184 Change-Id: Ie0760a0c293aa3b62e2885398a8c512b7a946a73
* Remove object_utils.h.Ian Rogers2014-07-161-0/+3
| | | | | | | | | Break into object_lock, field_helper and method_helper. Clean up header files following this. Also tidy some of the Handle code in response to compiler errors when resolving the changes in this CL. Change-Id: I73e63015a0f02a754d0866bfaf58208aebcaa295
* Revert "Revert "Revert "Add implicit null and stack checks for x86"""Nicolas Geoffray2014-07-112-29/+0
| | | | | | | | Broke the build. This reverts commit 7fb36ded9cd5b1d254b63b3091f35c1e6471b90e. Change-Id: I9df0e7446ff0913a0e1276a558b2ccf6c8f4c949
* Revert "Revert "Add implicit null and stack checks for x86""Dave Allison2014-07-102-0/+29
| | | | | | | | | Fixes x86_64 cross compile issue. Removes command line options and property to set implicit checks - this is hard coded now. This reverts commit 3d14eb620716e92c21c4d2c2d11a95be53319791. Change-Id: I5404473b5aaf1a9c68b7181f5952cb174d93a90d
* Merge "Revert "Add implicit null and stack checks for x86""Dave Allison2014-07-092-29/+0
|\
| * Revert "Add implicit null and stack checks for x86"Dave Allison2014-07-102-29/+0
| | | | | | | | | | | | | | | | It breaks cross compilation with x86_64. This reverts commit 34e826ccc80dc1cf7c4c045de6b7f8360d504ccf. Change-Id: I34ba07821fc0a022fda33a7ae21850957bbec5e7
* | Merge "Add implicit null and stack checks for x86"Dave Allison2014-07-092-0/+29
|\ \ | |/
| * Add implicit null and stack checks for x86Dave Allison2014-07-092-0/+29
| | | | | | | | | | | | | | | | | | | | | | This adds compiler and runtime changes for x86 implicit checks. 32 bit only. Both host and target are supported. By default, on the host, the implicit checks are null pointer and stack overflow. Suspend is implemented but not switched on. Change-Id: I88a609e98d6bf32f283eaa4e6ec8bbf8dc1df78a
* | Remove incorrect check for sa_mask in signal chainingDave Allison2014-07-091-5/+0
|/ | | | | | | | | | | | This removes an incorrect check using the sa_mask field of the sigaction structure when chaining to a user's signal handler. The check prevented a user's handler being called when sa_mask was set. Thanks to primiano@ for the excellent bug report. Bug: 16005022 Change-Id: I0548003f4fc3b1889a6859091e603ead4a9b0607
* Multilib ART host.Ian Rogers2014-06-241-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Build ART for the host as a multilib project with dalvikvm32 and dalvikvm64 running as 32 or 64-bit repsectfully. Note, currently multilib host builds are not the default, you make the so by setting BUILD_HOST_64bit=1. Extend tests to execute in both 32 and 64-bit modes. By default both 32 and 64-bit tests are run, add 32 or 64 to the end of a test name to run it in purely that flavor. Given the extra spam, modify oat tests to only generate console output when the test fails. Change the test harness so that common commands are run when a test should be skipped, when it passes or when it fails. Use these commands to generate a summary of passing, skipped and failing tests. Tests will be skipped if they are known to be broken or if a test has already failed. Setting the variable TEST_ART_KEEP_GOING=true will force working tests not to be skipped. In this change all tests running on the optimizing compiler are marked broken due to breakages running them in a multilib environment. Break apart Android.common.mk into its constituent parts, along with other pieces of reorganization. Stylistic nit, we refer to make rule targets as targets thereby overloading the term target. While consistent with make's terminology, its confusing with the Android notion of target. I've switched to just calling targets rules to avoid confusion in host tests. Change-Id: I5190fc3de46800a949fbb06b3f4c258ca89ccde9
* Make use of sigchainlib for signal chaining for implicit checksDave Allison2014-05-293-0/+241
This adds a preload library that overrides sigaction and sigprocmask to implement signal chaining. Signal chaining allows us to chain any signal so that the ART runtime receives it before any signal handler registered in native code by an application. If the ART signal handler doesn't want it, it will pass it on to the user's handler. ART uses signals for null pointer checks, stack overflow checks and suspend points. Also adds an OAT test to test this in isolation. Change-Id: I9545f9f7343774c091410eb810504d9855fd399f