Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Game crashed when a train is cloned #4495

Closed
DorpsGek opened this issue Feb 9, 2011 · 11 comments
Closed

Game crashed when a train is cloned #4495

DorpsGek opened this issue Feb 9, 2011 · 11 comments
Labels
component: NewGRF This issue is related to NewGRFs flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

DorpsGek commented Feb 9, 2011

Chris_Booth opened the ticket and wrote:

When any train is cloned the Client will crash. I am playing on openttdcoop.Stable server and Playing in coop company with 32 bit windows version

Attachments

Reported version: 1.1.0-beta5
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/4495
@DorpsGek
Copy link
Member Author

DorpsGek commented Feb 9, 2011

Rubidium wrote:

Please attach a savegame and tell which vehicle number to clone to reproduce. Likewise attach the crash.dmp as now we've got fairly little information.


This comment was imported from FlySpray: https://bugs.openttd.org/task/4495#comment9646

@DorpsGek
Copy link
Member Author

DorpsGek commented Feb 9, 2011

Chris_Booth wrote:

Are you blind? Crash.text has the dmp file in it(edit I am stupid you are not blind)


This comment was imported from FlySpray: https://bugs.openttd.org/task/4495#comment9647

@DorpsGek
Copy link
Member Author

DorpsGek commented Feb 9, 2011

Chris_Booth wrote:

have the dmp file

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/4495#comment9648

@DorpsGek
Copy link
Member Author

DorpsGek commented Feb 9, 2011

Chris_Booth wrote:

and png

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/4495#comment9649

@DorpsGek
Copy link
Member Author

DorpsGek commented Feb 9, 2011

Chris_Booth wrote:

Replace trains back to UKRS 3 axle wagon, and EE type 1 it will crash out. Also use the openttdcoop.stable server info

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/4495#comment9650

@DorpsGek
Copy link
Member Author

DorpsGek commented Feb 9, 2011

ali wrote:

i play in openttd. start 16.00 and build company to 19.00. and come back to server 23.00 if i clone old train game cras me and throw out.
but build new trani and clone it no crash.


This comment was imported from FlySpray: https://bugs.openttd.org/task/4495#comment9651

@DorpsGek
Copy link
Member Author

glx wrote:

openttd.exe!VehicleGetVariable(const ResolverObject * object=0x0018f71c, unsigned char variable='C', unsigned char parameter=0x00, bool * available=0x0018f6bf) Ligne 584 + 0x1b octets C++
openttd.exe!GetVariable(const ResolverObject * object=0x02686ee8, unsigned char variable='C', unsigned char parameter=0x00, bool * available=0x0018f6bf) Ligne 69 + 0xb octets C++
openttd.exe!DeterministicSpriteGroup::Resolve(ResolverObject * object=0x0118f71c) Ligne 164 C++
openttd.exe!DeterministicSpriteGroup::Resolve(ResolverObject * object=0x0118f71c) Ligne 195 + 0xe octets C++
openttd.exe!DeterministicSpriteGroup::Resolve(ResolverObject * object=0x0118f71c) Ligne 195 + 0xe octets C++
openttd.exe!GetVehicleCallback(CallbackID callback=CBID_VEHICLE_ARTIC_ENGINE, unsigned int param1=0x00000001, unsigned int param2=0x0018f7ac, unsigned short engine=0x0137, const Vehicle * v=0x00000000) Ligne 1005 C++
openttd.exe!GetNextArticulatedPart(unsigned int index=0x00000001, unsigned short front_type=0x0043, Vehicle * front=0x00000000, bool * mirrored=0x0018f71c) Ligne 35 + 0xc octets C++
openttd.exe!CountArticulatedParts(unsigned short engine_type=0x0000, bool purchase_window=true) Ligne 58 + 0xc octets C++
openttd.exe!CmdBuildVehicle(unsigned int tile=0x00000043, DoCommandFlag flags=DC_NONE, unsigned int p1=0x00010137, unsigned int p2=0x00000000, const char * text=0x00000000) Ligne 111 + 0x6 octets C++
openttd.exe!DoCommand(unsigned int tile=0x000378e9, unsigned int p1=0x00010137, unsigned int p2=0x00000000, DoCommandFlag flags=DC_NONE, unsigned int cmd=0x00000000, const char * text=0x00000000) Ligne 420 + 0x18 octets C++
openttd.exe!CmdCloneVehicle(unsigned int tile=0x00000043, DoCommandFlag flags=DC_NONE, unsigned int p1=0x00000077, unsigned int p2=0x00000000, const char * text=0x00000000) Ligne 707 C++
openttd.exe!DoCommandPInternal(unsigned int tile=0x000378e9, unsigned int p1=0x00000077, unsigned int p2=0x00000000, unsigned int cmd=0x0bab0050, void (const CommandCost &, unsigned int, unsigned int, unsigned int)* callback=0x0045ed8d, const char * text=0x00000000, bool my_cmd=true, bool estimate_only=false) Ligne 635 + 0x13 octets C++
openttd.exe!DoCommandP(unsigned int tile=0x000378e9, unsigned int p1=0x00000077, unsigned int p2=0x00000000, unsigned int cmd=0x00000000, void (const CommandCost &, unsigned int, unsigned int, unsigned int)* callback=0x0045ed8d, const char * text=0x00000000, bool my_cmd=true) Ligne 528 C++
openttd.exe!DepotWindow::OnVehicleSelect(const Vehicle * v=0x026a2b60) Ligne 836 + 0x36 octets C++
openttd.exe!VehicleClicked(const Vehicle * v=0x00000000) Ligne 2594 C++
openttd.exe!HandleViewportClicked(const ViewPort * vp=0x05a7ab88, int x=0x00000000, int y=0x00000000) Ligne 1888 + 0x9 octets C++
openttd.exe!MouseLoop(MouseClick click=MC_LEFT, int mousewheel=0x00000000) Ligne 2204 + 0xf octets C++
openttd.exe!HandleMouseEvents() Ligne 2322 C++
openttd.exe!WndProcGdi(HWND__ * hwnd=, unsigned int msg=, unsigned int wParam=, long lParam=) Ligne 392 C++
user32.dll!_UserCallWinProcCheckWow@32() + 0x66 octets


This comment was imported from FlySpray: https://bugs.openttd.org/task/4495#comment9652

@DorpsGek
Copy link
Member Author

SmatZ wrote:

The company 0 has to be missing - either start the server as dedicated, or as server, join different company and delete_company 0.

Join to "coop", try to clone the train -> crash.

(gdb) bt full
# 0 0x0000000000639ae5 in VehicleGetVariable (object=0x7fffffffd220, variable=, parameter=, available=0x7fffffffd0bf) at /mnt/svn/openttd/tags/1.1.0-beta5/src/newgrf_engine.cpp:584
v = 0x10b43c0
# 1 0x000000000064d2e3 in GetVariable (this=0x15aa9c0, object=0x7fffffffd220) at /mnt/svn/openttd/tags/1.1.0-beta5/src/newgrf_spritegroup.cpp:69
value = 5813125
# 2 DeterministicSpriteGroup::Resolve (this=0x15aa9c0, object=0x7fffffffd220) at /mnt/svn/openttd/tags/1.1.0-beta5/src/newgrf_spritegroup.cpp:161
adjust = 0x15aaa00
available = true
last_value = 0
value =
i = 0

(gdb) p v->owner
$1 = {static begin = , static end = , static invalid = , m_val = 0 '\000'}

(gdb) p v
$2 = {<PoolItem<&_vehicle_pool>> = {index = 980}, = {type = {m_val = 255 '\377'}}, _vptr.Vehicle = 0x8a9e70, next = 0x0, previous = 0x0, first = 0x10b43c0, next_shared = 0x0, previous_shared = 0x0, name = 0x0, tile = 0, dest_tile = 0, profit_this_year = {m_value = 0}, profit_last_year = {m_value = 0}, value = {m_value = 0}, cargo_payment = 0x0, current_order_time = 0, lateness_counter = 0, timetable_start = 0, coord = {left = 2147483647, top = 0, right = 0, bottom = 0}, next_hash = 0x0, prev_hash = 0x0, next_new_hash = 0x0, prev_new_hash = 0x0, old_new_hash = 0x0, colourmap = 0, build_year = 0, age = 0, max_age = 0, date_of_last_service = 0, service_interval = 0, reliability = 0, reliability_spd_dec = 0, breakdown_ctr = 0 '\000', breakdown_delay = 0 '\000', breakdowns_since_last_service = 0 '\000', breakdown_chance = 0 '\000', x_pos = 0, y_pos = 0, z_pos = 0 '\000', direction = {static begin = , static end = , static invalid = , m_val = 0 '\000'}, owner = {static begin = , static end = , static invalid = , m_val = 0 '\000'}, spritenum = 0 '\000', cur_image = 0, x_extent = 0 '\000', y_extent = 0 '\000', z_extent = 0 '\000', x_offs = 0 '\000', y_offs = 0 '\000', engine_type = 302, fill_percent_te_id = 65535, unitnumber = 0, cur_speed = 0, subspeed = 0 '\000', acceleration = 0 '\000', motion_counter = 0, progress = 0 '\000', random_bits = 0 '\000', waiting_triggers = 0 '\000', last_station_visited = 0, cargo_type = 0 '\000', cargo_subtype = 0 '\000', cargo_cap = 0, cargo = {<CargoList> = {count = 0, cargo_days_in_transit = 0, packets = {<std::_List_base<CargoPacket
, std::allocator<CargoPacket*> >> = {_M_impl = {<std::allocator<std::_List_node<CargoPacket*> >> = {<__gnu_cxx::new_allocator<std::_List_node<CargoPacket*> >> = {}, }, _M_node = {_M_next = 0x10b44c8, _M_prev = 0x10b44c8}}}, }}, feeder_share = {m_value = 0}}, day_counter = 0 '\000', tick_counter = 0 '\000', running_ticks = 0 '\000', vehstatus = 0 '\000', current_order = {<PoolItem<&_order_pool>> = {index = 0}, type = 0 '\000', flags = 0 '\000', dest = 0, refit_cargo = 254 '\376', refit_subtype = 0 '\000', next = 0x0, wait_time = 0, travel_time = 0}, cur_real_order_index = 0 '\000', cur_auto_order_index = 0 '\000', orders = {list = 0x0, old = 0x0}, vehicle_flags = 0 '\000', load_unload_ticks = 0, group_id = 65534, subtype = 0 '\000', grf_cache = {position_consist_length = 0, position_same_id_length = 0, consist_cargo_information = 0, company_information = 0, cache_valid = 0 '\000'}, vcache = {cached_max_speed = 0, cached_vis_effect = 0 '\000'}}

{type = {m_val = 255 '\377'}} -> VEH_INVALID? It looks like it is a vehicle currently under construction - all variables are set to zero, and type hasn't been set yet.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/4495#comment9653

@DorpsGek
Copy link
Member Author

SmatZ wrote:

Better backtrace:

Program received signal SIGSEGV, Segmentation fault.
0x000000000063c0e3 in Company::IsHumanID (index=0) at /mnt/svn/openttd/tags/1.1.0-beta5/src/company_base.h:141
141 return !Company::Get(index)->is_ai;
(gdb) bt
# 0 0x000000000063c0e3 in Company::IsHumanID (index=0) at /mnt/svn/openttd/tags/1.1.0-beta5/src/company_base.h:141
# 1 0x0000000000736f1b in VehicleGetVariable (object=0x7fffffffd020, variable=67 'C', parameter=0 '\000',
available=0x7fffffffce53) at /mnt/svn/openttd/tags/1.1.0-beta5/src/newgrf_engine.cpp:584
# 2 0x000000000074e206 in GetVariable (object=0x7fffffffd020, variable=67 'C', parameter=0 '\000', available=0x7fffffffce53)
at /mnt/svn/openttd/tags/1.1.0-beta5/src/newgrf_spritegroup.cpp:69
# 3 0x000000000074e341 in DeterministicSpriteGroup::Resolve (this=0x19b68e0, object=0x7fffffffd020)
at /mnt/svn/openttd/tags/1.1.0-beta5/src/newgrf_spritegroup.cpp:161
# 4 0x00000000007058b6 in SpriteGroup::Resolve (group=0x19b68e0, object=0x7fffffffd020)
at /mnt/svn/openttd/tags/1.1.0-beta5/src/newgrf_spritegroup.h:85
# 5 0x000000000074e56b in DeterministicSpriteGroup::Resolve (this=0x19b6ce0, object=0x7fffffffd020)
at /mnt/svn/openttd/tags/1.1.0-beta5/src/newgrf_spritegroup.cpp:195
# 6 0x00000000007058b6 in SpriteGroup::Resolve (group=0x19b6ce0, object=0x7fffffffd020)
at /mnt/svn/openttd/tags/1.1.0-beta5/src/newgrf_spritegroup.h:85
# 7 0x000000000074e56b in DeterministicSpriteGroup::Resolve (this=0x19b6d90, object=0x7fffffffd020)
at /mnt/svn/openttd/tags/1.1.0-beta5/src/newgrf_spritegroup.cpp:195
# 8 0x00000000007058b6 in SpriteGroup::Resolve (group=0x19b6d90, object=0x7fffffffd020)
at /mnt/svn/openttd/tags/1.1.0-beta5/src/newgrf_spritegroup.h:85
# 9 0x000000000074e56b in DeterministicSpriteGroup::Resolve (this=0x19b7250, object=0x7fffffffd020)
at /mnt/svn/openttd/tags/1.1.0-beta5/src/newgrf_spritegroup.cpp:195
# 10 0x00000000007058b6 in SpriteGroup::Resolve (group=0x19b7250, object=0x7fffffffd020)
at /mnt/svn/openttd/tags/1.1.0-beta5/src/newgrf_spritegroup.h:85
# 11 0x0000000000738b3d in GetVehicleCallback (callback=CBID_VEHICLE_ARTIC_ENGINE, param1=1, param2=0, engine=302, v=
0x144b820) at /mnt/svn/openttd/tags/1.1.0-beta5/src/newgrf_engine.cpp:1004
# 12 0x000000000060712e in GetNextArticulatedPart (index=1, front_type=302, front=0x144b820, mirrored=0x0)
at /mnt/svn/openttd/tags/1.1.0-beta5/src/articulated_vehicles.cpp:35
# 13 0x00000000006072b7 in CountArticulatedParts (engine_type=302, purchase_window=false)
at /mnt/svn/openttd/tags/1.1.0-beta5/src/articulated_vehicles.cpp:58
# 14 0x00000000008aee17 in CmdBuildVehicle (tile=23987, flags=DC_NONE, p1=65838, p2=0, text=0x0)
at /mnt/svn/openttd/tags/1.1.0-beta5/src/vehicle_cmd.cpp:111
# 15 0x00000000006288ce in DoCommand (tile=23987, p1=65838, p2=0, flags=DC_NONE, cmd=195756061, text=0x0)
at /mnt/svn/openttd/tags/1.1.0-beta5/src/command.cpp:420
# 16 0x00000000008b0ded in CmdCloneVehicle (tile=23987, flags=DC_NONE, p1=231, p2=0, text=0x0)
at /mnt/svn/openttd/tags/1.1.0-beta5/src/vehicle_cmd.cpp:705
# 17 0x00000000006291ef in DoCommandPInternal (tile=23987, p1=231, p2=0, cmd=195756112, callback=
0x643c49 <CcCloneVehicle(CommandCost const&, TileIndex, uint32, uint32)>, text=0x0, my_cmd=true, estimate_only=false)
at /mnt/svn/openttd/tags/1.1.0-beta5/src/command.cpp:635
# 18 0x0000000000628d31 in DoCommandP (tile=23987, p1=231, p2=0, cmd=195756112,
callback=0x643c49 <CcCloneVehicle(CommandCost const&, TileIndex, uint32, uint32)>, text=0x0, my_cmd=true)
at /mnt/svn/openttd/tags/1.1.0-beta5/src/command.cpp:527


This comment was imported from FlySpray: https://bugs.openttd.org/task/4495#comment9654

@DorpsGek
Copy link
Member Author

SmatZ wrote:

The VEH_INVALID vehicle is allocated at articulated_vehicles.cpp:52
v = new Vehicle();


This comment was imported from FlySpray: https://bugs.openttd.org/task/4495#comment9655

@DorpsGek
Copy link
Member Author

glx closed the ticket.

Reason for closing: Fixed

In r22048


This comment was imported from FlySpray: https://bugs.openttd.org/task/4495

@DorpsGek DorpsGek added flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) component: NewGRF This issue is related to NewGRFs bug labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: NewGRF This issue is related to NewGRFs flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant