misbehaving system halting work
coderman at protonmail.com
Fri Feb 26 09:14:22 PST 2021
-----BEGIN PGP SIGNED MESSAGE-----
i haven't had time to dig into this much, but one thing stuck out to me
in how you're using the FTDI content and functions.
here you initialize the ftdi_content, but are using a local structure variable:
once you return from LibFTDISerial::is_libftdi () function, the ftdi_context will be destroyed.
you'll notice that this context must live as long as the process, otherwise
references to it will become invalid, leading to stack / heap corruption.
for example, this usage calls from main(), where the ftdi_context will
exist as long as the program is running:
you could solve this by declaring a static (global) ftdi_context, however,
this entails locking / concurrency concerns.
i hope this helps. perhaps later this weekend i dig in depth into your problems.
-----BEGIN PGP SIGNATURE-----
-----END PGP SIGNATURE-----
More information about the cypherpunks