Menu

#3690 All tests fail for s08-stack-auto on 64-bit Windows?

closed-fixed
None
HC08
5
2024-01-18
2024-01-03
No

Looking at the snapshots page, apparently all tests fail for the s08-stack-auto target on 64-bit Windows.
I guess the issue was not noticed earlier due to common sporadic false results being reported for Windows. But looking at the logs, I see the s08-stack-auto failures on both on the tests from 2024-01-02 and 2023-12-31.

Related

Bugs: #3697

Discussion

  • Philipp Klaus Krause

    I can confirm that the generated .ihx files are wrong: When I take a regression test .ihx file generated by the 64-bit Windows build of SDCC and run it in uCsim on GNU/Linux is still fails:

    philipp@notebook6:/tmp$ ~/sdcc-trunk/sdcc/sim/ucsim/m68hc08.src/ucsim_m68hc08 -thcs08 gen-s08-stack-auto/tst__minimal.ihx
    uCsim 0.8.2, Copyright (C) 1997 Daniel Drotos.
    uCsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    This is free software, and you are welcome to redistribute it
    under certain conditions; type `show c' for details.
    0> Loading from gen-s08-stack-auto/tst__minimal.ihx
    1188 words read from gen-s08-stack-auto/tst__minimal.ihx
    set hw simif rom 0x7f
    0> run
    Simulation started, PC=0x008000
    --- Running: _minimal.c
    Running testMinimal
    --- Summary: 0/
    

    It hangs here. The next character printed should have been a '1'.

     
  • Philipp Klaus Krause

    It looks like for 64-bit windows, the s08 libray gets linked, not the s08-stack-auto one. Then everything breaks apart when support functions for % get called, resulting in an endless loop.

     
    • Philipp Klaus Krause

      Looks like this bug is much worse than thought:
      The wrong library gets linked, except for regression testing on non-Windows! E.g. the library is also wrong on GNU/Linux when just compiling something normally (outside of running regression tests).

       
  • Philipp Klaus Krause

    The attached patch should fix this issue. Looks ok to me on GNU/Linux.

     
    • Maarten Brock

      Maarten Brock - 2024-01-12

      Looks good to me. Please apply and close.

       
  • Philipp Klaus Krause

    • status: open --> closed-fixed
    • assigned_to: Philipp Klaus Krause
    • Category: other --> HC08
     
  • Philipp Klaus Krause

    Fixed in [r14504].

     

    Related

    Commit: [r14504]

  • Philipp Klaus Krause

    • status: closed-fixed --> pending-fixed
     
  • Philipp Klaus Krause

    Fixed in [r14504].

     

    Related

    Commit: [r14504]

  • Philipp Klaus Krause

    Hmm. On Debian GNU/Linux I now see the correct lib path for s08-stack-auto in the .lk files.
    But on 64-Bit Windows the regression tests still fail as before.
    So my fix only fixed the bug for the non-regression-test case.

    P.S.: pdk15 and s08 are similar here: Both do have a separate stack-auto library, and for both we regression test with both. We see that the correct library is chosen for pdk15, but not s08 in the .lk files from the 64-bit Windows regression tests (attached).

     

    Last edit: Philipp Klaus Krause 2024-01-13
  • Philipp Klaus Krause

    • status: pending-fixed --> open
     
  • Philipp Klaus Krause

    Apparently the remaining bug really is just a 64-bit Windows issue: The 32-Bit Windows snapshots failed to compile s08-stack-auto due to [bugs:#3695], i.e. on 32-Bit Windows the correct (missing before that bug got fixed) library would be linked for s08-stack-auto.

     

    Related

    Bugs: #3695


    Last edit: Philipp Klaus Krause 2024-01-16
  • Philipp Klaus Krause

    So, comparing s08-stack-auto and pdk15-stack-auto again. When just invoking sdcc manually (outside regression tests), both seems fine. When inside regression tests, I see that the command used to invoke sdcc for those is:

    wine sdcc --fverbose-asm -DNO_VARARGS -I/home/sdcc-builder/build/sdcc-build/orig/sdcc -mpdk15 --stack-auto --less-pedantic --out-fmt-ihx -I/home/sdcc-builder/build/sdcc-build/orig/sdcc/support/regression/fwk/include -I/home/sdcc-builder/build/sdcc-build/orig/sdcc/support/regression/tests -I/home/sdcc-builder/build/sdcc-build/orig/sdcc/device/include pdk15.lib gen/pdk15-stack-auto/testfwk.rel gen/pdk15-stack-auto/support.rel gen/pdk15-stack-auto/fwk.lib gen/pdk15-stack-auto/tst__minimal.rel -o gen/pdk15-stack-auto/tst__minimal.ihx
    

    vs.

    wine sdcc --fverbose-asm -DNO_VARARGS -I/home/sdcc-builder/build/sdcc-build/orig/sdcc -ms08 --stack-auto --less-pedantic --out-fmt-ihx -I/home/sdcc-builder/build/sdcc-build/orig/sdcc/support/regression/fwk/include -I/home/sdcc-builder/build/sdcc-build/orig/sdcc/support/regression/tests -I/home/sdcc-builder/build/sdcc-build/orig/sdcc/device/include s08.lib gen/s08-stack-auto/testfwk.rel gen/s08-stack-auto/support.rel gen/s08-stack-auto/fwk.lib gen/s08-stack-auto/tst__minimal.rel -o gen/s08-stack-auto/tst__minimal.ihx
    

    I see no suspicious differences here.

    But in the .lk files, the -k lines differ (the rest of the lines is fine):

    -k C:\Program Files (x86)\SDCC\bin\..\lib\pdk15-stack-auto
    -k /home/sdcc-builder/build/sdcc-build/build/x86_64-w64-mingw32/sdcc\lib\pdk15-stack-auto
    

    vs.

    -k C:\Program Files (x86)\SDCC\bin\..\lib\s08
    -k /home/sdcc-builder/build/sdcc-build/build/x86_64-w64-mingw32/sdcc\lib\s08
    

    Now, the -k apparently gets set in src/SDCCmain.c from libPathsSet and libDirsSet. It looks like libPathsSet would be the result of an -L option to SDCC, which we don't have here. That would leave libDirsSet, which apparently gets set in setLibPath from src/SDCCmain.c. But setLibPath looks like it always calls an available port->general.get_model to get the model (which is consistent with what I see everywhere except for regression testing on 64-Bit Windows for s08-stack-auto).

     
  • Philipp Klaus Krause

    I'm much closer to solving this:
    Apparently what should be 64-bit regression testing is actually 32-bit regression testing of an old version (that does not yet have the "partial" fix for this:

    Windows regression testing is done by installing sdcc, the using the sdcc in the path. This can pick up the wrong sdcc, if multiple are installed. The infrastructure uninstalls old versions first, but only for the same architecture. I.e. A machine that build 32-bit snapshots at some and 64-bit snapshots at some time will have both 32-bit and 64-bit versions installed, and only one of the is uninstalled.

    So what should have been 64-bit tests results were actually 32-bit ones from the older version.

    I'll retry all the 64-bit testing after manually uninstalling the old versions. If that works, this bug is fixed, but we should probably deal with the bigger picture still.

     
  • Philipp Klaus Krause

    • status: open --> closed-fixed
     
  • Philipp Klaus Krause

    This issue is now fixed, the newly discovered issue (32-Bit snapshots results appearing as 64-Bit ones) has a new ticket: [bugs:#3698].

     

    Related

    Bugs: #3698


Log in to post a comment.

MongoDB Logo MongoDB