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

Crash when viewing AI textfile and switching to Random AI #7088

Closed
SamuXarick opened this issue Jan 23, 2019 · 5 comments
Closed

Crash when viewing AI textfile and switching to Random AI #7088

SamuXarick opened this issue Jan 23, 2019 · 5 comments
Milestone

Comments

@SamuXarick
Copy link
Contributor

@SamuXarick SamuXarick commented Jan 23, 2019

An example
AIAI version 97 has a changelog.txt

Steps:

  • launch openttd
  • click AI/GS Settings
  • click Select AI
  • select AIAI and click Accept
  • click Changelog
  • without closing Changelog, and without selecting another slot
  • click Select AI
  • select Random AI and click Accept

Crash!

@SamuXarick
Copy link
Contributor Author

@SamuXarick SamuXarick commented Jan 23, 2019

@LordAro
Copy link
Member

@LordAro LordAro commented Jan 23, 2019

Found the cause of the issue:

GetConfig(slot)->Change(NULL);

sets the slot to "null" (except that it's not actually NULL - see script_config.cpp)

Which is followed by getting the name of the "null" slot:

SetDParamStr(1, GetConfig(slot)->GetName());

@LordAro LordAro changed the title Crash when changelog.txt, readme.txt, license.txt do not exist Crash when viewing AI textfile and switching to Random AI Jan 24, 2019
SamuXarick added a commit to SamuXarick/OpenTTD that referenced this issue Jan 24, 2019
SamuXarick added a commit to SamuXarick/OpenTTD that referenced this issue Jan 25, 2019
SamuXarick added a commit to SamuXarick/OpenTTD that referenced this issue Jan 30, 2019
SamuXarick added a commit to SamuXarick/OpenTTD that referenced this issue Jan 30, 2019
SamuXarick added a commit to SamuXarick/OpenTTD that referenced this issue Mar 1, 2019
SamuXarick added a commit to SamuXarick/OpenTTD that referenced this issue Mar 1, 2019
@stale
Copy link

@stale stale bot commented Mar 25, 2019

This issue has been automatically marked as stale because it has not had any activity in the last two months.
If you believe the issue is still relevant, please test on the latest nightly and report back.
It will be closed if no further activity occurs within 7 days.
Thank you for your contributions.

@stale stale bot added the stale label Mar 25, 2019
@SamuXarick
Copy link
Contributor Author

@SamuXarick SamuXarick commented Mar 25, 2019

Still crashes

openttd.exe!Utf8Decode(unsigned int * c, const char * s) Line 452 C++
openttd.exe!Utf8Consume(const char * * s) Line 90 C++
openttd.exe!FormatString(char * buff, const char * str_arg, StringParameters * args, const char * last, unsigned int case_index, bool game_script, bool dry_run) Line 796 C++
openttd.exe!FormatString(char * buff, const char * str_arg, StringParameters * args, const char * last, unsigned int case_index, bool game_script, bool dry_run) Line 787 C++
openttd.exe!FormatString(char * buff, const char * str_arg, StringParameters * args, const char * last, unsigned int case_index, bool game_script, bool dry_run) Line 1006 C++
openttd.exe!FormatString(char * buff, const char * str_arg, StringParameters * args, const char * last, unsigned int case_index, bool game_script, bool dry_run) Line 787 C++
openttd.exe!GetStringWithArgs(char * buffr, unsigned int string, StringParameters * args, const char * last, unsigned int case_index, bool game_script) Line 262 C++
openttd.exe!GetString(char * buffr, unsigned int string, const char * last) Line 269 C++
openttd.exe!GetStringBoundingBox(unsigned int strid) Line 715 C++
openttd.exe!DrawCaption(const Rect & r, Colours colour, Owner owner, unsigned int str) Line 552 C++
openttd.exe!NWidgetLeaf::Draw(const Window * w) Line 2474 C++
openttd.exe!NWidgetPIPContainer::Draw(const Window * w) Line 1114 C++
openttd.exe!NWidgetPIPContainer::Draw(const Window * w) Line 1114 C++
openttd.exe!Window::DrawWidgets() Line 608 C++
openttd.exe!Window::OnPaint() Line 563 C++
openttd.exe!DrawOverlappedWindow(Window * w, int left, int top, int right, int bottom) Line 933 C++
openttd.exe!DrawOverlappedWindowForAll(int left, int top, int right, int bottom) Line 960 C++
openttd.exe!RedrawScreenRect(int left, int top, int right, int bottom) Line 1293 C++
openttd.exe!DrawDirtyBlocks() Line 1391 C++
openttd.exe!UpdateWindows() Line 3185 C++
openttd.exe!VideoDriver_Win32::MainLoop() Line 1280 C++
openttd.exe!openttd_main(int argc, char * * argv) Line 849 C++
openttd.exe!WinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, char * lpCmdLine, int nCmdShow) Line 443 C++
[External Code]
Exception thrown: read access violation.
s was nullptr.

tested on OpenTTD 2019-03-22-master-gd755375966

@stale stale bot removed the stale label Mar 25, 2019
SamuXarick added a commit to SamuXarick/OpenTTD that referenced this issue Mar 31, 2019
SamuXarick added a commit to SamuXarick/OpenTTD that referenced this issue Mar 31, 2019
SamuXarick added a commit to SamuXarick/OpenTTD that referenced this issue Mar 31, 2019
SamuXarick added a commit to SamuXarick/OpenTTD that referenced this issue Apr 11, 2019
SamuXarick added a commit to SamuXarick/OpenTTD that referenced this issue Apr 11, 2019
SamuXarick added a commit to SamuXarick/OpenTTD that referenced this issue Apr 11, 2019
SamuXarick added a commit to SamuXarick/OpenTTD that referenced this issue Apr 13, 2019
@James103
Copy link
Contributor

@James103 James103 commented Nov 15, 2019

Still crashes in OpenTTD 1.10.0-beta1. Crash files have been attached (including .log, .png, .dmp, and .sav).

SamuXarick added a commit to SamuXarick/OpenTTD that referenced this issue Nov 15, 2019
SamuXarick added a commit to SamuXarick/OpenTTD that referenced this issue Dec 27, 2019
@LordAro LordAro added this to the 1.10.0 milestone Dec 31, 2019
SamuXarick added a commit to SamuXarick/OpenTTD that referenced this issue Dec 31, 2019
SamuXarick added a commit to SamuXarick/OpenTTD that referenced this issue Feb 6, 2020
@LordAro LordAro closed this in 3089c62 Feb 6, 2020
douiwby added a commit to douiwby/OpenTTD that referenced this issue Apr 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.