Nim/lib/system
Ștefan Talpalaru a1c82c39af
asyncdispatch+stackTraceOverride: fix premature collection (#18039) [backport:1.2]
Copying StackTraceEntry instances when nimStackTraceOverride is defined
breaks the link between a cstring field that's supposed to point at
another string field in the same object.

Sometimes, the original object is garbage collected, that memory region
reused for storing other strings, so when the StackTraceEntry copy tries
to use its cstring pointer to construct a traceback message, it accesses
unrelated strings.

This only happens for async tracebacks and this patch prevents that by
making sure we only use the string fields when nimStackTraceOverride is
defined.

Async tracebacks also beautified slightly by getting rid of an extra line
that was supposed to be commented out, along with the corresponding debugging output.

There's also a micro-optimisation to avoid concatenating two strings just
to get their combined length.
2021-05-19 19:19:11 +02:00
..
mm styleCheck: Fix some inconsistent identifiers (#16177) 2020-12-21 09:41:56 -08:00
alloc.nim minor cleanups (#17948) 2021-05-06 13:27:40 +02:00
ansi_c.nim system.nim cleanup some exported constants which should never have be… (#17909) 2021-05-01 11:10:40 +02:00
arc.nim Replace double backticks with single backticks - Part 1 out of ~6 (#17205) 2021-02-28 23:08:12 -08:00
arithm.nim use lowercase --define switches (#17283) 2021-03-07 12:08:41 +01:00
arithmetics.nim Replace double backticks with single backticks - Part 1 out of ~6 (#17205) 2021-02-28 23:08:12 -08:00
assertions.nim fixes #17033 [backport:1.4] (#17061) 2021-02-17 11:00:03 +01:00
assign.nim cString => cSourceString; tyCString => tyCstring so that error msgs show cstring, not cString (#17744) 2021-04-17 11:14:09 +02:00
atomics.nim [docs minor] remove unicode in docs comments (#16267) 2020-12-06 05:51:29 +01:00
avltree.nim make AVL tree node part of the memory regions; fixes hard to reproduce channel crashes 2017-01-31 13:08:47 +01:00
basic_types.nim Replace double backticks with single backticks - Part 1 out of ~6 (#17205) 2021-02-28 23:08:12 -08:00
bitmasks.nim ARC now capable of custom extra alignment. Ref, closure and seq support. (#15697) 2020-10-28 14:00:49 +01:00
cellseqs_v1.nim more checking for --gc:arc, no need for valgrind (#14467) 2020-05-29 12:08:17 +02:00
cellseqs_v2.nim arc allocation method aligned (#15588) 2020-10-19 14:50:06 +02:00
cellsets.nim cleaned up the internal documentation (#17524) 2021-03-26 16:27:55 +01:00
cgprocs.nim Initial version of the hot-code reloading support for native targets (#10729) 2019-02-26 15:48:55 +01:00
channels_builtin.nim rename channels to channels_builtin (#17330) 2021-03-12 13:04:32 +01:00
chcks.nim [os:standalone]fix #14011 (#17564) 2021-03-29 17:54:28 +02:00
comparisons.nim implement RFCs/294 ; disallow enum <=> enum conversion (#16351) 2021-04-03 07:15:21 +02:00
coro_detection.nim system.nim cleanup some exported constants which should never have be… (#17909) 2021-05-01 11:10:40 +02:00
countbits_impl.nim follow up #17539 (#17548) 2021-03-29 09:11:07 +08:00
cyclebreaker.nim ORC: prepare for another patent-pending optimization (#15996) 2020-11-18 22:31:06 +01:00
deepcopy.nim ARC now capable of custom extra alignment. Ref, closure and seq support. (#15697) 2020-10-28 14:00:49 +01:00
dollars.nim Replace double backticks with single backticks - Part 1 out of ~6 (#17205) 2021-02-28 23:08:12 -08:00
dyncalls.nim Genode platform fixes (#17521) 2021-04-09 16:29:10 +02:00
embedded.nim ensure the avr example keeps compiling (#17663) 2021-04-07 13:40:57 +02:00
exceptions.nim asyncdispatch+stackTraceOverride: fix premature collection (#18039) [backport:1.2] 2021-05-19 19:19:11 +02:00
excpt.nim Fix C++ compilation error in excpt.nim (#17951) 2021-05-06 22:33:57 +02:00
fatal.nim fix #16499 (#16514) 2021-01-04 18:27:58 +01:00
formatfloat.nim Revert "printing float values will have one more digit. (#13276) [backport]" (#13363) 2020-02-08 09:30:24 +01:00
gc.nim Remove the use of usrToCell in gcMark [backport:1.2] (#17709) 2021-04-14 12:10:01 +02:00
gc2.nim followup #17225: simplify code after removing gc2, generational (#17242) 2021-03-03 13:37:42 +01:00
gc_common.nim fixes #17647 (#17667) 2021-04-07 23:26:53 +02:00
gc_hooks.nim gc:destructors progress 2019-09-16 23:54:31 +02:00
gc_interface.nim fixes #13881 2020-05-12 15:46:24 +02:00
gc_ms.nim Remove the use of usrToCell in gcMark [backport:1.2] (#17709) 2021-04-14 12:10:01 +02:00
gc_regions.nim styleCheck: Fix some inconsistent identifiers (#16177) 2020-12-21 09:41:56 -08:00
hti.nim cString => cSourceString; tyCString => tyCstring so that error msgs show cstring, not cString (#17744) 2021-04-17 11:14:09 +02:00
inclrtl.nim remove all uses of condsyms symbols defined prior to bootstrap nim 0.20.0 (#16918) 2021-02-17 09:32:36 +01:00
indexerrors.nim [other] better error message for IndexError for empty containers (#11476) 2019-06-11 14:34:21 +02:00
integerops.nim fixes #14209 [backport:1.2] (#14213) 2020-05-05 00:48:13 +02:00
io.nim system.nim cleanup some exported constants which should never have be… (#17909) 2021-05-01 11:10:40 +02:00
iterators.nim further progress on rst roles & directives (fix #17646) (#17659) 2021-04-08 19:00:14 +02:00
iterators_1.nim Change stdlib imports to use std prefix in most examples (#17202) 2021-02-28 13:17:19 -08:00
jssys.nim [backport:1.4] JS cstring null fixes (#16979) 2021-02-11 17:04:32 +01:00
memalloc.nim [docs]close #12580 (#17549) 2021-03-28 20:21:27 -07:00
memory.nim remove all uses of condsyms symbols defined prior to bootstrap nim 0.20.0 (#16918) 2021-02-17 09:32:36 +01:00
memtracker.nim addQuitProc => addExitProc (#16765) 2021-01-22 19:51:11 +01:00
mmdisp.nim fix #15617(fix compilation failure on -d:useMalloc --gc:none) (#17555) 2021-03-30 20:15:14 +02:00
nimscript.nim Replace double backticks with single backticks - Part 2 out of ~6 (#17206) 2021-02-28 23:15:26 -08:00
orc.nim ORC: progress (#18000) 2021-05-12 22:00:37 +02:00
osalloc.nim add OpenBSD MAP_STACK for coroutines (#14353) 2020-05-16 21:56:52 +02:00
platforms.nim fix #17941: UnusedImport works for var/let/const/type invoked inside a generic (#17942) 2021-05-08 09:56:46 +02:00
profiler.nim Give better error message when profiler and memProfiler used at same time (#9948) 2018-12-19 10:02:20 +01:00
repr.nim cString => cSourceString; tyCString => tyCstring so that error msgs show cstring, not cString (#17744) 2021-04-17 11:14:09 +02:00
repr_v2.nim fix #17812 (repr fails to compile with ARC/ORC) (#17816) 2021-04-22 08:08:56 +02:00
reprjs.nim cString => cSourceString; tyCString => tyCstring so that error msgs show cstring, not cString (#17744) 2021-04-17 11:14:09 +02:00
seqs_v2.nim ARC: fixes memory leaks with newSeq used in a loop [backport:1.4] (#18040) 2021-05-18 21:45:37 +02:00
seqs_v2_reimpl.nim arc allocation method aligned (#15588) 2020-10-19 14:50:06 +02:00
setops.nim better setops docs (#16236) 2020-12-03 14:47:44 +01:00
sets.nim close #11330 sets uses optimized countSetBits (#17334) 2021-03-22 00:36:48 +01:00
stacktraces.nim Replace double backticks with single backticks - Part 2 out of ~6 (#17206) 2021-02-28 23:15:26 -08:00
strmantle.nim remove all uses of condsyms symbols defined prior to bootstrap nim 0.20.0 (#16918) 2021-02-17 09:32:36 +01:00
strs_v2.nim rename prepareStrMutation to prepareMutation (#17235) 2021-03-03 08:08:52 +08:00
syslocks.nim Revert "fix #14873 properly by skipping abi field in importc type (#17944)" (#17992) 2021-05-15 06:50:39 +02:00
sysspawn.nim [std/locks]close #7998(complete condition variables) (#17711) 2021-04-19 10:51:13 +02:00
sysstr.nim followup #17225: simplify code after removing gc2, generational (#17242) 2021-03-03 13:37:42 +01:00
threadlocalstorage.nim [std/locks]close #7998(complete condition variables) (#17711) 2021-04-19 10:51:13 +02:00
threads.nim make the copy operation of Thread an error (#17734) 2021-04-16 08:50:44 +02:00
timers.nim miscellaneous bug fixes (#13291) 2020-01-30 10:54:50 +01:00
widestrs.nim Rename = to =copy in stdlib (#17781) 2021-04-19 13:16:10 +02:00