Skip to content

crash when Augmenting travelers for detected concurrent segments #58

Closed

Description

@yakra

3 crashes in 100 runs (3lists.log & 3lists_full.log).
crashlog.sh commandline: ./siteupdate -t 8 -U yakra mapcat oscar -l logs -n nmp_merged -c stats -u /home/yakra/TravelMapping/UserData/list_files -w /home/yakra/TravelMapping/HighwayData | tee siteupdate_m1.log
free(): invalid pointer on the stack in all 3 cases.

Activity

  1. yakra commented on Jan 27, 2019

    @yakra
    OwnerAuthor

    if added to ConcAugThread:
    no crashes in 100 runs, 8 threads.

  2. yakra commented on Jan 27, 2019

    @yakra
    OwnerAuthor

    No crashes in 100 runs, 20 threads.
    Closing issue.

  3. yakra commented on Jan 27, 2019

    @yakra
    OwnerAuthor

    Related issues:

    #56 ReadWptThread
    #44 NmpMergedThread
    #55 ReadListThread
    #58 ConcAugThread
    #54 ComputeStatsThread
    #59 UserLogThread

  4. yakra commented on Jun 11, 2019

    @yakra
    OwnerAuthor

    Forget whether I ever I also observed a crash where the program just terminates, but observed a similar infinite loop to #44 (comment)

    On lab1, one thread appeared to get caught in an infinite loop, CPU @ 100%, with the other 7 CPUs @ 0%.

  5. reopened this on Jun 11, 2019
  6. yakra commented on Jun 22, 2019

    @yakra
    OwnerAuthor

    -rw-rw-r--. 1 dan dan 11588974 Jun 21 22:49 0100.log
    0100.log: ConcAugThread 03 begin traveler processing
    97eaf1e

    Last reported activity per thread

    Starting ConcAugThread 01
    Starting ConcAugThread 02
    Starting ConcAugThread 05
    Starting ConcAugThread 06

    ConcAugThread 00 begin traveler processing
    ConcAugThread 04 begin traveler processing

    (threads 7+ did not start)

    ConcAugThread 03 begin traveler processing


    • First, Starting ConcAugThread.
    • while (travlists->size()) begins
    • Stuff happens while tl_mtx is locked
      • Recheck travlists->size()
      • TravelerList *t from front of list
      • travlists->pop_front();
    • Then, begin traveler processing
    • for (HighwaySegment *s : t->clinched_segments)
      • No problem here, t is unique per thread
    • if (s->concurrent) for (HighwaySegment *hs : *(s->concurrent))
      • Concurrencies are already detected; this value will not change
    • if (hs->route->system->active_or_preview() && hs->add_clinched_by(t))
      • Everything happens within a mutex. No ELSE block.
      • So, let's look at hs->add_clinched_by(t))
    • end traveler processing, end while loop, end thread.
    bool HighwaySegment::add_clinched_by(TravelerList *traveler)
    {	clin_mtx.lock();
    	bool result = clinched_by.insert(traveler).second;
    	clin_mtx.unlock();
    	return result;
    }

    Again, everything within a mutex.


    travlists->size() shouldn't even be a problem. It's read outside a mutex, but only written from within one, via pop_front().
    This puts me at a loss for what to do.

    I think I may try moving away from this method of popping elements off the list anyway.
    I've never seen SubgraphThread (which reads a vector non-destructively, only messing with its index) crash since this nonsense began.
    Hey man. Maybe that could mean something?
    If, as per the previous post, we're getting caught in an infinite loop, maybe something's fishy with the while loop after all? I don't see what or how, but...

  7. yakra commented on Jun 23, 2019

    @yakra
    OwnerAuthor

    Changed from a "modify the list" technique to a "modify the iterator" technique.
    Siteupdate has now been running in a loop on lab2 for > 38 hours & 1313 passes now, with no crashes. Going to re-close this.
    See #58 (comment) and forum post.

  8. added a commit that references this issue on May 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions