.qc (dot qc) - the group for quake c coders of all denominations. If you make quake one mods and write code in quake c, join our group! I'll try to answer any quake c questions - please post your inquiry in the forums...

Forum Thread
  Posts  
Engine crash - memory corruption (Groups : qc : Forum : hard_code() : Engine crash - memory corruption) Locked
Thread Options
numbersix
numbersix quake-c coder++
Dec 16 2016 Anchor

Happens during map load like this:

Mod_Q1BSP_RecursiveNodePortals: WARNING: new portal was clipped away
*** Error in `maphack-glx': malloc(): memory corruption: 0x0000000005826f60 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x70bcb)[0x7fc463288bcb]
/lib/x86_64-linux-gnu/libc.so.6(+0x76fa6)[0x7fc46328efa6]
/lib/x86_64-linux-gnu/libc.so.6(+0x78f79)[0x7fc463290f79]
/lib/x86_64-linux-gnu/libc.so.6(__libc_malloc+0x54)[0x7fc463292d94]
/usr/lib/x86_64-linux-gnu/tls/libnvidia-tls.so.352.41(+0x2341)[0x7fc45d0ca341]
======= Memory map: ========
00400000-0071f000 r-xp 00000000 08:01 5193447304                         /home/OS/ulb/maphack-glx
0091e000-0091f000 r--p 0031e000 08:01 5193447304                         /home/OS/ulb/maphack-glx
0091f000-00967000 rw-p 0031f000 08:01 5193447304                         /home/OS/ulb/maphack-glx

[-snip-]
Received signal 6, exiting...

I suspect this will happen with any darkplaces derivative.

So, what happened to corrupt memory?

I noticed some brushes with missing faces - seeing map interior or sky where a texture should appear.
I started investigating brushes.

I took a smaller map chunk and manually deleted all visible brushes one at a time.
I didnt want to to a "select touching" or "invert selection" delete - that might kill the iffy brushes.

Once there were not visible brushes, I opened the map in scite to see:

// entity 0
{
"classname" "worldspawn"
"wad" "pkplus.wad;quake101.wad"
// brush 0
{
( 64 0 31 ) ( 64 0 0 ) ( 64 128 0 ) painkeep/egypt02 0 0 0 1.000000 1.000000 0 0 0
( 192 0 0 ) ( 192 0 31 ) ( 192 0 32 ) painkeep/egypt02 0 0 0 1.000000 1.000000 0 0 0
( 64 0 31 ) ( 192 0 31 ) ( 192 0 0 ) painkeep/egypt02 0 0 0 1.000000 1.000000 0 0 0
( 64 128 0 ) ( 192 128 0 ) ( 192 128 31 ) painkeep/egypt02 0 0 0 1.000000 1.000000 0 0 0
( 64 0 0 ) ( 192 0 0 ) ( 192 128 0 ) painkeep/egypt03 0 0 90 1.000000 1.000000 0 0 0
( 160 96 224 ) ( 64 128 33 ) ( 64 128 31 ) painkeep/egypt03 0 0 0 1.000000 1.000000 0 0 0
( 192 0 31 ) ( 64 0 31 ) ( 64 0 33 ) painkeep/egypt03 0 0 0 1.000000 1.000000 0 0 0
( 160 32 224 ) ( 160 96 224 ) ( 192 128 32 ) painkeep/egypt03 0 0 0 1.000000 1.000000 0 0 0
( 160 32 224 ) ( 64 0 33 ) ( 64 128 33 ) painkeep/egypt03 0 0 0 1.000000 1.000000 0 0 0
}
// brush 1
{
( 0 -96 328 ) ( 0 -32 328 ) ( 0 -32 344 ) chaos/rome09 0 -8 0 1.000000 1.000000 0 0 0
( 64 -96 344 ) ( 64 -32 344 ) ( 64 -32 344 ) chaos/rome09 0 -8 0 1.000000 1.000000 0 0 0
( 0 -96 328 ) ( 0 -96 344 ) ( 0 -96 344 ) chaos/rome09 0 -8 0 1.000000 1.000000 0 0 0
( 0 -32 344 ) ( 0 -32 328 ) ( 64 -32 328 ) chaos/rome09 0 -8 0 1.000000 1.000000 0 0 0
( 0 -32 328 ) ( 0 -96 328 ) ( 64 -96 328 ) painkeep/egypt18 0 -8 0 1.000000 1.000000 0 0 0
( 0 -96 344 ) ( 0 -32 344 ) ( 9 -41 393 ) painkeep/egypt18 0 -8 0 1.000000 1.000000 0 0 0
( 48 -48 432 ) ( 48 -80 432 ) ( 9 -87 393 ) painkeep/egypt18 0 -8 0 1.000000 1.000000 0 0 0
( 64 -96 344 ) ( 48 -80 432 ) ( 48 -48 432 ) painkeep/egypt18 0 -8 0 1.000000 1.000000 0 0 0
( 48 -80 432 ) ( 64 -96 344 ) ( 0 -96 344 ) painkeep/egypt18 0 -8 0 1.000000 1.000000 0 0 0
( 0 -32 344 ) ( 64 -32 344 ) ( 64 -32 344 ) painkeep/egypt18 0 -8 0 1.000000 1.000000 0 0 0
}
// brush 2
{
( 0 224 342 ) ( 0 224 344 ) ( 0 160 344 ) chaos/rome09 0 -8 0 1.000000 1.000000 0 0 0
( 64 224 344 ) ( 64 224 342 ) ( 64 224 328 ) chaos/rome09 0 -8 0 1.000000 1.000000 0 0 0
( 0 160 328 ) ( 0 160 344 ) ( 0 160 346 ) chaos/rome09 0 -8 0 1.000000 1.000000 0 0 0
( 0 224 342 ) ( 0 224 328 ) ( 64 224 328 ) chaos/rome09 0 -8 0 1.000000 1.000000 0 0 0
( 0 224 328 ) ( 0 160 328 ) ( 64 160 328 ) painkeep/egypt18 0 -8 0 1.000000 1.000000 0 0 0
( 0 224 344 ) ( 0 224 342 ) ( 64 224 342 ) painkeep/egypt18 0 -8 0 1.000000 1.000000 0 0 0
( 55 215 393 ) ( 64 224 344 ) ( 64 160 344 ) painkeep/egypt18 0 -8 0 1.000000 1.000000 0 0 0
( 9 215 393 ) ( 55 215 393 ) ( 48 176 432 ) painkeep/egypt18 0 -8 0 1.000000 1.000000 0 0 0
( 48 176 432 ) ( 64 160 346 ) ( 0 160 346 ) painkeep/egypt18 0 -8 0 1.000000 1.000000 0 0 0
( 0 160 344 ) ( 0 224 344 ) ( 9 215 393 ) painkeep/egypt18 0 -8 0 1.000000 1.000000 0 0 0
}
}

GTK Radiant 1.6.2 does NOT display those on the grid or 3D view.
Remove those and the crash goes away.

Thus, some aspect of the specified brush planes crashes the engine.

Other versions of those that cause no engine crash cause other weirdness.

If you shoot at one with a hitscan, it finds its "hit" trace directly in front of you.
Same thing with rockets - with deadly effect. They blow up in your face!

I have some images and video I link in later.

Happy Quaking and Merry Christmas!

Reply to thread
click to sign in and post

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.