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

TWINE: Additional stream checks when loading the body data #3402

Merged
merged 2 commits into from Oct 4, 2021

Conversation

@ccawley2011
Copy link
Member

@ccawley2011 ccawley2011 commented Oct 3, 2021

This fixes a crash on startup on RISC OS. It doesn't get in game however, since it hits the following assert:

"./common/array.h", line 244: const T& Common::Array<T>::operator[](Common::Array<T>::size_type) const [with T = TwinE::BlockDataEntry; Common::Array<T>::size_type = unsigned int]: Assertion failed: idx < _size

Fatal signal received: Aborted

Stack backtrace:

Running thread 0xab6848 (Main Thread)
  (  bf8758) pc:   56b6ec lr:   56bb98 sp:   bf875c  __write_backtrace()
  (  bf87c8) pc:   56b80c lr:   56bef8 sp:   bf87cc  __unixlib_raise_signal()
  (  bf87d8) pc:   56bedc lr:   573bc0 sp:   bf87dc  raise()
  (  bf87ec) pc:   573b84 lr:   54e808 sp:   bf87f0  abort()
  (  bf8810) pc:   54e7b0 lr:   563b78 sp:   bf8814  __assert2()
  (  bf8824) pc:    a8bcc lr:    a9844 sp:   bf8828  TwinE::Grid::getBlockPointer(int, int) const
  (  bf8868) pc:    a982c lr:    a9ba0 sp:   bf886c  TwinE::Grid::drawColumnGrid(int, int, int, int, int)
  (  bf889c) pc:    a9a8c lr:    95364 sp:   bf88a0  TwinE::Grid::redrawGrid()
  (  bf96cc) pc:    952d8 lr:    7c4e8 sp:   bf96d0  TwinE::Redraw::redrawEngineActions(bool)
  (  bf9720) pc:    7bc88 lr:    7ca3c sp:   bf9724  TwinE::TwinEEngine::runGameEngine()
  (  bf9740) pc:    7c9c4 lr:    7cee4 sp:   bf9744  TwinE::TwinEEngine::gameEngineLoop()
  (  bf9990) pc:    7cadc lr:    5989c sp:   bf9994  TwinE::TwinEEngine::run()
  (  abc490) pc:    5934c lr:   5798a0 sp:   abc494  runGame(Plugin const*, Plugin const*, OSystem&, Common::String const&)
  (  abcfc8) pc:    5abbc lr:     f3b4 sp:   abcfcc  scummvm_main()
  (  abcfec) pc:     f320 lr:   579374 sp:   abcff0  main()


Thread 0xadc570 (scummvm)
  (  bf873c) pc:   563c5c lr:   3f2d90 sp:   addf80  __pthread_yield_return()
  (  addf8c) pc:   563bd4 lr:   3f2d90 sp:   addf90  pthread_yield()
  (  addfb0) pc:   3f2d28 lr:   3f2e14 sp:   addfb4  ?()
  (  addfc8) pc:   3f2dec lr:   3e9c70 sp:   addfcc  ?()
  (  addfe4) pc:   3e9c34 lr:   3f15a4 sp:   addfe8  ?()
  (  addff4) pc:   3f1598 lr:   561d14 sp:   addff8  ?()
  (  ade004) pc:   561cfc lr:        0 sp:   ade008  __pthread_create()


Thread 0xad8cf8 (scummvm)
  (  bf873c) pc:   563c5c lr:   5aa40c sp:   ad9f28  __pthread_yield_return()
  (  ad9f34) pc:   563bd4 lr:   5aa40c sp:   ad9f38  pthread_yield()
  (  ad9f60) pc:   5aa378 lr:   583a8c sp:   ad9f64  __dspwrite()
  (  ad9f88) pc:   5839d4 lr:   3f0698 sp:   ad9f8c  write()
  (  ad9f9c) pc:   3f0678 lr:   3e3c18 sp:   ad9fa0  ?()
  (  ad9fc8) pc:   3e3b50 lr:   3e9c70 sp:   ad9fcc  ?()
  (  ad9fe4) pc:   3e9c34 lr:   3f15a4 sp:   ad9fe8  ?()
  (  ad9ff4) pc:   3f1598 lr:   561d14 sp:   ad9ff8  ?()
  (  ada004) pc:   561cfc lr:        0 sp:   ada008  __pthread_create()
This fixes a crash on startup on RISC OS.
@ccawley2011 ccawley2011 requested a review from mgerhardy Oct 3, 2021
@mgerhardy
Copy link
Contributor

@mgerhardy mgerhardy commented Oct 4, 2021

I have a branch here with a patch that might fix the issue. It would be cool if you could give it a try.

0001-TWINE-changed-access-to-BlockEntry-data.patch.txt

@ccawley2011
Copy link
Member Author

@ccawley2011 ccawley2011 commented Oct 4, 2021

I have a branch here with a patch that might fix the issue. It would be cool if you could give it a try.

0001-TWINE-changed-access-to-BlockEntry-data.patch.txt

That fixed it, thanks!

@ccawley2011 ccawley2011 marked this pull request as ready for review Oct 4, 2021
@mgerhardy mgerhardy merged commit 4c07972 into scummvm:master Oct 4, 2021
8 checks passed
@ccawley2011 ccawley2011 deleted the twine-riscos branch Oct 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants