.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

Raging Tiger- Save $9.00
winSPMBT: Main Battle Tank- Save $6.00

   







Go Back   .com.unity Forums > Illwinter Game Design > Dominions 3: The Awakening

Reply
 
Thread Tools Display Modes
  #2311  
Old December 1st, 2008, 03:11 PM
JimMorrison's Avatar

JimMorrison JimMorrison is offline
Lieutenant General
 
Join Date: May 2008
Location: Utopia, Oregon
Posts: 2,676
Thanks: 83
Thanked 143 Times in 108 Posts
JimMorrison is on a distinguished road
Default Re: Bug Thread: Discussion

Quote:
Originally Posted by lch View Post
Quote:
Originally Posted by Loren View Post
I've been playing with the Vampiri mod race and three times now during turn generation Dominions has vanished. Loading it up and hitting End Turn always works, though.
"Vanished" is not a useful error report. The game gives an error message when it crashes, you should copy and paste that to determine the kind of problem there is.
It's only not useful if it's not clarified in any way. But Dominions still has the "CTD during turn resolution" problem sometimes, and when that occurs, it just dumps you to desktop without any fanfare or explanation. It certainly sounds like that is what Loren is reporting (I think it was listed in the patch notes as fixed in 3.21, but I can confirm seeing it since then as well).
Reply With Quote
  #2312  
Old December 1st, 2008, 03:38 PM

Loren Loren is offline
First Lieutenant
 
Join Date: Nov 2006
Posts: 739
Thanks: 1
Thanked 8 Times in 8 Posts
Loren is on a distinguished road
Default Re: Bug Thread: Discussion

Quote:
Originally Posted by lch View Post
Quote:
Originally Posted by Loren View Post
I've been playing with the Vampiri mod race and three times now during turn generation Dominions has vanished. Loading it up and hitting End Turn always works, though.
"Vanished" is not a useful error report. The game gives an error message when it crashes, you should copy and paste that to determine the kind of problem there is.
I mean vanished. No error message. One instant it's there, the next it's gone. I've never seen exactly what phase of the turn generation it's on when it happens.

This probably means a stack overflow.
Reply With Quote
  #2313  
Old December 1st, 2008, 03:39 PM

Loren Loren is offline
First Lieutenant
 
Join Date: Nov 2006
Posts: 739
Thanks: 1
Thanked 8 Times in 8 Posts
Loren is on a distinguished road
Default Re: Bug Thread: Discussion

Quote:
Originally Posted by JimMorrison View Post
Quote:
Originally Posted by lch View Post
Quote:
Originally Posted by Loren View Post
I've been playing with the Vampiri mod race and three times now during turn generation Dominions has vanished. Loading it up and hitting End Turn always works, though.
"Vanished" is not a useful error report. The game gives an error message when it crashes, you should copy and paste that to determine the kind of problem there is.
It's only not useful if it's not clarified in any way. But Dominions still has the "CTD during turn resolution" problem sometimes, and when that occurs, it just dumps you to desktop without any fanfare or explanation. It certainly sounds like that is what Loren is reporting (I think it was listed in the patch notes as fixed in 3.21, but I can confirm seeing it since then as well).
This sounds exactly like what I'm seeing.
Reply With Quote
  #2314  
Old December 1st, 2008, 08:25 PM
vfb's Avatar

vfb vfb is offline
General
 
Join Date: Mar 2007
Location: Japan
Posts: 3,691
Thanks: 269
Thanked 397 Times in 200 Posts
vfb is on a distinguished road
Default Re: Bug Thread: Discussion

In-game messages like "I'm setting taxes to 0% so you go bankrupt" can cause the turn to crash when they are viewed.

The game formats messages that are displayed on the screen using one of the printf calls. It should pass ( ..., "%s", message ) for user-entered messages. But instead it passes ( ..., message ). So if 'message' contains printf formatting, it will expect additional arguments. And if the printf code is '%s' (spaces between the '%' and 's' don't matter), it will treat whatever happens to be on the stack as an address to read a string from. If this address is invalid, that can cause a crash.
__________________
Whether he submitted the post, or whether he did not, made no difference. The Thought Police would get him just the same. He had committed— would still have committed, even if he had never set pen to paper— the essential crime that contained all others in itself. Thoughtcrime, they called it. Thoughtcrime was not a thing that could be concealed forever.
http://z7.invisionfree.com/Dom3mods/index.php?
Reply With Quote
  #2315  
Old December 2nd, 2008, 08:21 AM
Soyweiser's Avatar

Soyweiser Soyweiser is offline
Colonel
 
Join Date: Nov 2008
Posts: 1,735
Thanks: 272
Thanked 120 Times in 93 Posts
Soyweiser is on a distinguished road
Default Re: Bug Thread: Discussion

Quote:
Originally Posted by vfb View Post
In-game messages like "I'm setting taxes to 0% so you go bankrupt" can cause the turn to crash when they are viewed.

The game formats messages that are displayed on the screen using one of the printf calls. It should pass ( ..., "%s", message ) for user-entered messages. But instead it passes ( ..., message ). So if 'message' contains printf formatting, it will expect additional arguments. And if the printf code is '%s' (spaces between the '%' and 's' don't matter), it will treat whatever happens to be on the stack as an address to read a string from. If this address is invalid, that can cause a crash.
This is a serious problem. This can cause much more than a simple crash. If someone makes a malicious message, it could take over your computer.

http://en.wikipedia.org/wiki/Format_string_attack
Reply With Quote
  #2316  
Old December 2nd, 2008, 07:26 PM

MaxWilson MaxWilson is offline
Major General
 
Join Date: Mar 2007
Location: Seattle
Posts: 2,497
Thanks: 165
Thanked 105 Times in 73 Posts
MaxWilson is on a distinguished road
Default Re: Bug Thread: Discussion

Oh, wow. %n does not modify the output from printf but instead treats its arguments are a memory address and sets it to the number of characters printed so far. That raises the threat potential from printing out the contents of your Dom3 process to modifying memory, including the instruction pointer. http://julianor.tripod.com/bc/formatstring-1.2.pdf

It's interesting that vfb reports that this will cause crashes. Maybe Dom3 is compiled in a mode that does stricter checking of printf, and throws an exception if the wrong number of arguments is supplied. In that case it's not a security threat after all.

-Max
__________________
Bauchelain - "Qwik Ben iz uzin wallhax! HAX!"
Quick Ben - "lol pwned"

["Memories of Ice", by Steven Erikson. Retranslated into l33t.]
Reply With Quote
  #2317  
Old December 2nd, 2008, 07:53 PM
vfb's Avatar

vfb vfb is offline
General
 
Join Date: Mar 2007
Location: Japan
Posts: 3,691
Thanks: 269
Thanked 397 Times in 200 Posts
vfb is on a distinguished road
Default Re: Bug Thread: Discussion

Quote:
Originally Posted by MaxWilson View Post
Oh, wow. %n does not modify the output from printf but instead treats its arguments are a memory address and sets it to the number of characters printed so far. That raises the threat potential from printing out the contents of your Dom3 process to modifying memory, including the instruction pointer. http://julianor.tripod.com/bc/formatstring-1.2.pdf

It's interesting that vfb reports that this will cause crashes. Maybe Dom3 is compiled in a mode that does stricter checking of printf, and throws an exception if the wrong number of arguments is supplied. In that case it's not a security threat after all.

-Max
No, I just said %s will cause crashes. I did not think of %n, I was not aware of that actually.

The printf call used does check for a null argument to %s on the stack and prints "(null)" in that case, but it's going to seg fault (crash) if there's something on the stack like a random integer value.

It's impossible to do a compile-time check of the printf arg count when the format string itself is variable. And that's the problem here, the format string should be "%s" instead of the user-entered message.

It's also impossible for a library function like printf to know how many arguments it was actually passed. Whatever is on the stack is just there, and it will try to use it according to the format string.
__________________
Whether he submitted the post, or whether he did not, made no difference. The Thought Police would get him just the same. He had committed— would still have committed, even if he had never set pen to paper— the essential crime that contained all others in itself. Thoughtcrime, they called it. Thoughtcrime was not a thing that could be concealed forever.
http://z7.invisionfree.com/Dom3mods/index.php?
Reply With Quote
  #2318  
Old December 3rd, 2008, 07:58 AM
lch's Avatar

lch lch is offline
General
 
Join Date: Feb 2007
Location: R'lyeh
Posts: 3,861
Thanks: 144
Thanked 403 Times in 176 Posts
lch is on a distinguished road
Default Re: Bug Thread: Discussion

Black Laurel, Ivy Crown and Crown of the Ivy King do not provide an armor to the wearer, bug or WAD? I remember that a couple of crowns were missing their armor, and KO said something like "remind me of any other crowns like this".
__________________
Come to the Dom3 Wiki and help us to build the biggest Dominions-centered knowledge base on the net.
Visit my personal user page there, too!
Pretender file password recovery
Emergency comic relief
Reply With Quote
  #2319  
Old December 3rd, 2008, 08:00 AM
Tifone's Avatar
Tifone Tifone is offline
Lieutenant Colonel
 
Join Date: Jun 2008
Location: Florence, Italy
Posts: 1,424
Thanks: 740
Thanked 112 Times in 63 Posts
Tifone is on a distinguished road
Default Re: Bug Thread: Discussion

Should they provide armor? They're leaves after all
Reply With Quote
  #2320  
Old December 4th, 2008, 04:27 PM

Dectilon Dectilon is offline
Corporal
 
Join Date: Jan 2008
Posts: 143
Thanks: 6
Thanked 8 Times in 6 Posts
Dectilon is on a distinguished road
Default Re: Bug Thread: Discussion

I don't know if this has been mentioned but:

If I use the random map generator once, quit that game and generate a new map I get the exact same map grahpics but with each province redefined (water provinces will often be land and vice versa).
Reply With Quote
Reply

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 04:58 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2024, Shrapnel Games, Inc. - All Rights Reserved.