Skip to content

Support backtrace after method calls#3065

Merged
matz merged 2 commits into
mruby:masterfrom
kou:support-backtrace-after-method-calls
Dec 29, 2015
Merged

Support backtrace after method calls#3065
matz merged 2 commits into
mruby:masterfrom
kou:support-backtrace-after-method-calls

Conversation

@kou
Copy link
Copy Markdown
Contributor

@kou kou commented Dec 29, 2015

GitHub: fix #2902, #2917

The current implementation traverses stack to retrieve backtrace. But
stack will be changed when some operations are occurred. It means that
backtrace may be broken after some operations.

This change (1) saves the minimum information to retrieve backtrace when
exception is raised and (2) restores backtrace from the minimum
information when backtrace is needed. It reduces overhead for creating
backtrace Ruby objects.

The space for the minimum information is reused by multiple
exceptions. So memory allocation isn't occurred for each exception.

GitHub: fix mruby#2902, mruby#2917

The current implementation traverses stack to retrieve backtrace. But
stack will be changed when some operations are occurred. It means that
backtrace may be broken after some operations.

This change (1) saves the minimum information to retrieve backtrace when
exception is raised and (2) restores backtrace from the minimum
information when backtrace is needed. It reduces overhead for creating
backtrace Ruby objects.

The space for the minimum information is reused by multiple
exceptions. So memory allocation isn't occurred for each exception.
@matz
Copy link
Copy Markdown
Member

matz commented Dec 29, 2015

Travis failed.

@kou
Copy link
Copy Markdown
Contributor Author

kou commented Dec 29, 2015

Do you know how to disable backtrace related tests when -g isn't passed to mrbc?
Backtrace related tests are meaningless when we use mrbc without -g because mrbc without -g doesn't generate file/lineno information.

@kou
Copy link
Copy Markdown
Contributor Author

kou commented Dec 29, 2015

0ebac02 is an implementation of disabling backtrace related tests when backtrace isn't available.

@matz
Copy link
Copy Markdown
Member

matz commented Dec 29, 2015

Looks reasonable.

matz added a commit that referenced this pull request Dec 29, 2015
@matz matz merged commit ee3fa1b into mruby:master Dec 29, 2015
@kou kou deleted the support-backtrace-after-method-calls branch December 30, 2015 02:26
kou added a commit to groonga/groonga that referenced this pull request Dec 30, 2015
It's for using backtrace related crash fix:
mruby/mruby#3065
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

broken exception backtraces

2 participants