Commit graph

7351 commits

Author SHA1 Message Date
Richard Frith-Macdonald
5c7713cacc Minor tidyups plus config update 2018-04-24 12:24:37 +01:00
Riccardo Mottola
6f7e480913 Detect if platform is missing spin locks and provide an dummy implementation. Emit warning during compilation and runtime (in debug) 2018-04-23 20:37:28 +02:00
Richard Frith-Macdonald
635b71e442 initialise before use 2018-04-16 13:18:36 +01:00
Richard Frith-Macdonald
c2fb3a0954 avoid compiler warning by declaring variable at start of block 2018-04-13 10:55:12 +01:00
Richard Frith-Macdonald
b88e69dceb improve -symbols method on platform without backtrace symbols support 2018-04-13 07:11:15 +01:00
Richard Frith-Macdonald
0043a7be8d Improve workaround; use NSAllocateObject() 2018-04-12 21:41:15 +01:00
Richard Frith-Macdonald
57f78a6a7a temporary workaround for crash 2018-04-12 21:35:48 +01:00
Richard Frith-Macdonald
72ad2656c8 don't create NSLock instances during initialisation 2018-04-12 18:21:19 +01:00
Richard Frith-Macdonald
bc2dd4b627 try to improve startup reliability 2018-04-12 18:08:53 +01:00
Richard Frith-Macdonald
bb85bd426c defer setting lock name to try to avoid crash on bsd 2018-04-10 20:27:05 +01:00
Richard Frith-Macdonald
3ced3237e8 Use standard locks rathere than obsolete lazy lock classes 2018-04-10 14:59:35 +01:00
Richard Frith-Macdonald
6c3d99ea3f fix method name error 2018-04-10 14:29:57 +01:00
Richard Frith-Macdonald
cc410b6bbc Fix for recursive thread registration on one platform. 2018-04-10 09:19:50 +01:00
David Chisnall
847c1a54b7 Avoid memory allocation in NSString -hash.
Use the incremental hash function for long strings.
2018-04-09 16:49:44 +01:00
Richard Frith-Macdonald
7274cbaa55 Minor unicode range handling improvements 2018-04-09 11:55:46 +01:00
David Chisnall
7bf1179f60 Reapply 3b1e94ec5d correctly
This time without accidentally-included files...

If compiling without backtrace or BFD support, we initialise the
location to store return addresses incorrectly, leaving a dangling
pointer which we then right over.

Most consumers never read this, so it seemed to work most of the time by
just overwriting a random bit of memory.

This probably has security implications, because throwing an exception
can clobber random bits of memory, though not with attacker-controlled
data.
2018-04-07 20:04:14 +01:00
David Chisnall
970c8cbd05 Revert "Fix memory corruption in NSException."
Accidentally included unrelated changes.

This reverts commit 3b1e94ec5d.
2018-04-07 20:03:33 +01:00
David Chisnall
3b1e94ec5d Fix memory corruption in NSException.
If compiling without backtrace or BFD support, we initialise the
location to store return addresses incorrectly, leaving a dangling
pointer which we then right over.

Most consumers never read this, so it seemed to work most of the time by
just overwriting a random bit of memory.

This probably has security implications, because throwing an exception
can clobber random bits of memory, though not with attacker-controlled
data.
2018-04-07 11:02:04 +01:00
David Chisnall
0ebb50f984 Fix logic error in GSPrivateRangeOfString.
We were checking if the receiver was a specific class, then directly
accessing an ivar of target.  We were then checking if target is a
specific class and, if so, accessing the ivar or target.

This mostly worked because most GNUstep strings have the same
underlying implementation and so the check was passing and by
coincidence giving the correct value.  This breaks when GSTinyStrings
are used more often and was picked up by teaching the compiler to
generate GSTinyStrings for small string literals.
2018-04-06 10:43:10 +01:00
Gregory Casamento
ced3b27144 Correct minor mispelling of NSLog. Compilation error. 2018-04-04 18:48:41 -04:00
Richard Frith-Macdonald
cc7a146796 More changes to make lock tracking more robust 2018-04-04 14:42:20 +01:00
Richard Frith-Macdonald
603c3b1103 indicate trace by use of subclass rather than flag 2018-04-04 12:58:06 +01:00
Richard Frith-Macdonald
efb4ec5f22 Tweak return value to definitely be YES or NO rather than true/false 2018-03-30 10:45:57 +01:00
Richard Frith-Macdonald
437df42b87 Bugfix for getting stacktrace 2018-03-30 10:43:27 +01:00
Richard Frith-Macdonald
b2f821bb36 make lock tracing safer 2018-03-28 09:28:56 +01:00
Richard Frith-Macdonald
c1f96a1cf4 Simplify locking for time zones 2018-03-27 10:37:53 +01:00
Richard Frith-Macdonald
d6612ef880 Fixes in experimental code 2018-03-27 09:55:29 +01:00
Richard Frith-Macdonald
ebfe915619 Fixups for stack handling 2018-03-27 07:06:17 +01:00
Richard Frith-Macdonald
82675cd3d9 more lock tracing tweaks 2018-03-26 16:35:17 +01:00
Richard Frith-Macdonald
75bf489aec Allow for waiting on a mutex we already own 2018-03-26 16:05:18 +01:00
Richard Frith-Macdonald
05439fe15d Experimental deadlock detection code 2018-03-26 15:20:48 +01:00
Richard Frith-Macdonald
43673452a5 locking debug/performance tweaks 2018-03-26 15:05:01 +01:00
Richard Frith-Macdonald
2d3039694f Stack tyrace generation optimisation 2018-03-26 14:49:13 +01:00
David Chisnall
9b7e3a8fff Make the NSXMLNode ivar a union.
Having the same ivar exposed as different types in different compilation
units is probably a bad idea in general and will break with the new ObjC
ABI, where we have link-time checks for this.  It would also confuse
reflection and any languages that use reflection for bridging in
exciting ways.
2018-03-20 17:44:16 +00:00
Richard Frith-Macdonald
81102fae85 improve logging of http comms and of deadlocks 2018-03-16 15:11:02 +00:00
Richard Frith-Macdonald
7c1b9b4d15 fix style errors 2018-03-15 14:09:14 +00:00
Richard Frith-Macdonald
4233915c06 Fix boundary issues 2018-02-27 15:06:27 +00:00
Richard Frith-Macdonald
c6e4220409 Add _unicodeString method to return GSUnicodeString subclass instance for tests 2018-02-27 15:00:52 +00:00
Richard Frith-Macdonald
776c0bbcd8 Fix boundary checks searching for unicode strings 2018-02-25 22:30:08 +00:00
Richard Frith-Macdonald
984803d922 Put characterset data on one line to avoid misleading line-count of source 2018-02-11 17:07:25 +00:00
Richard Frith-Macdonald
a6c7492c42 avoid checker warning 2018-02-11 17:03:24 +00:00
Richard Frith-Macdonald
b3ce87ff4f tweaks to keep static checker happy 2018-02-11 12:03:52 +00:00
Richard Frith-Macdonald
f72708742a Avoid compiler warnings 2018-02-11 09:46:07 +00:00
Richard Frith-Macdonald
64732ce825 add comment and cast to void 2018-02-09 08:41:11 +00:00
Richard Frith-Macdonald
96e16ba825 improve comment and compiler hint 2018-02-09 08:37:25 +00:00
Richard Frith-Macdonald
006160ebc3 Merge branch 'master' of ssh://github.com/gnustep/libs-base
Conflicts:
	ChangeLog
2018-02-09 08:33:30 +00:00
Richard Frith-Macdonald
c9a1d39055 Fix potential buffer overrun 2018-02-09 08:32:22 +00:00
fredkiefer
2901390d0f * Source/NSXMLElement.m(-addAttribute:): Correct linear list code
for name spaces. This fixes the last remaining Coverity issue.
2018-02-09 00:07:53 +01:00
Richard Frith-Macdonald
323f9abace cast -scanString: return to void where we don't need to check it. 2018-02-08 06:10:47 +00:00
Richard Frith-Macdonald
ab822a35a3 check and warn about failure to set reuseaddr 2018-02-08 06:08:41 +00:00