Menu

#268 segfault - double track elevation?

closed-fixed
V5.1.2 (6)
Any
5
2018-10-10
2018-08-30
No

hi guys
i get a segfault when i use kato n double track
combined with a section of ordenary track elevated
the kato normal n track ive had no problem with
could this have something to do with trains skipping on the double track?
anyway im using v5.1.0. from robert hellers deb files
thanks
mat

Related

Bugs: #268

Discussion

  • Adam Richards

    Adam Richards - 2018-08-30

    Mat,
    Probably not - the code for joining and elevations is very seperate from running trains.

    If you don't mind, walk us through the steps -

    • You define a single track (flextrak? or another piece of fixed track from the hotbar?) with an elevation using the elevation dialog, I guess?

    • Then you add a piece of double track by selecting on the hotbar and dragging it?

    • Or you do move to join of another piece (and if so which piece was moving?),
    • Or were you doing some other proceedure like Recompute Elevations of already joined bits?

    And when precisely does the error hit?

    Adam

     
    • mathew thomas

      mathew thomas - 2018-09-02

      hi thanks for responding
      i get the track from the row of tracks from the parameter files if you
      want to call it hot bar
      i can lay out the track no problem! even had the crossover bug when
      running a train on it!
      as soon as i press either elevation button and select the track it dies!
      dragging the track? i tried dragging it and the same piece moved across
      the screen!
      yeh once the peices were in place i started to adjust the elevation
      everything is ok when i only use single pieces
      i hope this helps
      mat


      From: "Adam Richards" tynewydd@users.sourceforge.net
      Sent: Friday, August 31, 2018 5:24 AM
      To: "[xtrkcad-fork:bugs]" 268@bugs.xtrkcad-fork.p.re.sourceforge.net
      Subject: [xtrkcad-fork:bugs] #268 segfault

      Mat,
      Probably not - the code for joining and elevations is very seperate from
      running trains.

      If you don't mind, walk us through the steps -

      You define a single track (flextrak? or another piece of fixed track from
      the hotbar?) with an elevation using the elevation dialog, I guess?

      Then you add a piece of double track by selecting on the hotbar and
      dragging it? Or you do move to join of another piece (and if so which
      piece was moving?), Or were you doing some other proceedure like Recompute
      Elevations of already joined bits?

      And when precisely does the error hit?

      Adam

      [bugs:#268] segfault

      Status: open
      Created: Thu Aug 30, 2018 05:00 AM UTC by mathew thomas
      Last Updated: Thu Aug 30, 2018 05:00 AM UTC
      Owner: nobody

      hi guys
      i get a segfault when i use kato n double track
      combined with a section of ordenary track elevated
      the kato normal n track ive had no problem with
      could this have something to do with trains skipping on the double track?
      anyway im using v5.1.0. from robert hellers deb files
      thanks
      mat


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/xtrkcad-fork/bugs/268/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

      Related

      Bugs: #268

  • Adam Richards

    Adam Richards - 2018-08-31
    • summary: segfault --> segfault - double track elevation?
     
  • Adam Richards

    Adam Richards - 2018-09-03

    OK - well I tried that with your plan and it didn't (segfault) for me (on Mac at 5.1.1, admittedly).

    But there is a code oddity - there is a global flag variable that it seems has not been initialized, which potentially makes the behaviour unpredictable per platform (based on compiler vaguries). The code that is run if the flag is set assumes that a track with >2 end points must be a turnout and therefore must have paths. This assumption with fail with a double track that isn't a crossover.

    If that if that is indeed the problem, if you try to run a Split command on the track first (it wont work because the track isn't splitable but will set the flagin question off) it might cause the problem not to happen on the following elevation command.

    I'll shove together a patch to both set the flag when it is initialized and to test to see if a track is a turnout before running the code in question even if it is set.

    Of course it could be something else - if you are able to run xtrkcad under gdb on your linux instance, when the error happens gdb will stop the program and you can run backtrace which will show us the precise module and offset where the error occurs and what the calling sequence was.

    Adam

     
    • mathew thomas

      mathew thomas - 2018-09-04

      hi i dont normally use gdb for debugging but i do use strace
      i did try using gdb but it came with no symbols error


      From: "Adam Richards" tynewydd@users.sourceforge.net
      Sent: Tuesday, September 4, 2018 1:14 AM
      To: "[xtrkcad-fork:bugs]" 268@bugs.xtrkcad-fork.p.re.sourceforge.net
      Subject: [xtrkcad-fork:bugs] #268 segfault - double track elevation?

      OK - well I tried that with your plan and it didn't (segfault) for me (on
      Mac at 5.1.1, admittedly).

      But there is a code oddity - there is a global flag variable that it seems
      has not been initialized, which potentially makes the behaviour
      unpredictable per platform (based on compiler vaguries). The code that is
      run if the flag is set assumes that a track with >2 end points must be a
      turnout and therefore must have paths. This assumption with fail with a
      double track that isn't a crossover.

      If that if that is indeed the problem, if you try to run a Split command on
      the track first (it wont work because the track isn't splitable but will
      set the flagin question off) it might cause the problem not to happen on
      the following elevation command.

      I'll shove together a patch to both set the flag when it is initialized and
      to test to see if a track is a turnout before running the code in question
      even if it is set.

      Of course it could be something else - if you are able to run xtrkcad under
      gdb on your linux instance, when the error happens gdb will stop the
      program and you can run backtrace which will show us the precise module and
      offset where the error occurs and what the calling sequence was.

      Adam

      [bugs:#268] segfault - double track elevation?

      Status: open
      Created: Thu Aug 30, 2018 05:00 AM UTC by mathew thomas
      Last Updated: Fri Aug 31, 2018 05:25 PM UTC
      Owner: nobody

      hi guys
      i get a segfault when i use kato n double track
      combined with a section of ordenary track elevated
      the kato normal n track ive had no problem with
      could this have something to do with trains skipping on the double track?
      anyway im using v5.1.0. from robert hellers deb files
      thanks
      mat


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/xtrkcad-fork/bugs/268/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

      Related

      Bugs: #268

  • Adam Richards

    Adam Richards - 2018-09-04

    Well that means the distro was built without symbols (the -g option, probably). The problem is that strace wont show anything useful as the interactions between the system and the app are not the issue - it will be the interactions between the app parts that are interesting.

    Oh well, it would have been helpful to pinpoint exactly where the issue was. If you dont get a problem after using the Split Track command on a track (you only have to run it once on a track after starting XtrackCAD before using Elevation command) it would be highly suggestive that this was the issue. As I look at the code, it is the unique path that might run for that double track.

    Meanwhile, Martin pointed out another problem that meant that two trains would not simply go past each other on double track - one would couple to the other and drag it across to its track - so I have put up another change to fix that problem.

    Adam

     
  • Adam Richards

    Adam Richards - 2018-09-28

    With the fix both to initialize the variable and to ensure that we dont assume a turnout with more than two end points must have paths at 5.2 node, I think we can assume this is most likely the issue (unitialized storage plus a bad assumption). As such it will be fixed in V5.2

     
  • Adam Richards

    Adam Richards - 2018-09-28
    • status: open --> open-accepted
    • assigned_to: Adam Richards
     
  • Adam Richards

    Adam Richards - 2018-10-10
    • labels: --> V5.1.2
    • status: open-accepted --> closed-fixed
     

Anonymous
Anonymous

Add attachments
Cancel





Auth0 Logo