tilibs icon indicating copy to clipboard operation
tilibs copied to clipboard

TiLP suddenly closes

Open PrivacyDragon opened this issue 3 years ago • 2 comments

Recently when I try to use TiLP to put programs on my calculator or get them from calc to laptop, TiLP closes after getting the content of my calculator. So I start TiLP, that goes well, I can also just get the screen or calc info. But then when I try to load the calculator's content, directly after it's loaded or even just before, TiLP closes. It happens frequently last time...

Calc:TI 84+ CE(-T Python Edition) OS: 5.6.0.0020 Laptop OS: Linux, OpenSuse Leap 15.1

I ran TiLP via gdb and made a screenshot of the result when it suddenly closed : Screenshot_20201109_210231

PrivacyDragon avatar Nov 10 '20 06:11 PrivacyDragon

Interesting, thanks for the report :)

Given that ram isn't nullptr upon function entry, it looks like params[0]->data is nullptr, which should occur only if the calculator returns... interesting data. On the experimental2 branch, I happen to have added some code to defend against bad input from the calculator in that function (and others), which should prevent the particular crash I envision from the output you're getting. However, at the time of this writing, I advise against using the experimental2 branch for production purposes: I know that I added some bugs when reworking the memory allocation flow in the 84+ DUSB / 89T / Nspire code several weeks ago.

So - in order to simultaneously work around your problem and help debug the issue, you would need to:

  • edit calc_84p.c, which is in the source directory created by install_tilp.sh when you ran it, defaulting to $HOME/lpg/tilibs/trunk/libticalcs/src/ , in order to surround those *ram = ... and *flash = ... lines with if (params[0]->data != NULL) { *ram = ...; } and if (params[1]->data != NULL) { *flash = ...; }, respectively;
  • from the libticalcs root (again, defaulting to $HOME/lpg/tilibs/trunk/libticalcs), run make install;
  • run tilp again under the same conditions. If that still crashes, please run p params[0] and p params[0]->data, and copy-paste the result here.

Thanks in advance :)

debrouxl avatar Nov 10 '20 21:11 debrouxl

Hmm,Yesterday I first tried again, but then there wasn't any problem. Strange? But next time it happens I'll try that.

PrivacyDragon avatar Nov 12 '20 07:11 PrivacyDragon