Menu

#307 segfault in task with bad vars and/or position file

2.6
open
nobody
5
2014-04-17
2012-12-17
No

Gene Haskett reported the bug here: http://thread.gmane.org/gmane.linux.distributions.emc.devel/8656/

Master branch, realtime build, task would segfault at startup.

Gene found a work-around here:

http://thread.gmane.org/gmane.linux.distributions.emc.devel/8656/focus=8678

The position.txt file was empty. He removed both the position.txt file and the vars file (linuxcnc.vars), and the segfault went away and everything worked fine.

Related

Archived Bugs: #307

Discussion

  • Sebastian Kuzminsky

    This can be reproduced in sim:

    build master
    start the axis.ini config, let axis start, then quit
    truncate the position.txt file to 0 bytes
    restart axis.ini, milltask dumps core, preventing linuxcnc from starting

    I think there are two problems here:

    The first bug is that milltask segfaults when it tries to read a 0-byte position.txt file.

    The other bug is that the position.txt file can be corrupted (the original bug was apparently preceded by linuxcnc crashing). We should be using the rename(2) method to provide safe, atomic updates of all our critical files.

     
  • Michael Haberler

    Gene - I think the meaningless backtrace came about because gdb was not installed

    please 'sudo apt-get install gdb'

    this should enable a meaningful backtrace on segfaults

    -m

     
  • Sebastian Kuzminsky

    bug is also present in 2.5

     
  • Sebastian Kuzminsky

    • Group: --> 2.5.next
     
  • Gene Heskett

    Gene Heskett - 2013-11-04

    On Monday 04 November 2013 03:08:35 Sebastian Kuzminsky did opine:

    • Group: --> 2.5.next

    [bugs:#307] segfault in task with bad vars and/or position file

    Status: open
    Labels: Task Controller
    Created: Mon Dec 17, 2012 04:29 PM UTC by Sebastian Kuzminsky
    Last Updated: Mon Dec 17, 2012 04:29 PM UTC
    Owner: nobody

    Gene Haskett reported the bug here:
    http://thread.gmane.org/gmane.linux.distributions.emc.devel/8656/

    Master branch, realtime build, task would segfault at startup.

    Gene found a work-around here:

    http://thread.gmane.org/gmane.linux.distributions.emc.devel/8656/focus=8
    678

    The position.txt file was empty. He removed both the position.txt file
    and the vars file (linuxcnc.vars), and the segfault went away and
    everything worked fine.

    And I still have to do that from time to time. The atom box on the lathe
    can crash while exiting lcnc (so can the box I run the mill with, but not
    near as often, supposedly identical ARK brand shoeboxes purchased about a
    year apart from the same dealer in Texas) and either will leave empty files
    about once in 5 or 6 crashes.

    Unforch, when they do hang mid-exit, both requiring a reset button restart,
    they leave no clues in the logs, absolutely zip, not a character.

    Else I would have been posting it every time it happened.

    Cheers, Gene

    "There are four boxes to be used in defense of liberty:
    soap, ballot, jury, and ammo. Please use in that order."
    -Ed Howdershelt (Author)

    There's just something I don't like about Virginia; the state.
    A pen in the hand of this president is far more
    dangerous than 200 million guns in the hands of
    law-abiding citizens.

     

    Related

    Archived Bugs: #307

  • Chris Radek

    Chris Radek - 2014-04-17

    In 2.5 with a zero-byte position.txt file, I get a failed startup (with no segfault) but also it heals: it writes a new and valid position.txt file.

    I'm reassigning this to the 2.6 group.

     
  • Chris Radek

    Chris Radek - 2014-04-17
    • Group: 2.5.next --> 2.6
     
    • Gene Heskett

      Gene Heskett - 2014-04-17

      On Thursday 17 April 2014 12:04:46 Chris Radek did opine:

      • Group: 2.5.next --> 2.6
      • Comment:

      In 2.5 with a zero-byte position.txt file, I get a failed startup (with
      no segfault) but also it heals: it writes a new and valid position.txt
      file.

      I'm reassigning this to the 2.6 group.


      [bugs:#307] segfault in task with bad vars and/or position file

      Status: open
      Group: 2.6
      Labels: Task Controller
      Created: Mon Dec 17, 2012 04:29 PM UTC by Sebastian Kuzminsky
      Last Updated: Mon Nov 04, 2013 04:42 AM UTC
      Owner: nobody

      Gene Haskett reported the bug here:
      http://thread.gmane.org/gmane.linux.distributions.emc.devel/8656/

      Master branch, realtime build, task would segfault at startup.

      Gene found a work-around here:

      http://thread.gmane.org/gmane.linux.distributions.emc.devel/8656/focus=8
      678

      The position.txt file was empty. He removed both the position.txt file
      and the vars file (linuxcnc.vars), and the segfault went away and
      everything worked fine.

      First, its Heskett, and I haven't had any problem with that that I can
      recall in quite a while. OTOH, I am on the 2.5.3 branch ATM since about
      that time frame too.

      But here is a small clue: I get a blast of 8 or 10 lines of errors in the
      terminal screen I run it from IF I use the windows close button. I do not
      get that, getting a completely clean shutdown, if I use the file menus quit
      button.

      Cheers, Gene

      "There are four boxes to be used in defense of liberty:
      soap, ballot, jury, and ammo. Please use in that order."
      -Ed Howdershelt (Author)
      Genes Web page http://geneslinuxbox.net:6309/gene
      US V Castleman, SCOTUS, Mar 2014 is grounds for Impeaching SCOTUS

       

      Related

      Archived Bugs: #307