14 Replies Latest reply on May 16, 2019 2:12 AM by DheerajK_81

    Building ModusToolbox project on build server

    sivrc_4112091

      I am trying to get my project to build via the command line on a build server(Windows Server 2016), which is hosted on a virtual machine.

      On my computer the project builds fine. However, when I try to build the project on the build server it returns the following error:

      • C:\ModusToolbox_1.1\tools\modus-shell-1.0\bin\echo.exe: *** Couldn't reserve space for cygwin's heap (0x60EA0000 <0xAC0000>) in child, Win32 error 0

       

      After this I tried to build the project with the ModusToolbox IDE, resulting in a similar error:

      • C:\ModusToolbox_1.1\tools\modus-shell-1.0\bin\sh.exe: *** Couldn't reserve space for cygwin's heap (0x60EA0000 <0xE20000>) in child, Win32 error 0

       

      Sometimes I get a pop-up that either 'echo.exe' or 'sh.exe' has stopped working. In an attempt to resolve this, I tried several things:

      • Reboot the virtual machine (which is advised in "ModusToolbox 1.1 Release Notes")
      • Perform a rebase of msys-1.0.dll via Cygwin (Returns: "rebase skipped because wrong machine type"?)
      • Reinstall ModusToolbox and the SDK

       

      All of the above attempts did not resolve the issue.

      Does anyone know why this error occurs and how to solve it?

        • 1. Re: Building ModusToolbox project on build server
          mattl_01

          This sounds like a hairy issue.


          From your responses, it looks like you have already looked at solutions like the ones described here
          Git Extensions: Win32 error 487: Couldn't reserve space for cygwin's heap, Win32 error 0 - Stack Overflow

           

          --Matt

          • 2. Re: Building ModusToolbox project on build server
            mattl_01

            Two more suggestions

             

            1. Make sure there isn’t another version of msys or Cygwin anywhere in your PATH environment variable.

            2. Make sure ModusToolbox is installed close enough to the root of your drive (~25 characters including drive letter, slashes, etc.).

            • 3. Re: Building ModusToolbox project on build server
              sivrc_4112091

              Hello Mat,

               

              Thank you for your reply.

               

              1. I checked the Path environment variable of the virtual machine and there is only one place where msys is found (C:\ModusToolbox_1.1\tools\modus-shell-1.0\bin). This is where it should be, I believe.

              There is no path to any Cygwin installation.

               

              2. ModusToolbox is installed directly in the C drive, so the path should not be to long.

               

              Do you have any other idea what it might be or is there something else what I could check?

              • 4. Re: Building ModusToolbox project on build server
                mattl_01

                Hmmm,

                 

                1. Is there anything in that stackoverflow thread that was meaningful?

                 

                2. You say "After this I tried to build the project with the ModusToolbox IDE, resulting in a similar error"

                Were you running the IDE on a virtual machine?  If you were, and I know this would be inconvenient,

                but could you try on a non-virtual machine to see if you can reproduce the same issue?

                 

                3. A shot in the dark, but could you try rebooting your machine (not just the VM)?

                 

                4. In a Cygwin terminal, what does uname -a return for you?  Mine returns.

                CYGWIN_NT-10.0 MDL-LAPTOP 2.11.1(0.329/5/3) 2018-09-05 10:24 x86_64 Cygwin

                 

                5. I am not sure how useful/convenient this workaround woudl be, but I found this on a cygwin page. Changing Cygwin's Maximum Memory

                 

                Thanks,

                --Matt

                • 5. Re: Building ModusToolbox project on build server
                  sivrc_4112091

                  Hi Matt,

                   

                  1. I tried to rebase the msys-1.0.dll with editbin.exe (a tool in Visual Studio).

                  With this the rebase succeeded but the build still failed.

                   

                  2. The environment where the error occurs is located on a virtual machine and the error occurs with building from both the command line as from the IDE. My own laptop runs Windows native and I have not seen this error there. I have also done a fresh install of the build environment on a two different laptops with native Windows and there the error does also not occur.

                   

                  3. Many other build servers are running on the physical machine, so rebooting it is not really an option.

                   

                  4. I didn't have a Cygwin terminal installed on the VM, but I downloaded it and ran 'uname -a'. This returned the following:

                  CYGWIN_NT-10.0 S011SAT 3.0.7(0.338/5/3) 2019-04-30 18:08 x86_64 Cygwin

                   

                  5. I have changed the heap size for msys-1.0.dll to 250, 500 and 1024 MB but the error message stays.

                   

                  Is there anything else that I could try?

                   

                  Kind regards, Siebren

                  • 6. Re: Building ModusToolbox project on build server
                    DheerajK_81

                    Hello Siebren,

                     

                    I am running Windows Server 2016 on Virtual Box and these are the settings I used.

                    vm.PNG

                     

                    I then installed ModusToolbox and ran a code example. The build was successful. I didn't have anything else installed. I have been failing to reproduce your issue. Can you tell me more about the virtual machine setup configuration? This might give more insight into the problem.

                     

                    Regards,

                    Dheeraj

                    • 7. Re: Building ModusToolbox project on build server
                      sivrc_4112091

                      Hello Dheeraj,

                       

                      Here is the configuration of the virtual machine. We are using Vsphere ESXI 6.7 so it looks a bit different.

                      VirtualMachineConfiguration.png

                       

                      Furthermore I noticed something strange. When I try to create a new project for the custom device CY8C6137BZI-F54 is fails. It shows the following error message:

                       

                      Error from make
                      - Message: {
                        "createproject" : {
                          "device" : "CY8C6137BZI-F54",
                          "platform" : "PSoC6_cm4_single",
                          "toolchain" : "GCC",
                      m.AllocationBase 0x0, m.BaseAddress 0x60EA0000, m.RegionSize 0x150000, m.State 0x10000
                      C:\ModusToolbox_1.1\tools\modus-shell-1.0\bin\bash.exe: *** Couldn't reserve space for cygwin's heap (0x60EA0000 <0xAD0000>) in child, Win32 error 0
                      make: *** [create_project_prologue] Error 1

                      - Exit code: 2
                      - File: C:\Users\VROEGI~1\AppData\Local\Temp\2\tmp976782849326879971.mk
                      - You may be missing a required SDK.

                       

                      All other devices that I tried, do get created just fine and only fail when building with the error "Couldn't reserve space for cygwin's heap (0x60EA0000 <0xAD0000>) in child, Win32 error 0".

                      I am uncertain if this linked to the original problem but I thought it might be.

                       

                      Regards,

                      Siebren

                      • 8. Re: Building ModusToolbox project on build server
                        DheerajK_81

                        In your user name do you have space? Can you try creating a new user with just (VROEGI) and try to build the project?

                         

                        Regards,

                        Dheeraj

                        • 9. Re: Building ModusToolbox project on build server
                          sivrc_4112091

                          One of my colleagues also has an account on the virtual machine, so we tried to build the project on his account.

                          However, the same problem still occurred.

                           

                          Regards,

                          Siebren

                          • 10. Re: Building ModusToolbox project on build server
                            DheerajK_81

                            Is the username mentioned in the path "C:\Users\VROEGI~1\AppData\Local\Temp\" same as the username of the virtual machine account? Check if this path exists and you have access to it. 

                             

                            Please let me know if you:

                            • tried creating an account with no space in the user name.
                            • made any changes to the environment variables

                             

                            Also, please share your modus.mk file.

                             

                            Regards,

                            Dheeraj

                            • 11. Re: Building ModusToolbox project on build server
                              sivrc_4112091

                              When I enter the path into Windows explorer it replaces 'VROEGI~1' with my user name and is capable of finding the 'Temp' folder.

                               

                              • All accounts created so far do not contain any spaces.
                              • I added 1 variable to my path. This is the path to the gcc compiler: "C:\ModusToolbox_1.1\tools\gcc-7.2.1-1.0\bin\".

                                  Besides that, no changes have been made to the path.

                               

                              Below is the content of the modus.mk file.

                              Is there btw a better way of including such a document in a post?

                               

                              # This is a file used and owned by the ModusToolbox IDE. Users should not modify this file.
                              DEVICE=CY8C6137BZI-F54
                              ################################################################################
                              # \file modus.mk
                              # \version 1.0
                              #
                              # \brief
                              # This file has two purposes.
                              # - The first purpose is to provide information to the makefile build system.
                              # - The second purpose is to provide information to any IDE about the example.
                              #  Therefore, this file should not contain anything other than make variables.
                              #
                              ################################################################################
                              # \copyright
                              # Copyright 2018-2019 Cypress Semiconductor Corporation
                              # SPDX-License-Identifier: Apache-2.0
                              #
                              # Licensed under the Apache License, Version 2.0 (the "License");
                              # you may not use this file except in compliance with the License.
                              # You may obtain a copy of the License at
                              #
                              #    http://www.apache.org/licenses/LICENSE-2.0
                              #
                              # Unless required by applicable law or agreed to in writing, software
                              # distributed under the License is distributed on an "AS IS" BASIS,
                              # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
                              # See the License for the specific language governing permissions and
                              # limitations under the License.
                              ################################################################################

                              #
                              # Toolchain, its optimization level and the configuration (Debug/Release) type
                              #
                              TOOLCHAIN=GCC
                              OPTIMIZATION = Og
                              CONFIG = Debug

                              # Define custom linker script location (<ABSOLUTE PATH>/customScript.ld)
                              # CY_MAINAPP_CM0P_LINKER_SCRIPT=
                              # CY_MAINAPP_CM4_LINKER_SCRIPT=

                              #
                              # Vector Floating-point flag (soft/hard) selection
                              #
                              VFP_FLAG = soft

                              #
                              # The target platform for the example
                              #
                              PLATFORMS_VERSION = 1.0
                              PLATFORM=PSOC6_SINGLE_CORE

                              #
                              # The default name of this example
                              #
                              CY_EXAMPLE_NAME = EmptyPSoC6App

                              #
                              # Description of the example project to display
                              #
                              CY_EXAMPLE_DESCRIPTION = Minimal new application template for 150MHz PSoC 6 devices. Debug is enabled and platform clocks are set for high performance (144MHz CLK_FAST for CM4 core and 72MHz CLK_SLOW for CM0+) but with a peripheral-friendly CLK_PERI frequency (72MHz).

                              #
                              # New project dialog inclusion
                              #
                              CY_SHOW_NEW_PROJECT = true

                              #
                              # Valid platforms for this example
                              #
                              CY_VALID_PLATFORMS = PSOC6_DUAL_CORE PSOC6_SINGLE_CORE

                              #
                              # This is the required SDK for this example
                              #
                              CY_REQUIRED_SDK = Cypress SDK[1.1]

                              #
                              # Valid devices for this example. If empty, this example works for all devices
                              #
                              CY_VALID_DEVICES = $(CY_DEVICES_WITH_MAX_SPEED_MHZ_150)

                              #
                              # The source code for the CM0+ application
                              #
                              CY_APP_CM0P_SOURCE =

                              #
                              # The source code for the CM4 application
                              #
                              CY_APP_CM4_SOURCE =  \
                              Source/main.c  \
                              setup_readme.txt \

                              #
                              # Paths to use for ModusToolbox IDE
                              #
                              CY_LOCAL_INCLUDE_CM0P = $(CY_GENERATED_DIR)/$(CYMAINAPP_CM0P_NAME)
                              CY_LOCAL_INCLUDE_CM4 = $(CY_GENERATED_DIR)/$(CYMAINAPP_CM4_NAME)

                              #
                              # Includes specific to the CM0+ application
                              #
                              APP_MAINAPP_CM0P_INCLUDES = \
                              -IGeneratedSource\
                              -I$(CY_LOCAL_INCLUDE_CM0P)/Source_cm0p

                              #
                              # Includes specific to the CM4 application
                              #
                              APP_MAINAPP_CM4_INCLUDES = \
                              -IGeneratedSource\
                              -I$(CY_LOCAL_INCLUDE_CM4)/Source

                              #
                              # Compiler flags specific to the CM0+ application
                              #
                              APP_MAINAPP_CM0P_FLAGS =

                              #
                              # Compiler flags specific to the CM4 application
                              #
                              APP_MAINAPP_CM4_FLAGS =

                              #
                              # Defines specific to the CM0+ application
                              #
                              APP_MAINAPP_CM0P_DEFINES = \
                              -DAPP_NAME='"$(CY_EXAMPLE_NAME)_cm0p"'

                              #
                              # Defines specific to the CM4 application
                              #
                              APP_MAINAPP_CM4_DEFINES = \
                              -DAPP_NAME='"$(CY_EXAMPLE_NAME)_cm4"'

                              #
                              # Software components needed by CM0+
                              #
                              CY_MAINAPP_CM0P_SWCOMP_USED = \

                              #
                              # Software components needed by CM4
                              #
                              CY_MAINAPP_SWCOMP_USED = \

                              #
                              # Other libraries (.a) needed by the CM0+ application
                              #
                              APP_MAINAPP_CM0P_LIBS = \

                              #
                              # Other libraries (.a) needed by the CM4 application
                              #
                              APP_MAINAPP_CM4_LIBS = \

                              #
                              # The path to the design.modus file
                              #
                              CYCONFIG_DESIGN_MODUS = design.modus

                              #
                              # Additional (non-core) set of generated source files
                              #
                              CYCONFIG_GENERATED_SOURCES = \

                              #
                              # Check that the CYSDK environment variable exists
                              #
                              ifndef CYSDK
                              $(error The SDK must be defined via the CYSDK environment variable)
                              endif

                              #
                              # Include the main makefile for building this type of example
                              #
                              include $(CYSDK)/libraries/platforms-$(PLATFORMS_VERSION)/common/find_platform.mk

                              • 12. Re: Building ModusToolbox project on build server
                                DheerajK_81

                                All of the projects are failing for you and your collegues when running the virtual machine on Vsphere ESXI 6.7. Am I right? Did you try anything else?

                                 

                                I tried running the projects with space in the usernames, reduced the virtual memory alloted for paging etc. but it all works. Let me see if I can get my hands on Vsphere.

                                 

                                Please let me know the exact steps to recreate the issue with Vsphere if possible.

                                 

                                Regards,

                                Dheeraj

                                1 of 1 people found this helpful
                                • 13. Re: Building ModusToolbox project on build server
                                  sivrc_4112091

                                  Hello Dheeraj,

                                  While working on a step by step plan on how to setup the virtual machine last Tuesday I noticed that the error has disappeared and I have not been able to reproduce it since. Neither my colleagues nor I have made any changes and we have no idea what might have caused the error to disappear. Which is really frustrating.

                                  However, since everything seems to work fine now, I don't know if it is possible to figure out what the cause of the error was.

                                   

                                  A last question. What should I do with this tread?

                                  Which reaction should I mark as the correct answer or should I leave it as unanswered?

                                   

                                  Thank you so much for the support.

                                   

                                  Kind regards,

                                  Siebren

                                  • 14. Re: Building ModusToolbox project on build server
                                    DheerajK_81

                                    Glad that it worked for you. I would vote for rebooting the system to be the most convenient solution when this error occurs.


                                    Regards,
                                    Dheeraj