Dungeon Crawl Stone Soup Tracker - DCSS
|
|||||
Viewing Issue Advanced Details | |||||
|
|||||
ID: | Category: | Severity: | Reproducibility: | Date Submitted: | Last Update: |
11861 | Bug Report | crash | random | 2019-02-07 17:13 | 2019-02-07 17:13 |
|
|||||
Reporter: | advil | Local or Remote: | Both | ||
Assigned To: | Operating System: | All | |||
Priority: | normal | Console or Tiles: | Both | ||
Status: | new | Product Branch: | 0.24 old branch | ||
Product Version: | all | Resolution: | open | ||
Projection: | none | ||||
ETA: | none | Fixed in Branch: | |||
|
|||||
Summary: | 0011861: Lua error handling vs c++ stack | ||||
Description: |
Currently, we use lua in C mode, by wrapping the header includes in an `extern` block. This causes lua to use setjmp/longjmp for error handling. This isn't a great idea for C++ code, and can lead to memory leaks or stack corruption. We should probably start using lua in c++ mode (which has worked in my tests, but would need a lot more testing). Nice summary of the state of affairs from a useful SO thread*: "setjmp()/longjmp() completely subvert stack unwinding and therefore exception handling as well as RAII (destructors in general)." When bad longjmp calls happen, they result in pretty opaque crashlogs (usually with an empty or uninterpretable stack), and even when run in a debugger don't usually result in an interpretable stack trace, so based on some recent experience with these crashes (see https://github.com/crawl/crawl/commit/091e5a18feeb [^] ), I wouldn't be surprised if many of the more opaque crashlogs we encounter could be related. [*] https://stackoverflow.com/questions/1376085/c-safe-to-use-longjmp-and-setjmp [^] |
||||
Steps To Reproduce: | |||||
Additional Information: | |||||
System Description: | |||||
Relationships | |||||
Attached Files: | |||||
|
|||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2019-02-07 17:13 | advil | New Issue |
There are no notes attached to this issue. |