Menu

How do I report a bug?

Help
2022-01-20
2022-01-20
  • Anthony Cook

    Anthony Cook - 2022-01-20

    (I'm not authorized to create a bug ticket so I'll report the problem here (for now))

    Title: Building CLIPS 6.40 with "#define DEBUGGING_FUNCTIONS 0 " set in "setup.h", causes a runtime error when calling the API CreateEnvironment

    The crash is in the file dffctdef.c:217. Reason: Access violation writing to location 0x0000000000000008

    This is CLIPS built into a 64bit executable with Visual Studio 2022. It crashes on the very first CLIPS API call to CreateEnvironment

    My guess is CLIPS hasn't been tested for a while with this conditional build option.

    CLIPS works fine with the default conditional compilation set by "#define DEBUGGING_FUNCTIONS 1 "

    Thanks, Dr Anthony Cook

     
    • Gary Riley

      Gary Riley - 2022-01-20

      I'm not sure why you can't create a bug ticket. I can't find any settings that would seem to enable/disable that functionality. All of the more recent tickets seem to have been created by selecting ticket from the ticket menu rather than bug.

      I downloaded clips_windows_projects_640.zip from the SourceForge Files area and ran the CLIPSDOS project with VS 2022 after setting DEBUGGING_FUNCTIONS to 0. The main.c for the project calls CreateEnvironment. I tried all combinations of x64/x86 Debug/Release, but none crashed and I verified that the debugging functions were disabled by issuing a (facts) command.

      Are there any other changes in your project other than setting DEBUGGING_FUNCTIONS to 0?

       
  • Anthony Cook

    Anthony Cook - 2022-01-20

    Hi Gary.

    Problem solved :) - thank you for confirming that when done correctly it does work. This prompted me to go and look at the compiler command.

    I'm using CMake to build the VS 2022 project. To set the DEBUGGING_FUNCTIONS define I was using the CMake generator command:

    add_compile_definitions(DEBUGGING_FUNCTION 0)
    

    This caused the compiler command line switches - /D "DEBUGGING_FUNCTION" /D "0" - to be generated - so I think you can see whats going to happen!

    The CMake fix is to add quotes to generate - /D "DEBUGGING_FUNCTION 0"

    add_compile_definitions("DEBUGGING_FUNCTION 0")
    

    Cheers Tony

     

Log in to post a comment.