MantisBT - VCMI
View Issue Details
0002234VCMIMechanics - Battlespublic2015-08-20 17:042023-10-10 13:42
Povelitel 
Dydzio 
normalcrashalways
closedfixed 
0.98c 
1.next 
0002234: Lose hero loss condition: when target hero is dead crash occur
OLD TITLE: If the hero retreat on tactics it leads to crash

Attack and immediately retreat
(client and server crash)
No tags attached.
related to 0002160closed vmarkovtsev It is possible to dismiss the hero, a condition that lose hero 
related to 0001724closed  I loose game, but crash, 
related to 0002288closed  After defeat client falls - Broken serialization! 
related to 0002122closed Warmonger When ai take my town - crash 
related to 0002874closed Dydzio hero loss/win condition - condition of victory is to defeat the hero 
rar vcmi.rar (1,350,822) 2015-08-20 17:04
https://bugs.vcmi.eu/file_download.php?file_id=2287&type=bug
txt VCMI_Client_log.txt (114,242) 2015-08-20 17:05
https://bugs.vcmi.eu/file_download.php?file_id=2288&type=bug
txt VCMI_Server_log.txt (83,432) 2015-08-20 17:05
https://bugs.vcmi.eu/file_download.php?file_id=2289&type=bug
7z logs.7z (38,339) 2016-10-24 07:22
https://bugs.vcmi.eu/file_download.php?file_id=2619&type=bug
? Убийство.h3m (8,535) 2016-11-02 09:35
https://bugs.vcmi.eu/file_download.php?file_id=2630&type=bug
Issue History
2015-08-20 17:04PovelitelNew Issue
2015-08-20 17:04PovelitelStatusnew => assigned
2015-08-20 17:04PovelitelAssigned To => Warmonger
2015-08-20 17:04PovelitelFile Added: vcmi.rar
2015-08-20 17:05PovelitelFile Added: VCMI_Client_log.txt
2015-08-20 17:05PovelitelFile Added: VCMI_Server_log.txt
2015-11-28 20:39SXXNote Added: 0006130
2015-11-28 20:41SXXSummaryIf the hero retreat on tactics it leads to crash => Lose hero loss condition: when target hero is dead crash occur
2015-11-28 20:41SXXDescription Updatedbug_revision_view_page.php?rev_id=3047#r3047
2015-11-28 20:42SXXRelationship addedrelated to 0002160
2015-11-28 20:42SXXNote Added: 0006131
2015-11-28 20:47SXXNote Added: 0006132
2016-01-26 19:40vmarkovtsevAssigned ToWarmonger => vmarkovtsev
2016-01-27 09:22vmarkovtsevNote Added: 0006366
2016-01-27 09:29SXXNote Added: 0006367
2016-03-01 09:29SXXRelationship addedrelated to 0002288
2016-03-01 09:30SXXRelationship addedrelated to 0002122
2016-09-12 13:52SXXRelationship addedrelated to 0001724
2016-10-04 07:59PovelitelNote Added: 0006811
2016-10-04 08:15PovelitelNote Edited: 0006811bug_revision_view_page.php?bugnote_id=6811#r3262
2016-10-22 13:02vmarkovtsevNote Added: 0006856
2016-10-22 14:24vmarkovtsevNote Added: 0006857
2016-10-22 14:25vmarkovtsevStatusassigned => resolved
2016-10-22 14:25vmarkovtsevFixed in Version => 0.99
2016-10-22 14:25vmarkovtsevResolutionopen => fixed
2016-10-24 07:22PovelitelNote Added: 0006867
2016-10-24 07:22PovelitelFile Added: logs.7z
2016-11-02 09:35PovelitelFile Added: Убийство.h3m
2016-11-02 09:36PovelitelNote Added: 0006878
2016-11-02 09:36PovelitelStatusresolved => feedback
2016-11-02 09:36PovelitelResolutionfixed => reopened
2018-02-23 20:01PovelitelNote Added: 0007424
2018-02-23 20:01PovelitelStatusfeedback => assigned
2018-02-23 20:03PovelitelNote Edited: 0007424bug_revision_view_page.php?bugnote_id=7424#r3439
2018-02-28 19:06PovelitelRelationship addedrelated to 0002874
2019-06-09 21:26PovelitelNote Added: 0007816
2019-06-09 21:26PovelitelStatusassigned => resolved
2019-06-09 21:26PovelitelFixed in Version0.99 => 1.next
2019-06-09 21:26PovelitelResolutionreopened => fixed
2019-06-09 21:26PovelitelAssigned Tovmarkovtsev => Dydzio
2019-06-09 21:29PovelitelNote Edited: 0007816bug_revision_view_page.php?bugnote_id=7816#r3587
2023-10-10 13:42PovelitelNote Added: 0008731
2023-10-10 13:42PovelitelStatusresolved => closed

Notes
(0006130)
SXX   
2015-11-28 20:39   
Problem have nothing to do with retreat or tactics. Issue is that when you lose scenario by "lose hero" condition client always crash.

On Linux that happen only after you "read" messages, but I suppose crash may occur earlier on Windows.

PS: Suppose possible related to 0001724.
(0006131)
SXX   
2015-11-28 20:42   
Just in case crash will occur even if you just dismiss that hero (0002160).
(0006132)
SXX   
2015-11-28 20:47   
Actual crash occur on gamestate object destruction client/Client.cpp:231
vstd::clear_pointer(gs);
(0006366)
vmarkovtsev   
2016-01-27 09:22   
I am unable to reproduce this with the current Git. Looks like recent pulls remedy the crash.
(0006367)
SXX   
2016-01-27 09:29   
I suppose this may be race condition of some sort so it's may be tricky to reproduce.
(0006811)
Povelitel   
2016-10-04 07:59   
(edited on: 2016-10-04 08:15)
Сейчас в 99% случаев происходит креш когда вас убивают. Хоть специальными условиями поражениями, хоть обычными. Я просто брал маленькие карты и на аутосукипе их гонял. Очень редко бывает когда игра не вылетает при поражении.
(И даже если это случается, то потом она вылетает гарантировано если начать новую игру с этого же клиента)

Now 99% of the crash occurs when you are killed. Although specific terms lesions, though conventional. I just took a small map and autosukipe they drove. It is very rare when a game does not take off in the defeat.

(0006856)
vmarkovtsev   
2016-10-22 13:02   
The cause of the problem is as follows.

When AI defeats us, "VCAI::makeTurn" thread freezes on pthread_cond_wait, while the other thread "vcmiclient" destroys everything including that conditional variable.
(0006857)
vmarkovtsev   
2016-10-22 14:24   
Fixed by 4bcc43d3d0455af0353785cf783fb19145e5f885
(0006867)
Povelitel   
2016-10-24 07:22   
К сожалению не пофиксено для меня (под винду, 7_64) И каждый раз при поражении дает разные логи. Прикрепляю их.
(0006878)
Povelitel   
2016-11-02 09:36   
still crash
(0007424)
Povelitel   
2018-02-23 20:01   
(edited on: 2018-02-23 20:03)
very often problem

> [Внедренный фрейм] VCMI_client.exe!std::_Ref_count_base::_Decref()Строка 894 C++ Символы загружены.
     [Внедренный фрейм] VCMI_client.exe!std::_Ptr_base<CGameInterface>::_Decref()Строка 1167 C++ Символы загружены.
     [Внедренный фрейм] VCMI_client.exe!std::shared_ptr<CGameInterface>::{dtor}()Строка 1460 C++ Символы загружены.
     VCMI_client.exe!callAllInterfaces<IGameEventsReceiver,PlayerColor,EVictoryLossCheckResult const & __ptr64,PlayerColor & __ptr64,EVictoryLossCheckResult & __ptr64>(CClient * cl, void(IGameEventsReceiver::*)(PlayerColor, const EVictoryLossCheckResult &) ptr, PlayerColor & <args_0>, EVictoryLossCheckResult & <args_1>)Строка 105 C++ Символы загружены.
     VCMI_client.exe!PlayerEndsGame::applyCl(CClient * cl)Строка 315 C++ Символы загружены.
     VCMI_client.exe!CClient::handlePack(CPack * pack)Строка 688 C++ Символы загружены.
     VCMI_client.exe!CClient::run()Строка 190 C++ Символы загружены.

(0007816)
Povelitel   
2019-06-09 21:26   
(edited on: 2019-06-09 21:29)
I guess this is fixed in c2ad0e67de732c68c136d7698a6bed83396009d33

(0008731)
Povelitel   
2023-10-10 13:42   
no longer relevant