Stack smashing detected tensorflow
![stack smashing detected tensorflow stack smashing detected tensorflow](https://i.stack.imgur.com/TGrJ3.png)
Yes, this is exactly the problematic code. If anyone can provide any help or insight it would be much appreciated. Why can I not instantiate one on the stack of this function in particular? *They* instantiate crystal_packets on *their* stacks without a complaint.and I can run them as many times as I want! But a single call to crystal_keystroke() and everything explodes.
![stack smashing detected tensorflow stack smashing detected tensorflow](https://n0vice.gitee.io/2021/01/20/Canary保护的6种绕过姿势/7.png)
![stack smashing detected tensorflow stack smashing detected tensorflow](https://miro.medium.com/max/768/1*VXZ8CamGG2Z0M0N4t0Fmng.jpeg)
Why shouldn't I be able to do it that way? An additional bit of intrigue: I already have a *lot* of other functions, separate from main, that I'm using the same way as I'm trying to use crystal_keystroke(), that I've concocted for interfacing with the device in various ways.
#Stack smashing detected tensorflow code#
The only thing I am trying to do differently from that is to instantiate the crystal_packet struct on crystal_keystroke's stack instead of main's stack, so that I don't have to keep a struct in memory on main's stack that I'm not using most of the time (and make main's code a bit bulkier). Int keystroke = crystal_packet(response) Oddly (in my perception), I discovered that if I instantiate the crystal_packet struct on main's stack instead of on crystal_keystroke's stack, and pass it by reference to crystal_keystroke, everything works dandily. Apparently it has to do with addressing memory illegally (similar to a segfault, but somehow different), but I don't see any way I'm doing that. I've read a little bit about what this means but I don't quite understand it, or why it's happening here. The problem is that if I try to put this *exact* same code into a separate function called crystal_keystroke(), change the last line to return response.data as the result, and call "int keypress = crystal_keystroke()" from main, the program craps out with a backtrace and the complaint "Stack smashing detected." This seems to occur on the "return" line of crystal_keystroke(). Now, this code works without a hitch *if* it's sitting right in main(). Most of this snippet isn't relevant to my problem - it's just the logistics of communicating with the device - suffice it to say that at the end of this snippet, a key on the CrystalFontz has been pressed and "keypress" contains an indicator telling me which one. If (!crystal_get(response)) response.type = 0