| Summary: | SIGSEGV on SDL_stack_alloc | ||
|---|---|---|---|
| Product: | SDL | Reporter: | olivier <olivier-dion> |
| Component: | render | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | trivial | ||
| Priority: | P2 | CC: | icculus |
| Version: | HG 2.0 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
|
Description
olivier
2017-12-06 18:16:21 UTC
The behavior is undefined and that check is only helpful on platforms that return NULL from alloca(). Are you proposing rewriting alloca() for Linux so that it returns NULL? If so, feel free to attach a proposed implementation. I see. Wouldn't be possible to check the count before using alloca, and if it's too high call malloc? I could simply make multiple call to SDL_RenderDrawLines with differents pointers I guess. Yes, that would be possible, though the number of lines that are safe would vary from system to system and application to application, depending on how much stack space is left. We could use some general rule of thumb though... Out of curiosity, how many lines does it take to crash in your case? In the order of 2^20. I know it's a huge number of lines. And like I said, I should be able to do so by passing different intervals at a time. One option would be to define a macro, system dependent, with the -D option, or something similar. In the latest in revision control, these are heap allocated instead of stack allocated, resolving this problem. --ryan. |