Anonymous Login
2020-02-19 01:32 UTC

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0001359OpenClonkEnginepublic2017-12-10 14:12
ReporterLuchs 
Assigned ToCaesar 
PrioritynormalSeveritycrashReproducibilityalways
StatusresolvedResolutionfixed 
PlatformGNU G++OSLinuxOS Version 
Product Version 
Target Version8.0Fixed in Version 
Summary0001359: Crash when Material.ocg contains invalid data
DescriptionI accidentally merged a Material.ocg folder NF gave me into the current one instead of replacing the folder. With the resulting material folder, OpenClonk crashes when loading any scenario.
Steps To Reproduce1. Download and extract the material folder from http://dl.clonkspot.org/CrashMaterial.tar.bz2
2. Load any scenario.
Additional InformationResulting log with the snapshot engine:

[22:56:01] C4AulScriptEngine linked - 54685 lines, 0 warnings, 0 errors
[22:56:01] Texture table holds 30 entries.
7.0-alpha0 unix: Caught signal SIGSEGV (0x0000000000001389)
./openclonk[0x537457]
./openclonk[0x5374d3]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x10d10)[0x7f9a4f489d10]
./openclonk(_ZN14C4MaterialCore5ClearEv+0x3e)[0x6bc65e]
./openclonk(_ZN14C4MaterialCore11CompileFuncEP11StdCompiler+0xb81)[0x6c1101]
./openclonk(_Z22CompileFromBuf_LogWarnI18StdCompilerINIReadR14C4MaterialCoreEbOT0_RKNT_3InTEPKc+0x87)[0x6c6227]
./openclonk(_ZN14C4MaterialCore4LoadER7C4GroupPKc+0x17f)[0x6c16cf]
./openclonk(_ZN13C4MaterialMap4LoadER7C4Group+0xce)[0x6c191e]
./openclonk(_ZN6C4Game19InitMaterialTextureEv+0xff)[0x5b5d2f]
./openclonk(_ZN6C4Game8InitGameER7C4GroupbbP14C4ValueNumbers+0x55f)[0x5b8edf]
./openclonk(_ZN6C4Game4InitEv+0x4d4)[0x5ba7e4]
./openclonk(_ZN13C4Application8GameTickEv+0x149)[0x5a8af9]
./openclonk(_ZN22C4ApplicationGameTimer7ExecuteEiP6pollfd+0xaf)[0x5a8d4f]
./openclonk(_ZN12StdScheduler15DoScheduleProcsEi+0x7d7)[0x84b667]
./openclonk(_ZN12StdScheduler13ScheduleProcsEi+0x118)[0x84a568]
./openclonk(_ZN13C4AbstractApp3RunEv+0x1d)[0x7d4e7d]
./openclonk(main+0x100)[0x52e520]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f9a4ac9da40]
./openclonk[0x537134]
TagsNo tags attached.
Attached Files
  • patch file icon funkymat.patch (593 bytes) 2017-12-10 04:55 -
    diff --git a/src/landscape/C4Material.cpp b/src/landscape/C4Material.cpp
    index 5e9f8b584..840c65b01 100644
    --- a/src/landscape/C4Material.cpp
    +++ b/src/landscape/C4Material.cpp
    @@ -331,6 +331,10 @@ int32_t C4MaterialMap::Load(C4Group &hGroup)
     	hGroup.ResetSearch(); int32_t cnt=0;
     	while (hGroup.FindNextEntry(C4CFN_MaterialFiles,entryname))
     	{
    +		if (cnt >= mat_num) {
    +			Log("WARNING (internal): more materials found than accounted for. Do you have funky material names?");
    +			break;
    +		}
     		// Load mat
     		if (!pNewMap[cnt].Load(hGroup,entryname))
     			{ delete [] pNewMap; return 0; }
    
    patch file icon funkymat.patch (593 bytes) 2017-12-10 04:55 +

-Relationships
+Relationships

-Notes

~0003720

Isilkor (developer)

(Assuming build ID 7ef4ce9b-f2e2-432c-b87d-6dac6618541c)

crash_handler [/var/cache/ocbuild/build/../source/src/game/ClonkMain.cpp:184]
crash_handler(int, siginfo_t*, void*) [ClonkMain.cpp:?]
?? [??:0]
StdBuf::Clear() [/var/cache/ocbuild/build/../source/src/lib/StdBuf.h:206]
C4MaterialCore::CompileFunc(StdCompiler*) [/var/cache/ocbuild/build/../source/src/landscape/C4Material.cpp:304 (discriminator 2)]
DoCompilation<C4MaterialCore> [/var/cache/ocbuild/build/../source/src/lib/StdCompiler.h:209]
C4MaterialCore::Load(C4Group&, char const*) [/var/cache/ocbuild/build/../source/src/landscape/C4Material.cpp:284]
C4MaterialMap::Load(C4Group&) [/var/cache/ocbuild/build/../source/src/landscape/C4Material.cpp:433]
C4Game::InitMaterialTexture() [/var/cache/ocbuild/build/../source/src/game/C4Game.cpp:849]
C4Game::InitGame(C4Group&, bool, bool, C4ValueNumbers*) [/var/cache/ocbuild/build/../source/src/game/C4Game.cpp:2165]
C4Game::Init() [/var/cache/ocbuild/build/../source/src/game/C4Game.cpp:455]
C4Application::GameTick() [/var/cache/ocbuild/build/../source/src/game/C4Application.cpp:681]
C4ApplicationGameTimer::Execute(int, pollfd*) [/var/cache/ocbuild/build/../source/src/game/C4Application.cpp:910]
StdScheduler::DoScheduleProcs(int) [/var/cache/ocbuild/build/../source/src/platform/StdSchedulerPoll.cpp:175]
StdScheduler::ScheduleProcs(int) [/var/cache/ocbuild/build/../source/src/platform/StdScheduler.cpp:154]
C4AbstractApp::Run() [/var/cache/ocbuild/build/../source/src/platform/C4App.cpp:24]
main [/var/cache/ocbuild/build/../source/src/game/ClonkMain.cpp:239]
?? [??:0]
_start [??:?]

~0003721

Isilkor (developer)

Last edited: 2015-07-24 09:55

View 2 revisions

Can reproduce on Linux, not reproducible on Windows. Might have something to do with case sensitivity in file systems (crashes while loading Ore.ocm - there's also an ORE.ocm in the tarball).

~0003722

Isilkor (developer)

Removing ORE.ocm avoids the crash.

~0005928

Caesar (developer)

Another of those crashes that exist because we use manual memory management and rely on assumptions on complex system.

~0005929

Caesar (developer)

So the attached patch fixes the crash, but the problem is that the C4Group::EntryCount returns less than C4Group::FindNextEntry finds. I guess I should fix that instead.

~0005930

occ (reporter)

Hi! There's been a check-in that references this bug. For more information you can visit the repository browser at this address:
https://git.openclonk.org/openclonk.git/commitdiff/be10e956986ec1c7bba946cf870e401e9fd45279

Changeset be10e95 by Julius Michaelis <gitter@liftm.de>
Prevent SEGV on duplicate material names with different case (0001359)

~0005931

Caesar (developer)

Should. But didn't. *sigh*
+Notes

-Issue History
Date Modified Username Field Change
2015-07-23 21:08 Luchs New Issue
2015-07-24 09:12 Isilkor Note Added: 0003720
2015-07-24 09:54 Isilkor Note Added: 0003721
2015-07-24 09:54 Isilkor Assigned To => Isilkor
2015-07-24 09:54 Isilkor Status new => confirmed
2015-07-24 09:55 Isilkor Note Edited: 0003721 View Revisions
2015-07-24 09:56 Isilkor Assigned To Isilkor =>
2015-07-24 10:22 Isilkor Note Added: 0003722
2015-10-16 00:33 Sven2 Target Version => 7.0
2015-12-06 22:32 Clonkonaut Target Version 7.0 => 8.0
2017-12-09 08:58 Caesar Note Added: 0005928
2017-12-10 04:55 Caesar File Added: funkymat.patch
2017-12-10 04:55 Caesar Note Added: 0005929
2017-12-10 14:10 occ Note Added: 0005930
2017-12-10 14:12 Caesar Assigned To => Caesar
2017-12-10 14:12 Caesar Status confirmed => resolved
2017-12-10 14:12 Caesar Resolution open => fixed
2017-12-10 14:12 Caesar Note Added: 0005931
+Issue History