Author Topic: [fixed]Crash when morphing an object with a special damage particle system  (Read 700 times)

jammyjamjamman

  • Administrator
  • Horseman
  • ********
  • Posts: 207
    • View Profile
Recently in the Towerdefense mod me and FreshDumbledore are making, I added an "emergency repair" particle system to all towers (using the same xml definition as the airship in tech uses for a custom damage particle system), but every time I morph a tower into a portal with this this xml definition I get a segmentation fault with the following output:

Code: [Select]
In [/home/softcoder/Code/megaglest/git/source/glest_game/main/main.cpp::handleSIGSEGV Line: 5602] Error detected: signal 11:
Error saved to logfile [/home/james/.megaglest/error.log]
*ERROR* [2014-09-05 01:54:30] In [/home/softcoder/Code/megaglest/git/source/glest_game/main/main.cpp::handleRuntimeError Line: 629] [In [/home/softcoder/Code/megaglest/git/source/glest_game/main/main.cpp::handleSIGSEGV Line: 5602] Error detected: signal 11:
] gameInitialized = 1, program = 0x1d8b340
*ERROR* [2014-09-05 01:54:31] In [/home/softcoder/Code/megaglest/git/source/glest_game/main/main.cpp::handleRuntimeError Line: 648] [In [/home/softcoder/Code/megaglest/git/source/glest_game/main/main.cpp::handleSIGSEGV Line: 5602] Error detected: signal 11:

Stack Trace:
./megaglest:Glest::Game::ExceptionHandler::handleRuntimeError(char const*, bool)address [0x7a7117] line: 639
./megaglest:Glest::Game::handleSIGSEGV(int)address [0x7a780f] line: 5607
/lib/x86_64-linux-gnu/libc.so.6:()address [0x7f82f8b13c30] line: 0
./megaglest:Glest::Game::Unit::checkCustomizedParticleTriggers(bool)address [0xa39fbe] line: 3917
./megaglest:Glest::Game::Unit::tick()address [0xa3ec4e] line: 3113
./megaglest:Glest::Game::World::tick()address [0xaf5a6a] line: 1005
./megaglest:Glest::Game::World::update()address [0xafe117] line: 937
./megaglest:Glest::Game::Game::update()address [0x6707fd] line: 2157
./megaglest:Glest::Game::Program::loopWorker()address [0x7dc958] line: 476
./megaglest:Glest::Game::glestMain(int, char**)address [0x7d2a75] line: 5451
./megaglest:Glest::Game::glestMainSEHWrapper(int, char**)address [0x7d45c1] line: 5699
/lib/x86_64-linux-gnu/libc.so.6:__libc_start_main()address [0x7f82f8afeec5] line: 0
./megaglest() [0x5eddd9]address [0x5eddd9]
]
Segmentation fault (core dumped)

This happens if the object is damaged or not, and therefore also if the particle is being used or not

FreshDumbledore made a suggestion as to why this fault exists, he suggested that the particle is linked to the original object, when the morph occurs the particle wants to be cancelled but the original object which the particle belongs to is gone so the game gets confused (or something like that, maybe he'll explain a little better).

There is also a workaround this bug (using an attackboost as seen here), but this is tacky.
« Last Edit: 23 September 2014, 23:20:48 by titi »
"All right, I've been thinking. When life gives you lemons? Don't make lemonade. Make life take the lemons back! Get mad! 'I don't want your damn lemons! What am I supposed to do with these?'" ~Cave Johnson, Portal 2

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,239
    • View Profile
    • http://www.titusgames.de
Re: Crash when morphing an object with a special damage particle system
« Reply #1 on: 22 September 2014, 01:01:52 »
This should be fixed in git ( 2f00143782429c13e19a250addf550b44b7966a1 )

Please test it and give feedback if this can be closed.
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios