OpenTTD

Tasklist

FS#3218 - OTTD Crashes on wrong GRF

Attached to Project: OpenTTD
Opened by George (George) - Sunday, 20 September 2009, 04:49 GMT
Last edited by Remko Bijker (Rubidium) - Monday, 21 September 2009, 18:37 GMT
Type Bug
Category NewGRF → NewIndustries
Status Closed
Assigned To No-one
Operating System All
Severity Medium
Priority Normal
Reported Version trunk
Due in Version 0.7.3
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

r17560

When the grf has wrong definition industry definition (two parts are located on the same tile), OTTD crashes when trying to build the industry of the wrong layout. It should report the wrong GRF instead.

This task depends upon

Closed by  Remko Bijker (Rubidium)
Monday, 21 September 2009, 18:37 GMT
Reason for closing:  Fixed
Additional comments about closing:  In r17605
Comment by Remko Bijker (Rubidium) - Sunday, 20 September 2009, 05:28 GMT
... and where is the wrong GRF so we can actually test whether our fix is correct?
Comment by George (George) - Sunday, 20 September 2009, 05:48 GMT
layout 6 for Steel mill crashes the game when industry is build
Comment by George (George) - Sunday, 20 September 2009, 05:50 GMT
Wrong (part 36 is build over part 34), crashes OTTD:
00 01 FE 34 00
00 02 FE 34 00
04 01 FE 35 00
05 01 FE 35 00
04 02 FE 35 00
05 02 FE 35 00
00 01 FE 36 00
00 02 FE 36 00
01 00 FE 37 00
02 00 FE 37 00
04 03 FE 37 00
05 03 FE 37 00
02 01 FE 38 00
02 02 FE 38 00
00 03 FE 39 00
01 03 FE 39 00
00 80

Correct, works fine:
00 01 FE 34 00
00 02 FE 34 00
04 01 FE 35 00
05 01 FE 35 00
04 02 FE 35 00
05 02 FE 35 00
01 01 FE 36 00
01 02 FE 36 00
01 00 FE 37 00
02 00 FE 37 00
04 03 FE 37 00
05 03 FE 37 00
02 01 FE 38 00
02 02 FE 38 00
00 03 FE 39 00
01 03 FE 39 00
00 80
Comment by Loïc GUILLOUX (glx) - Sunday, 20 September 2009, 17:40 GMT
> openttd.exe!NewIndustryTileResolver(ResolverObject * res=0x0012f9f0, unsigned short gfx=232, unsigned int tile=232608, Industry * indus=0x00000000) Ligne 161 + 0x2f octets C++
openttd.exe!DrawNewIndustryTile(TileInfo * ti=0x00000000, Industry * i=0x00000000, unsigned short gfx=232, const IndustryTileSpec * inds=0x00000000) Ligne 255 C++
openttd.exe!DrawTile_Industry(TileInfo * ti=0x00000000) Ligne 320 + 0x11 octets C++
openttd.exe!ViewportAddLandscape() Ligne 1048 C++
openttd.exe!ViewportDoDraw(const ViewPort * vp=0x00000000, int left=9432, int top=9534, int right=0, int bottom=0) Ligne 1496 C++
openttd.exe!ViewportDrawChk(const ViewPort * vp=0x00000000, int left=0, int top=256, int right=640, int bottom=576) Ligne 1549 C++
openttd.exe!Window::DrawViewport() Ligne 1578 + 0x6f octets C++
openttd.exe!NWidgetViewport::Draw(const Window * w=0x032b2518) Ligne 1881 C++
openttd.exe!NWidgetPIPContainer::Draw(const Window * w=0x032b2518) Ligne 1346 + 0xb octets C++
openttd.exe!Window::DrawWidgets() Ligne 702 C++
openttd.exe!MainWindow::OnPaint() Ligne 225 C++
openttd.exe!DrawOverlappedWindow(Window * w=0x00000000, int left=0, int top=256, int right=640, int bottom=576) Ligne 557 + 0x7 octets C++
openttd.exe!DrawOverlappedWindowForAll(int left=512, int top=256, int right=640, int bottom=576) Ligne 574 C++
openttd.exe!RedrawScreenRect(int left=512, int top=0, int right=0, int bottom=0) Ligne 1373 C++
openttd.exe!DrawDirtyBlocks() Ligne 1457 + 0xb octets C++
openttd.exe!UpdateWindows() Ligne 2430 C++
openttd.exe!VideoDriver_Win32::MainLoop() Ligne 891 C++
openttd.exe!ttd_main(int argc=, char * * argv=) Ligne 742 C++
openttd.exe!WinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, char * lpCmdLine=0x0015232f, int nCmdShow=1) Ligne 380 + 0x9 octets C++
openttd.exe!__tmainCRTStartup() Ligne 263 + 0x1b octets C
kernel32.dll!7c816d4f()
[Les frames ci-dessous sont peut-être incorrects et/ou manquants, aucun symbole chargé pour kernel32.dll]
Comment by frosch (frosch) - Sunday, 20 September 2009, 19:58 GMT
From reading the source (sorry, without testing), I assume:
"DoCommand(cur_tile, 0, 0, DC_EXEC | DC_NO_TEST_TOWN_RATING | DC_NO_MODIFY_TOWN_RATING, CMD_LANDSCAPE_CLEAR);" at industry_cmd::1636 deletes the industry currently being constructed.
Comment by Remko Bijker (Rubidium) - Sunday, 20 September 2009, 20:51 GMT
Building the 6th steel mill with the given NewGRF does cause any crash for me. Do you have a savegame that reproduces the crash?
Comment by George (George) - Monday, 21 September 2009, 03:32 GMT
Destroy the Wronninghall steel mill and build a new one at that place
(application/octet-stream)    -1.sav (579.4 KiB)
Comment by Remko Bijker (Rubidium) - Monday, 21 September 2009, 06:25 GMT
I don't have the machinery vector from that savegame; it isn't the one you attached before because that one is loaded as the compatible one.
Comment by George (George) - Monday, 21 September 2009, 16:52 GMT
It is easily reproduceable here. Here is the same problem for layout 5.

Loading...