MantisBT - VCMI
View Issue Details
0000703VCMIGUI - Hero screen / Exchange windowpublic2011-03-06 14:162014-05-30 17:40
q4a 
Tow 
normalcrashalways
closedfixed 
LinuxUbuntu10.10 x64
 
0.85 
0000703: Crash when clicking on split creatures button in hero info window
Crash when clicking on split creatures button in hero info window. Vcmi r2020.
VCMI_Client_log.txt and VCMI_Server_log.txt attached.
A few last strings from console:
ALSA lib pcm.c:7241:(snd_pcm_recover) underrun occured
Loaded AI named Genius 1.0
Loaded AI named Genius 1.0
Loaded AI named Stupid AI 0.1
CStupidAI [0x3083c90]: created
CStupidAI [0x3083c90]: init called, saving ptr to IBattleCallback
Segmentation fault
No tags attached.
txt VCMI_Client_log.txt (123,098) 2011-03-06 14:16
https://bugs.vcmi.eu/file_download.php?file_id=686&type=bug
txt VCMI_Server_log.txt (114,707) 2011-03-06 14:17
https://bugs.vcmi.eu/file_download.php?file_id=687&type=bug
png vcmi.PNG (534,020) 2011-03-09 10:12
https://bugs.vcmi.eu/file_download.php?file_id=701&type=bug
png
Issue History
2011-03-06 14:16q4aNew Issue
2011-03-06 14:16q4aFile Added: VCMI_Client_log.txt
2011-03-06 14:17q4aFile Added: VCMI_Server_log.txt
2011-03-09 10:12q4aFile Added: vcmi.PNG
2011-03-09 10:17q4aNote Added: 0001640
2011-03-09 11:19ZamolxisNote Added: 0001641
2011-03-09 11:19ZamolxisStatusnew => confirmed
2011-03-09 12:27mazayusNote Added: 0001642
2011-03-09 12:27mazayusNote Edited: 0001642bug_revision_view_page.php?bugnote_id=1642#r1288
2011-03-12 22:32TowNote Added: 0001648
2011-03-12 22:32TowStatusconfirmed => resolved
2011-03-12 22:32TowFixed in Version => 0.89
2011-03-12 22:32TowResolutionopen => fixed
2011-03-12 22:32TowAssigned To => Tow
2014-05-30 17:40beegeeStatusresolved => closed

Notes
(0001640)
q4a   
2011-03-09 10:17   
Tested on XP SP3 x32 with vcmi 0.84. The same bug. See attached vcmi.PNG.
Reproducibility: always. So any map, any hero. Just open hero info window, click on some creatures, then split creatures button and see crash.
(0001641)
Zamolxis   
2011-03-09 11:19   
I can confirm the bug and can always attach a crashdump if necessary, but as it's always reproducible, I guess it's not needed.

Note: it only crashes if we click on the Split button (as in the report), Shift-split hotkey works otherwise.
(0001642)
mazayus   
2011-03-09 12:27   
It seems that the problem is in CHeroWindow.cpp on line 199:
split = new AdventureMapButton(CGI->generaltexth->allTexts[256], CGI->generaltexth->heroscrn[32], boost::bind(&CGarrisonInt::splitClick,garr), pos.x + 539, pos.y + 519, "hsbtns9.def", false, NULL, false);

There is a call to boost::bind():
boost::bind(&CGarrisonInt::splitClick,garr)
while garr may be uninitialized. It is assigned a value on line 206. So moving lines 196-201 to a place where garr is initialized (between lines 206 and 207) solves the problem.

(0001648)
Tow   
2011-03-12 22:32   
mazayus->
Indeed, good catch! :)

Fixed in r2028.