You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Thursday, May 19th 2011, 11:39pm

New Feature for KPAT (Grandfather mode [one deal winnable mode])

A while back I modified my debian lenny 4.3.5.10 version of kpat to add a number of deals indicator, and some code to save the random seed number when the game was winnable in only 1 deal of the cards. I accumulated
over 500 of these PREMIUM card shuffle seeds, and wanted to add a mode to kpat allowing one to play in a special one deal winnable mode which would select grandfather kpat seeds from this saved file in semi random order.
I added all of the code and tested the pieces separately, but when the whole thing is together, it always segfaults (acessing address 0) even though none of the pointers or variables have zero in them. I think it is getting
confused across thread boundaries or something. This small patch file includes all of the changes I made to the 4.3.5.10 kdegames source. If anyone can give me a clue what is going on and point me in the right direction I would greatly appreciate it. Thanks Barry Mead (Primarily a C programmer C++ still confuses me somewhat). My system is running debian lenny 5.6 with kde-3.5.10 qt-3.3 kernel version 2.6.26-2-686 It is a 64-bit Intel quad core cpu but running the 32-bit version of debian linux. The KpatGrandfOneDeal file goes into the $HOME/.kde/share/config/ directory so that it can be found by the program just like the kpatrc file. Using the debugger I studied all of the pointers, and even the machine code instructions and registers, and it seg faults without any of the registers pointing to memory area zero? How can this be?

This post has been edited 3 times, last edit by "BarryBMead" (May 31st 2011, 7:56pm)


2

Tuesday, May 31st 2011, 5:14am

I solved the problem. It turns out that the (supposedly thread safe rand_r() function was causing kde to crash) I still don't know what it is about that function that crashed kde but it does! When I wrote my own
random number function, the problem went away. Attached is the corrected patch file which works.
BarryBMead has attached the following file:
  • kpat.zip (8.21 kB - 0 times downloaded)

This post has been edited 3 times, last edit by "BarryBMead" (May 31st 2011, 7:54pm)