Commit Graph

16 Commits

Author SHA1 Message Date
Ș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
Alexander Ivanov
56584414f3 Make await a template (#12085)
* Make await a template
* Generate await inside async/multisync
2020-04-25 20:27:03 +02:00
Arne Döring
afbcd1b330 int128 on firstOrd, lastOrd and lengthOrd (#11701)
* fixes #11847
2019-08-07 15:53:16 +02:00
Andreas Rumpf
ac458448d8 make async tests green again 2019-07-11 11:09:10 +02:00
Araq
b2f9447896 make tests green again 2019-07-10 23:32:04 +02:00
Yuriy Glukhov
511d7079a1 Fixed tests 2018-06-06 20:04:37 +03:00
Yuriy Glukhov
5d166fcc0a Review comments addressed. More thorough line info tracking. 2018-05-10 00:27:50 +03:00
Dominik Picheta
72d9485e8e Fix tasync_traceback test. 2018-01-11 16:52:14 +00:00
Dominik Picheta
b7713859ab Use regex to match output of tasync_traceback. 2018-01-11 16:15:53 +00:00
Dominik Picheta
7e6dc3679a Simplify async traceback processing. 2017-12-28 09:21:22 +01:00
Dominik Picheta
383c80971c No need to recurse now that mergeEntries doesn't do any pattern matching. 2017-12-28 09:21:22 +01:00
Dominik Picheta
6301e33543 Show only detailed async tracebacks. 2017-12-28 09:21:22 +01:00
Dominik Picheta
3a790c9c72 Rename cb0 to asyncProcName_continue + other improvements to async tracebacks. 2017-12-28 09:21:22 +01:00
Dominik Picheta
a9a13e470b Go through the re-raise stacks for more detailed tracebacks. 2017-12-28 09:21:22 +01:00
Dominik Picheta
9ca6afe73a Refine the async tracebacks. 2017-12-28 09:21:22 +01:00
Dominik Picheta
f73015ad9e Implement some simple pattern-based transformation for async tracebacks. 2017-12-28 09:21:22 +01:00