Taking screenshot (sometimes) crashes client [Linux client 4.7.2]

Bug reports and discussion about bugs.
Post Reply
User avatar
jezek
Posts: 23
Joined: Tue Mar 10, 2020 3:07 pm

Taking screenshot (sometimes) crashes client [Linux client 4.7.2]

Post by jezek »

Client: TomeNET 4.7.2 for Linux (amd64), complete (sound and music pack included) (147 MB)

Steps to reproduce:
0) Loged in, standing int town.
1) Take a screenshot (^T)

Expected behaviour:
Message about screenshot taken, game continues.

Current behaviour:
Client crashes with no message

Note: I tink I was able to take screenshot while in some menu, it always crashed in game.

Temporary solution: Don't take screenshots, put any other macro on ^T key to avoid accidental triggering.

User avatar
jezek
Posts: 23
Joined: Tue Mar 10, 2020 3:07 pm

Re: Taking screenshot (sometimes) crashes client [Linux client 4.7.2]

Post by jezek »

Last edited by jezek on Sun Apr 05, 2020 3:52 pm, edited 1 time in total.

mikaelh
Developer
Posts: 202
Joined: Sun Dec 13, 2009 3:18 pm

Re: Taking screenshot (sometimes) crashes client [Linux client 4.7.2]

Post by mikaelh »

I think you meant to link this commit: https://github.com/jezek/tomenet/commit ... 1bcdc1d2c0

Some of the changes are a bit unnecessary. color_table variable doesn't really need to be renamed. The actual bug seems to be the use of sizeof. You should use the N_ELEMENTS macro from common/defines.h instead of writing it out as sizeof(str_color_table)/sizeof(str_color_table[0]). I think only two lines need to be changed. You can add a comment somewhere if you like.

User avatar
jezek
Posts: 23
Joined: Tue Mar 10, 2020 3:07 pm

Re: Taking screenshot (sometimes) crashes client [Linux client 4.7.2]

Post by jezek »

Yes, you are right, I misspasted the link... and you are also right about the variable name change + macro stuff (didn't know bout the macro)... there were really only two line changes with the macro usage...

sorry, all my fault due to noobiness ;) this commit will do it ;)
https://github.com/jezek/tomenet-src/co ... ff=unified
Last edited by jezek on Sun Apr 05, 2020 3:53 pm, edited 1 time in total.

mikaelh
Developer
Posts: 202
Joined: Sun Dec 13, 2009 3:18 pm

Re: Taking screenshot (sometimes) crashes client [Linux client 4.7.2]

Post by mikaelh »

This one has now also been cherry-picked. Thanks for the fix.

Post Reply