View Issue Details

IDProjectCategoryView StatusLast Update
0000587Gameplay + OpenGL[All Projects] Bugpublic2017-04-15 12:01
ReporterMajor Cooke 
Assigned To 
PriorityurgentSeveritycrashReproducibilitysometimes
Status resolvedResolutionfixed 
Summary0000587: DCorpsePointer Crash
DescriptionImage of Callstack Trace

I think A_QueueCorpse is causing a crash.

DCorpsePointer::DCorpsePointer (AActor *ptr)
: DThinker (STAT_CORPSEPOINTER), Corpse (ptr)
{
    Count = 0;

    // Thinkers are added to the end of their respective lists, so
    // the first thinker in the list is the oldest one.
    TThinkerIterator<DCorpsePointer> iterator (STAT_CORPSEPOINTER);
    DCorpsePointer *first = iterator.Next ();

    if (first != this)
    {
        if (first->Count >= (uint32_t)sv_corpsequeuesize)
        {
            DCorpsePointer *next = iterator.Next ();
            first->Destroy ();
            first = next;
        }
    }
    ++first->Count;
}
TagsNo tags attached.

Relationships

Activities

Major Cooke

Major Cooke

2017-04-15 08:23

reporter   ~0001389

Last edited: 2017-04-15 08:26

View 2 revisions

To be specific, 'first' is null. The way I have a system set up, corpses can disappear so it shouldn't come as a surprise that it can become null.

Major Cooke

Major Cooke

2017-04-15 09:35

reporter   ~0001391

Made a fix that at least stops the crashing.
Graf Zahl

Graf Zahl

2017-04-15 10:29

administrator   ~0001392

I won't do anything further. To make it short, what you do here is wrong. If you queue a corpse you relinquish ownership to the queue and should not muck around with it, and if you want to muck around with it, either not queue or unqueue it before doing things.
Major Cooke

Major Cooke

2017-04-15 10:30

reporter   ~0001393

Last edited: 2017-04-15 10:32

View 2 revisions

I wasn't expecting you to do anything further, merely resolving the crash is just what I needed. I'm happy.

Indeed the rest of the stuff is not for you to concern yourself over.

_mental_

_mental_

2017-04-15 10:36

developer   ~0001395

The fix hides the actual problem: instance of DCorpsePointer is used before SetClass() function is called for it.
Major Cooke

Major Cooke

2017-04-15 10:37

reporter   ~0001396

Last edited: 2017-04-15 10:37

View 2 revisions

Now this was something I was unaware of. But still, having a nullptr check never hurts.

Graf Zahl

Graf Zahl

2017-04-15 12:01

administrator   ~0001397

Hooray for yet another constructor that is doing work that a constructor is not supposed to do. :(

These things are a menace.

Issue History

Date Modified Username Field Change
2017-04-15 08:21 Major Cooke New Issue
2017-04-15 08:23 Major Cooke Note Added: 0001389
2017-04-15 08:26 Major Cooke Note Edited: 0001389 View Revisions
2017-04-15 09:35 Major Cooke Note Added: 0001391
2017-04-15 10:28 Graf Zahl Status new => resolved
2017-04-15 10:28 Graf Zahl Resolution open => fixed
2017-04-15 10:29 Graf Zahl Note Added: 0001392
2017-04-15 10:30 Major Cooke Note Added: 0001393
2017-04-15 10:32 Major Cooke Note Edited: 0001393 View Revisions
2017-04-15 10:36 _mental_ Note Added: 0001395
2017-04-15 10:37 Major Cooke Note Added: 0001396
2017-04-15 10:37 Major Cooke Note Edited: 0001396 View Revisions
2017-04-15 12:01 Graf Zahl Note Added: 0001397