• Make 4.3 crash when compiling 86duino example under WXP-NTVDM

    From RayeR@21:1/5 to All on Thu Apr 30 20:53:27 2020
    I just found a strange behavior of new make 4.3 when compiling 86duino example under WXP-NTVDM i got crash:

    N:\86DUINO.SDK\EXAMPLE>make -v
    GNU Make 4.3 (DJGPP port (r1))
    Built for i786-pc-msdosdjgpp
    Copyright (C) 1988-2020 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.

    N:\86DUINO.SDK\EXAMPLE>make
    make -C N:\86DUINO.SDK\core
    memblockpnxt: memory fouled
    Exiting due to signal SIGABRT
    Raised at eip=0003b3dc
    eax=000d9440 ebx=00000120 ecx=00000000 edx=00000000 esi=000524c8 edi=00000000 ebp=000d94f8 esp=000d9430 program=E:\DJGPP\BIN\make.exe
    cs: sel=01ff base=02b00000 limit=0010ffff
    ds: sel=0207 base=02b00000 limit=0010ffff
    es: sel=0207 base=02b00000 limit=0010ffff
    fs: sel=01d7 base=0000ece0 limit=0000ffff
    gs: sel=0217 base=00000000 limit=0010ffff
    ss: sel=0207 base=02b00000 limit=0010ffff
    App stack: [000daa50..0005aa50] Exceptn stack: [0005a96c..00058a2c]

    Call frame traceback EIPs:
    0x0003b32b
    0x0003b3dc
    0x0002b250
    0x0002b4ac
    0x00025b5e
    0x00026661
    0x0001a8eb
    0x00009f92
    0x0000afe3
    0x0000b290
    0x000058a7
    0x00005d93
    0x00005e5a
    0x0002329b
    0x00023b4b
    0x0001b49e
    0x0001d266
    0x0001d569
    0x000159de
    0x000343e4
    make: *** [Makefile:30: libcore.a] Error -1

    When I revert to older Make 4.1 (11.7.2015) it compiles without problem.

    N:\86DUINO.SDK\EXAMPLE>make -v
    GNU Make 4.1 (DJGPP port (r1))
    Built for i786-pc-msdosdjgpp
    Copyright (C) 1988-2014 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.

    N:\86DUINO.SDK\EXAMPLE>make
    make -C N:\86DUINO.SDK\core
    make.exe[1]: Entering directory 'n:/86duino.sdk/core'
    make.exe[1]: Nothing to be done for 'everything'.
    make.exe[1]: Leaving directory 'n:/86duino.sdk/core'
    gcc -c -w -g -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe
    -statics -O1 -DARDUINO=158 -D_86DUINO=210 example.cpp -o example.o -IN:\86DUINO.
    SDK\core -IN:\86DUINO.SDK\libraries\TimerOne
    gcc -w -Wl,--gc-sections -O1 -Wl,--start-group example.o N:\86DUINO.SDK\core\lib
    core.a N:\86DUINO.SDK\core\86Duino_Init.o -lTimerOne -lstdcxx -Wl,--end-group -
    o 86DUINO.exe -LN:\86DUINO.SDK\libraries\TimerOne

    The Makefile (compiling just one example.cpp):

    CC := gcc
    CFLAGS := -c -w -g -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -O1 -DARDUINO=158 -D_86DUINO=210
    LINK_FLAGS := -w -Wl,--gc-sections -O1

    LIB_PATH := $(86DUINO_DIR)\core
    LIB_INCLUDE := -I$(86DUINO_DIR)\core
    LIB := libcore.a
    INIT_OBJS := 86Duino_Init.o

    THIRD_LIB_NAME := TimerOne
    THIRD_LIB_INCLUDE := $(addprefix -I$(86DUINO_DIR)\libraries\,$(THIRD_LIB_NAME)) THIRD_LIB_PATH := $(addprefix -L$(86DUINO_DIR)\libraries\,$(THIRD_LIB_NAME)) THIRD_LIB := $(addprefix -l,$(THIRD_LIB_NAME))
    EXTEN_LIB :=

    SRCS := $(wildcard *.cpp)
    OBJS := $(patsubst %cpp,%o,$(SRCS))
    TARGETS := 86DUINO.exe

    .PHONY : everything clean all $(LIB)

    everything: $(LIB) $(TARGETS)

    clean:
    rm $(OBJS) $(TARGETS)

    all: clean everything

    $(LIB):
    make -C $(LIB_PATH)

    $(TARGETS): $(OBJS) $(LIB_PATH)\$(LIB) $(LIB_PATH)\$(INIT_OBJS)
    $(CC) $(LINK_FLAGS) -Wl,--start-group $^ $(THIRD_LIB) $(EXTEN_LIB) -lstdcxx -Wl,--end-group -o $@ $(THIRD_LIB_PATH)

    %.o: %.cpp
    $(CC) $(CFLAGS) $< -o $@ $(LIB_INCLUDE) $(THIRD_LIB_INCLUDE)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to All on Fri May 1 16:14:20 2020
    Am 01.05.2020 05:53, schrieb RayeR (rayer314@gmail.com) [via djgpp@delorie.com]:
    I just found a strange behavior of new make 4.3 when compiling 86duino example under WXP-NTVDM i got crash:

    N:\86DUINO.SDK\EXAMPLE>make -v
    GNU Make 4.3 (DJGPP port (r1))
    Built for i786-pc-msdosdjgpp
    Copyright (C) 1988-2020 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later<http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.

    N:\86DUINO.SDK\EXAMPLE>make
    make -C N:\86DUINO.SDK\core
    memblockpnxt: memory fouled
    Exiting due to signal SIGABRT
    Raised at eip=0003b3dc
    eax=000d9440 ebx=00000120 ecx=00000000 edx=00000000 esi=000524c8 edi=00000000 ebp=000d94f8 esp=000d9430 program=E:\DJGPP\BIN\make.exe
    cs: sel=01ff base=02b00000 limit=0010ffff
    ds: sel=0207 base=02b00000 limit=0010ffff
    es: sel=0207 base=02b00000 limit=0010ffff
    fs: sel=01d7 base=0000ece0 limit=0000ffff
    gs: sel=0217 base=00000000 limit=0010ffff
    ss: sel=0207 base=02b00000 limit=0010ffff
    App stack: [000daa50..0005aa50] Exceptn stack: [0005a96c..00058a2c]

    Call frame traceback EIPs:
    0x0003b32b
    0x0003b3dc
    0x0002b250
    0x0002b4ac
    0x00025b5e
    0x00026661
    0x0001a8eb
    0x00009f92
    0x0000afe3
    0x0000b290
    0x000058a7
    0x00005d93
    0x00005e5a
    0x0002329b
    0x00023b4b
    0x0001b49e
    0x0001d266
    0x0001d569
    0x000159de
    0x000343e4
    make: *** [Makefile:30: libcore.a] Error -1

    When I revert to older Make 4.1 (11.7.2015) it compiles without problem.

    N:\86DUINO.SDK\EXAMPLE>make -v
    GNU Make 4.1 (DJGPP port (r1))
    Built for i786-pc-msdosdjgpp
    Copyright (C) 1988-2014 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later<http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.

    N:\86DUINO.SDK\EXAMPLE>make
    make -C N:\86DUINO.SDK\core
    make.exe[1]: Entering directory 'n:/86duino.sdk/core'
    make.exe[1]: Nothing to be done for 'everything'.
    make.exe[1]: Leaving directory 'n:/86duino.sdk/core'
    gcc -c -w -g -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe
    -statics -O1 -DARDUINO=158 -D_86DUINO=210 example.cpp -o example.o -IN:\86DUINO.
    SDK\core -IN:\86DUINO.SDK\libraries\TimerOne
    gcc -w -Wl,--gc-sections -O1 -Wl,--start-group example.o N:\86DUINO.SDK\core\lib
    core.a N:\86DUINO.SDK\core\86Duino_Init.o -lTimerOne -lstdcxx -Wl,--end-group -
    o 86DUINO.exe -LN:\86DUINO.SDK\libraries\TimerOne

    The Makefile (compiling just one example.cpp):

    CC := gcc
    CFLAGS := -c -w -g -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -O1 -DARDUINO=158 -D_86DUINO=210
    LINK_FLAGS := -w -Wl,--gc-sections -O1

    LIB_PATH := $(86DUINO_DIR)\core
    LIB_INCLUDE := -I$(86DUINO_DIR)\core
    LIB := libcore.a
    INIT_OBJS := 86Duino_Init.o

    THIRD_LIB_NAME := TimerOne
    THIRD_LIB_INCLUDE := $(addprefix -I$(86DUINO_DIR)\libraries\,$(THIRD_LIB_NAME))
    THIRD_LIB_PATH := $(addprefix -L$(86DUINO_DIR)\libraries\,$(THIRD_LIB_NAME)) THIRD_LIB := $(addprefix -l,$(THIRD_LIB_NAME))
    EXTEN_LIB :=

    SRCS := $(wildcard *.cpp)
    OBJS := $(patsubst %cpp,%o,$(SRCS))
    TARGETS := 86DUINO.exe

    .PHONY : everything clean all $(LIB)

    everything: $(LIB) $(TARGETS)

    clean:
    rm $(OBJS) $(TARGETS)

    all: clean everything

    $(LIB):
    make -C $(LIB_PATH)

    $(TARGETS): $(OBJS) $(LIB_PATH)\$(LIB) $(LIB_PATH)\$(INIT_OBJS)
    $(CC) $(LINK_FLAGS) -Wl,--start-group $^ $(THIRD_LIB) $(EXTEN_LIB) -lstdcxx -Wl,--end-group -o $@ $(THIRD_LIB_PATH)

    %.o: %.cpp
    $(CC) $(CFLAGS) $< -o $@ $(LIB_INCLUDE) $(THIRD_LIB_INCLUDE)



    This is far from enough information to investigate this issue.
    First you are comparing the behaviour of make 4.3 with make 4.1. The most noticeable difference between both is that make 4.1 has been compiled with djdev203 and make 4.3 with djdev205 or later and thus they use at least different malloc routines.
    Anyway I must be capable to reproduce your complete DJGPP environment, thus
    I need to know the used versions of:
    djdev: is this djdev205 or some compiled version from CVS repository?
    gcc: version used?
    86duino: what is this and from where do I get it? I need the makefile plus
    the cpp file that you are trying to compile. Why are you using gcc
    to compile c++ code?

    If I cannot reproduce this environment I cannot debug this issue at all.
    In the worst case I could provide a new version of make with debug info added and you can produce a more verbose trace of the call stack trace but in the end it will not make possible to me to really debug the issue. I must be capable to run the debugger.


    Regards,
    Juan M. Guerrero

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From RayeR@21:1/5 to All on Fri May 1 18:38:08 2020
    Hi, well here's more info:
    I use djdev205 and GCC 4.8.5 (from delorie FTP)
    The problem can be reproduced under WinXP SP3 NTVDM and MSDOS 6.22 + DosLFN Don't ask me why whey use gcc 4 c++ but AFAIK gcc should well recognize it via extension (upper case C or cpp) so shouldn't matter.
    I prepared for you a minimized test environment (only 16MB packed)

    https://uloz.to/file/MnlafQ8z7As8/djgpp-7z
    Click on "Stahnout pomalu zdarma" (button with a turtle)

    you can delete file via https://uloz.to/smazat/MnlafQ8z7As8/11250886882114713600

    Then go to directory DJGPP\86DUINO.SDK\EXAMPLE
    edit path in SETENV.BAT (the 86DUINO_DIR sysvar)
    (also set path to this DJGPP)
    and just run make
    it should produce 86duino.exe.
    But you should get crash with current Make 4.3
    I also included working Make 4.1 in BIN directory (file MAKE.41)
    If you rename make.exe -> make.43 and make.41 -> make.exe and run make again it should compile.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From RayeR@21:1/5 to All on Wed May 20 17:19:29 2020
    Can you reproduce the bug with provided package? Need some more?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to All on Thu May 21 14:03:03 2020
    Am 21.05.2020 02:19, schrieb RayeR (rayer314@gmail.com) [via djgpp@delorie.com]:
    Can you reproduce the bug with provided package? Need some more?

    I cannot access your links. I always get "Error 451. The page is blocked due to the decision of the authorities in your area." (https://uloz.to/blocked).
    That site has been banned by my ISP and probably by all others here in germany because it is used to upload stuff that infringes copyrights. You can send
    the archive to me directely. To make it smaller you can remove the compiler, both make programs and the DJGPP stuff aslong as I know what version it is.
    I do not need them. The only important issue is that I get sample code and
    all the 86DUINO specific stuff to be capable to successfully compile the code. and so to reproduce the crash you are describing.

    Regards,
    Juan M. Guerrero

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to All on Thu May 21 20:00:28 2020
    Am 21.05.2020 02:19, schrieb RayeR (rayer314@gmail.com) [via djgpp@delorie.com]:
    Can you reproduce the bug with provided package? Need some more?

    I assume that I have found the 86Duino stuff that you have reported to produce the make crash at https://github.com/greycookie/86Duino_DuinOS. After I have installed the stuff of the 86duino directory I compiled a new make program using the current libc code from the repository. As can be seen the make program crashes with some nmalloc issue as I feared.
    I will see how I can fix this.

    Regards,
    Juan M. Guerrero


    make -C F:\86Duino_DuinOS-master\86DUINO\core
    memblockpnxt: memory fouled
    Exiting due to signal SIGABRT
    Raised at eip=00042c6c
    eax=000e0d90 ebx=00000120 ecx=00000000 edx=00000000 esi=00059ec8 edi=00000000 ebp=000e0e48 esp=000e0d80 program=C:\DJGPP-2.05\BIN\MAKE.EXE
    cs: sel=0147 base=83240000 limit=0010ffff
    ds: sel=014f base=83240000 limit=0010ffff
    es: sel=014f base=83240000 limit=0010ffff
    fs: sel=0127 base=00029d20 limit=0000ffff
    gs: sel=015f base=00000000 limit=0010ffff
    ss: sel=014f base=83240000 limit=0010ffff
    App stack: [000e2450..00062450] Exceptn stack: [0006236c..0006042c]

    Call frame traceback EIPs:
    0x00042bbb __djgpp_traceback_exit+107, file d0401.S
    0x00042c6c raise+92, file d0401.S
    0x00032aa0 __nmalloc_split+112, file fread.c
    0x00032cfc malloc+316, file fwrite.c
    0x0002e0c0 glob_in_dir+803, file d:/mk/srcs.dbg/gnu/make-4.3/_build/lib/../.././lib/glob.c, line 1349
    0x0002d7f8 glob+3624, file d:/mk/srcs.dbg/gnu/make-4.3/_build/lib/../.././lib/glob.c, line 1011
    0x0002257c parse_file_seq+1229, file d:/mk/srcs.dbg/gnu/make-4.3/_build/.././src/read.c, line 3394
    0x00009e7d string_glob+26, file d:/mk/srcs.dbg/gnu/make-4.3/_build/.././src/function.c, line 364
    0x0000b9ab func_wildcard+19, file d:/mk/srcs.dbg/gnu/make-4.3/_build/.././src/function.c, line 1383
    0x0000cccf expand_builtin_function+197, file d:/mk/srcs.dbg/gnu/make-4.3/_build/.././src/function.c, line 2420
    0x0000d037 handle_function+718, file d:/mk/srcs.dbg/gnu/make-4.3/_build/.././src/function.c, line 2544
    0x00006369 variable_expand_string+390, file d:/mk/srcs.dbg/gnu/make-4.3/_build/.././src/expand.c, line 258
    0x00006857 variable_expand+21, file d:/mk/srcs.dbg/gnu/make-4.3/_build/.././src/expand.c, line 417
    0x00006972 variable_expand_for_file+23, file d:/mk/srcs.dbg/gnu/make-4.3/_build/.././src/expand.c, line 464
    0x00006c0b allocated_variable_expand_for_file+46, file d:/mk/srcs.dbg/gnu/make-4.3/_build/.././src/expand.c, line 566
    0x00029f1a do_variable_definition+99, file d:/mk/srcs.dbg/gnu/make-4.3/_build/.././src/variable.c, line 1187
    0x0002a88f try_variable_definition+112, file d:/mk/srcs.dbg/gnu/make-4.3/_build/.././src/variable.c, line 1633
    0x0001d97b eval+1009, file d:/mk/srcs.dbg/gnu/make-4.3/_build/.././src/read.c, line 750
    0x0001d0cf eval_makefile+884, file d:/mk/srcs.dbg/gnu/make-4.3/_build/.././src/read.c, line 436
    0x0001cbc7 read_all_makefiles+431, file d:/mk/srcs.dbg/gnu/make-4.3/_build/.././src/read.c, line 258
    0x00017f9b main+5337, file d:/mk/srcs.dbg/gnu/make-4.3/_build/.././src/main.c, line 1947
    0x0003bc74 __crt1_startup+660, file putenv.c
    make: *** [Makefile:32: libcore.a] Error -1

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From RayeR@21:1/5 to All on Thu May 21 16:52:30 2020
    Aha, I didn't know you're behind big chinese (fire)wall to protect from all bad :)

    Yes, it's DuinOS by DMP - SDK for a tiny Vortex86 based mini PC module that use DJGPP. I didn't know this github page, on their official site is ony big ISO image with whole DuinOS.

    OK, so bug reproduced.
    Does it mean that nmalloc in make returned NULL and wa not handled properly or that nmalloc in current libc is broken? Is there same problem with make 4.1 when recompiled with current libc?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)