Page 1 of 1

Double Payout When Stopping Tournament

Posted: Mon Sep 11, 2023 9:06 am
by BearMetal
About 3 years ago, I noticed that if I stop a running tournament the prize pool will be equally distributed to the remaining seated players. This "chop" mechanism has worked flawlessly several times a week since 2020. This week, I updated to v7.16 and on Sunday night, my players asked for a chop. When I stopped the tournament, it paid out 2x as much money as was in the prize pool. You can clearly see that extra payout given to player "Ian":

Code: Select all

Tournament=Sunday Night Smackdown
Number=623
Currency=Primary
BuyIn=10+0
Bounty=0
PrizeBonus=0
MultiplyBonus=No
Entrants=7
Uniques=7
Late=3
Tickets=0
Removed=0
Rebuys=10
AddOns=0
RebuyCost=10+0
NetBonus=0
AutoChop=No
PlayerChop=No
Start=2023-09-10 20:04:08
Place7=Dennis (0) Paid:10 Rebuys:0 KO:Ethan
Place6=Tom (0) Paid:30 Rebuys:2 KO:Ira
Place5=Jonathan-M (0) Paid:30 Rebuys:2 KO:Ian
Place4=Ira (0) Paid:20 Rebuys:1 KO:Ian
Place3=Marty (0) Paid:30 Rebuys:2 KO:Ethan
Place1=Ian (119) Paid:20 Rebuys:1 KO:Ian
Place1=Ian (119) Paid:20 Rebuys:1 KO:Ian
Place1=Ethan (85) Paid:30 Rebuys:2 KO:
Stop=2023-09-10 22:34:38 (Abort)
Looking at the logs, there was a pointer error encountered:

Code: Select all

2023-09-10 22:36:39|Error closing tournament Sunday Night Smackdown: Invalid pointer operation
2023-09-10 22:36:39|Tournament close stack trace 7.16: 
    00407f95 PMService.exe System         15457 TObject.FreeInstance - 004a5a0d PMService.exe madExcept            InterceptClassDestroy - 00408151 PMService.exe System         15516 TObject.Destroy - 00408160 PMService.exe System         15524 TObject.Free - 0058fdb6 PMService.exe System.Contnrs   340 TObjectList.Notify - 00521d84 PMService.exe System.Classes  4455 TList.SetCount - 00521877 PMService.exe System.Classes  4188 TList.Clear - 0072cabc PMService.exe Tournaments     1061 TTournament.CloseTourney - 0072b116 PMService.exe Tournaments      658 TTourneyThread.Execute - 004a5d4b PMService.exe madExcept            HookedTThreadExecute - 005381e9 PMService.exe System.Classes 14561 ThreadProc - 00409d78 PMService.exe System         23406 ThreadWrapper - 004a5c31 PMService.exe madExcept            CallThreadProcSafe - 004a5c96 PMService.exe madExcept            ThreadExceptFrame - 76136a37 KERNEL32.DLL                       BaseThreadInitThunk

Re: Double Payout When Stopping Tournament

Posted: Mon Sep 11, 2023 9:31 am
by Kent Briggs
Something definitely got corrupted there. It's odd that the code exception occurred a full 2 minutes after the tournament was aborted. Do the payouts shown in that results file match the chip transactions recorded in the Event Log?

Re: Double Payout When Stopping Tournament

Posted: Mon Sep 11, 2023 9:55 am
by BearMetal
Yes, they match the event log:

Code: Select all

2023-09-10 22:34:38|Admin|TournamentsAction from A-00000012 (Administrator)
2023-09-10 22:34:38|Table|Sunday Night Smackdown closed (Administrator)
2023-09-10 22:34:38|Account|Ian +119 balance 868.26 (Sunday Night Smackdown prize)
2023-09-10 22:34:38|House|Tourney -119 balance -288.63 (Ian prize from Sunday Night Smackdown)
2023-09-10 22:34:38|Account|Ian +85 balance 953.26 (Sunday Night Smackdown prize)
2023-09-10 22:34:38|Account|Ethan +85 balance 196 (Sunday Night Smackdown prize)
2023-09-10 22:34:38|House|Tourney -170 balance -458.63 (Abort Sunday Night Smackdown)
Something else interesting is the chat message is missing the extra $85 but includes the incorrect $170 (I am attaching an image that was sent to me when the error happened).

Re: Double Payout When Stopping Tournament

Posted: Mon Sep 11, 2023 1:07 pm
by Kent Briggs
BearMetal wrote: Mon Sep 11, 2023 9:55 am Yes, they match the event log:
Actually they differ because the results file shows Ian getting 119 + 119 whereas the event log show 119 + 85. Either way he shouldn't have been listed twice. Nothing in my code shows how that could even be possible, other than some memory corruption issue. I'm not able to duplicate the error. Anyway, make sure you completely stop and restart the poker service if you haven't already and let me know if it happens again.

Re: Double Payout When Stopping Tournament

Posted: Mon Sep 11, 2023 1:27 pm
by BearMetal
Ah, you are right; the events only show the extra 119 in addition to the correct 85, but the results file shows two 119's and no 85's. I agree that this behavior seems to be very unlikely from a code logic error and more likely something with memory corruption. I believe that I upgraded to v7.16 last Wednesday. On Friday night, I had a successful stop in order to chop. And then the issue we're discussing happened on Sunday during another stop to chop.

I've already bounced my PM server and I will see if it happens again. One more thing to mention. While looking at the error logs, I did also see this from a few days earlier:

Code: Select all

2023-09-08 11:12:57|ValidateThread error: HTTP/1.1 500 Internal Server Error
2023-09-08 11:12:57|ValidateThread stack trace 7.16: 006f7ffe PMService.exe IdHTTP          2837 CheckException - 006f84f2 PMService.exe IdHTTP          3036 TIdHTTPProtocol.ProcessResponse - 006f8ac6 PMService.exe IdHTTP          3171 TIdCustomHTTP.DoRequest - 006f88b1 PMService.exe IdHTTP          3126 TIdCustomHTTP.Get - 006f87db PMService.exe IdHTTP          3114 TIdCustomHTTP.Get - 006f3f82 PMService.exe IdHTTP          1136 TIdCustomHTTP.Get - 008ab1b4 PMService.exe Main             633 TValidateThread.Execute - 004a5d4b PMService.exe madExcept            HookedTThreadExecute - 005381e9 PMService.exe System.Classes 14561 ThreadProc - 00409d78 PMService.exe System         23406 ThreadWrapper - 004a5c31 PMService.exe madExcept            CallThreadProcSafe - 004a5c96 PMService.exe madExcept            ThreadExceptFrame - 76136a37 KERNEL32.DLL                       BaseThreadInitThunk
09/08 is the Friday that I chopped another tournament by stopping it. However, I chopped it much later at 11:36pm and this chop was correct.

Code: Select all

Place1=Gregg (60) Paid:20 Rebuys:0 KO:
Place1=Tom (60) Paid:20 Rebuys:0 KO:
Stop=2023-09-08 23:36:08 (Abort)
I only mention this because Poker Mavens is probably one of the most stable pieces of software I've ever used. Literally I've had a handful of errors in the 3+ years it's been running 24/7. So, maybe related? Too much of a coincidence ...

Re: Double Payout When Stopping Tournament

Posted: Mon Sep 11, 2023 2:55 pm
by Kent Briggs
My web site at pokermavens.net was down for about 9 hours the other night (no idea why) so that's likely the cause of the ValidateThread error. It was not tournament related.