KX Community

Find answers, ask questions, and connect with our KX Community around the world.
KX Community Guidelines

Home Forums kdb+ Strange ktn behaviour between gcc(64 bit) and clang(32 bit)

  • Strange ktn behaviour between gcc(64 bit) and clang(32 bit)

    Posted by alikalan14 on March 18, 2022 at 12:00 am

    Hello, I have two different results between 64-bit GCC compiled code on RedHad7 and 32-bit Clang compiled code on RedHad6. The following code snippet has different behaviors.

    K keys = ktn(KS, 10);

    It is at the beginning of a function, so I did not paste other lines. When I debug with gdb, after execution of this line,

    keys.r

    becomes a huge number on GCC(64bit), e.g., 720889, while it is 0 on Clang(32bit).

    I read the documentation and other messages here and added the following code before the ktn call to ensure, but it did not make a difference.

    khp(“”, -1);

     

    Do you know why I am having so different results from a basic line of code? Can it be a 32bit/64bit related issue? If so, could you please point out some reference pages to me?

     

    alikalan14 replied 6 months, 3 weeks ago 2 Members · 2 Replies
  • 2 Replies
  • leades

    Member
    March 22, 2022 at 12:00 am

    Hello,

    Reverting back with feedback:

    Are you looking at an uninitialized value, prior to the ktn call vs after it? It has been checked in both gcc and clang, for 64 bit and 32 bit but it was not reproduced. If you still have a question about this, could you please post your code and session in full.

    Many Thanks

    Luke

  • alikalan14

    Member
    March 24, 2022 at 12:00 am

    No, I did not check any uninitialized value or something. My sentences are clear but I guess you wanted to ask to make sure, I got your point.

     

    My problem got resolved after migrating, https://github.com/KxSystems/kdb/blob/master/c/c/k.h

    This is a new version, we were using an older version.

Log in to reply.