Skip to content
This repository has been archived by the owner on Apr 17, 2022. It is now read-only.

"You are asking too much" power assert failure #605

Closed
wzdev-ci opened this issue Jun 7, 2009 · 15 comments
Closed

"You are asking too much" power assert failure #605

wzdev-ci opened this issue Jun 7, 2009 · 15 comments

Comments

@wzdev-ci
Copy link
Contributor

wzdev-ci commented Jun 7, 2009

keyword_power resolution_fixed type_bug | by Per


Playing skirmish on Miza.

error   |04:50:32: [requestPowerFor] you are asking too much
error   |04:50:32: [requestPowerFor] Assert in Warzone: power.c:448 (asPower[player].powerRequested < 1000), last script event: '14 (CALL_STRUCTBUILT)'
warzone2100: power.c:448: requestPowerFor: Assertion `asPower[player].powerRequested < 1000' failed.

Program received signal SIGABRT, Aborted.
0x00000030fb832f05 in raise (sig=<value optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64	  return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);
Missing separate debuginfos, use: debuginfo-install alsa-lib-1.0.20-1.fc10.x86_64 freetype-2.3.7-3.fc10.x86_64 libxcb-1.1.91-6.fc10.x86_64
(gdb) bt
#0  0x00000030fb832f05 in raise (sig=<value optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1  0x00000030fb834a73 in abort () at abort.c:88
#2  0x00000030fb82bef9 in __assert_fail (assertion=0x6fd710 "asPower[player].powerRequested < 1000", file=0x6fd2dc "power.c", line=448, function=0x6fd750 "requestPowerFor") at assert.c:78
#3  0x0000000000560a8f in requestPowerFor (player=0, amount=2952.00024, points=410) at power.c:448
#4  0x00000000005b4731 in aiUpdateStructure (psStructure=0x3467c10, mission=false) at structure.c:3405
#5  0x00000000005b5a4d in structureUpdate (psBuilding=0x3467c10, mission=false) at structure.c:3754
#6  0x0000000000516f77 in gameLoop () at loop.c:373
#7  0x00000000005193de in runGameLoop () at main.c:653
#8  0x00000000005197bf in mainLoop () at main.c:841
#9  0x0000000000519e25 in main (argc=1, argv=0x7fffffffe368) at main.c:1069
(gdb) frame 3
#3  0x0000000000560a8f in requestPowerFor (player=0, amount=2952.00024, points=410) at power.c:448
448		ASSERT(asPower[player].powerRequested < 1000, "you are asking too much");
(gdb) up
#4  0x00000000005b4731 in aiUpdateStructure (psStructure=0x3467c10, mission=false) at structure.c:3405
warning: Source file is more recent than executable.
3405						psFactory->timeToBuild -= progress;
(gdb) p powerNeeded
$1 = 2952.00024
(gdb) p ((DROID_TEMPLATE *)pSubject)->powerPoints
$2 = 62
(gdb) p secondsElapsed
$3 = 410
(gdb) p secondsToBuild
$4 = 8.61111069
(gdb) p gameTime
$5 = 744622
(gdb) p psFactory->timeStarted
$6 = 333726
(gdb) p ((DROID_TEMPLATE*)pSubject)->buildPoints
$7 = 310
(gdb) p (float)psFactory->productionOutput
$8 = 36
(gdb) p psStructure->player
$10 = 0 '\0'
(gdb) p selectedPlayer
$11 = 7

Issue migrated from trac:605 at 2022-04-15 18:52:12 -0700

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Jun 7, 2009

Per uploaded file ticket605stuff.txt (2.4 KiB)

Uncluttered version of the ticket contents

@wzdev-ci
Copy link
Contributor Author

Per changed priority from major to blocker

@wzdev-ci
Copy link
Contributor Author

Per changed title from "You are asking too much" power to "You are asking too much" power assert failure

@wzdev-ci
Copy link
Contributor Author

Per commented


Also see #629

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Jul 25, 2009

toy commented


Replying to Warzone2100/old-trac-import#605 (comment:1):

Also see #629

I might be experiencing a similar problem:

never   |12:49:29: [proj_checkBurnDamage] Burn damage of 13 to object 161968, player 0
attack  |12:49:29: [structureDamage] structure 161968, body 243, armour 20, damage: 13
attack  |12:49:29: [objDamage] objDamage(161968): body 243 armour 20 damage: 13
error   |12:49:29: [usePower] not enough power
error   |12:49:29: [usePower] Assert in Warzone: /Users/toyl/warzone/macosx/../src/power.c:156 (asPower[player].currentPower >= quantity), last script event: 'everySec'
/Users/toyl/warzone/macosx/../src/power.c:156: failed assertion `asPower[player].currentPower >= quantity'

Program received signal SIGABRT, Aborted.
0x96fa9e42 in __kill ()
(gdb) bt
#0  0x96fa9e42 in __kill ()
#1  0x96fa9e34 in kill$UNIX2003 ()
#2  0x9701c23a in raise ()
#3  0x97028679 in abort ()
#4  0x002a90dd in __eprintf (string=0x0, expression=0x0, line=0, filename=0x0) at /var/tmp/gcc/gcc-5493~1/src/gcc/libgcc2.c:1838
#5  0x0016e2fc in usePower (player=0, quantity=450) at /Users/toyl/warzone/macosx/../src/power.c:156
#6  0x0015775a in recvResearch () at /Users/toyl/warzone/macosx/../src/multiplay.c:824
#7  0x0015730b in recvMessage () at /Users/toyl/warzone/macosx/../src/multiplay.c:669
#8  0x00156550 in multiPlayerLoop () at /Users/toyl/warzone/macosx/../src/multiplay.c:262
#9  0x0011fb9d in gameLoop () at /Users/toyl/warzone/macosx/../src/loop.c:264
#10 0x0012270f in runGameLoop () at /Users/toyl/warzone/macosx/../src/main.c:654
#11 0x00122c9f in mainLoop () at /Users/toyl/warzone/macosx/../src/main.c:842
#12 0x0012354b in SDL_main (argc=1, argv=0x130e450) at /Users/toyl/warzone/macosx/../src/main.c:1077
#13 0x002a8dbd in -[SDLMain applicationDidFinishLaunching:] (self=0x132b6b0, _cmd=0x9658c944, note=0x131d290) at /Users/toyl/warzone/macosx/external/SDL/src/main/macosx/SDLMain.m:302

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Jul 25, 2009

toy commented


Replying to Warzone2100/old-trac-import#605 (comment:2):

Replying to Warzone2100/old-trac-import#605 (comment:1):

Also see #629

I might be experiencing a similar problem:

An "ok" fix?

Index: src/multiplay.c
===================================================================
--- src/multiplay.c	(revision 7892)
+++ src/multiplay.c	(working copy)
@@ -821,7 +821,10 @@
 
 		// Take off the power if available
 		pResearch = asResearch + index;
-		usePower(player, pResearch->researchPower);
+		if(checkPower(player, pResearch->researchPower))
+		{
+			usePower(player, pResearch->researchPower);
+		}
 	}
 
 	// Update allies research accordingly

@wzdev-ci
Copy link
Contributor Author

Zarel commented


Erm, no, that's completely the wrong way to go about it.

usePower() should be rewritten not to assert when too much power is being asked for.

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Jul 25, 2009

toy commented


Replying to Warzone2100/old-trac-import#605 (comment:4):

Erm, no, that's completely the wrong way to go about it.

usePower() should be rewritten not to assert when too much power is being asked for.

Why? What's checkPower() written for then? Sorry, I don't know how all the stats should be kept... but the comment "// Take off the power if available" kinda suggest that it's ok to not take power if it's not available (i.e. if it doesn't pass checkPower()).

@wzdev-ci
Copy link
Contributor Author

Zarel edited the issue description

@wzdev-ci
Copy link
Contributor Author

Per commented


I believe the issue is that when power information goes out of sync (as it often does in MP games), then some players will appear to use more power than they have. Blocking their production requests will make the game go further out of sync.

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Oct 4, 2009

gitsvngateway changed status from new to closed

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Oct 4, 2009

gitsvngateway set resolution to fixed

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Oct 4, 2009

gitsvngateway commented


(In [8204]) Remove the "you are asking too much" power assert, as it is sometimes legitimate to ask for a lot of power (after lagging for a few seconds in multiplayer for example). Fixes bug 605 and fixes bug 401.

From: Gerard Krol gerard_@gna.org

@wzdev-ci wzdev-ci closed this as completed Oct 4, 2009
@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Jan 3, 2012

cybersphinx changed milestone from 3.0 to unspecified

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Jan 3, 2012

cybersphinx commented


Milestone 3.0 deleted

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant