Elm 0.19: elm make "not enough bytes" error when compiling - elm

I am suddenly receiving this error message when compiling my app:
elm make src/App.elm --output ../assets/javascripts/elm/App.js
elm: not enough bytes
CallStack (from HasCallStack):
error, called at libraries/binary/src/Data/Binary.hs:212:21 in binary-0.8.5.1:Data.Binary
make: *** [App.js] Error 1
Compiler bug?
Edit: The workaround is to delete elm-stuff. Then it will compile once, and have the same bug on the next attempt.

Related

How to decipher Erlang runtime error message

When I run an Erlang function using IntelliJ's "Run Configuration", I am getting the following error message. The error message contains lot of nested brackets. Please help me in understanding the message.
"C:\Program Files\Erlang OTP\bin\erl.exe" -pa F:/1TB/P/workspace-IntelliJ-Erlang2/netconfClient/out/production/netconfClient -pa F:/1TB/P/workspace-IntelliJ-Erlang2/netconfClient -eval netconfManager:open2(). -s init stop -noshell
init terminating in do_boot ({badarg,[{ets,select,[ct_attributes,[_]],[{_}]},{ct_config,get_key_from_name,1,[{_},{_}]},{ct_util,does_connection_exist,3,[{_},{_}]},{ct_gen_conn,do_start,4,[{_},{_}]},{ct_netconfc,open,4,[{_},{_}]},{erl_eval,do_apply,7,[{_},{_}]},{init,start_it,1,[{_},{_}]},{init,start_em,1,[{_},{_}]}]})
Crash dump is being written to: erl_crash.dump...{"init terminating in do_boot",{badarg,[{ets,select,[ct_attributes,[{{ct_conf,'$1','_','_','_',undefined,'_'},[],['$1']}]],[{error_info,#{cause=>id,module=>erl_stdlib_errors}}]},{ct_config,get_key_from_name,1,[{file,"ct_config.erl"},{line,578}]},{ct_util,does_connection_exist,3,[{file,"ct_util.erl"},{line,577}]},{ct_gen_conn,do_start,4,[{file,"ct_gen_conn.erl"},{line,281}]},{ct_netconfc,open,4,[{file,"ct_netconfc.erl"},{line,424}]},{erl_eval,do_apply,7,[{file,"erl_eval.erl"},{line,744}]},{init,start_it,1,[{file,"init.erl"},{line,1234}]},{init,start_em,1,[{file,"init.erl"},{line,1220}]}]}}
done
Right click on a function in a .erl file and click on "Run ."
The error message consists of Error code and Stack trace.
Error code is badarg. Please refer to
Exit Reasons for the list of error code.
The stack trace contains one entry for each function call. Each call
provides file name, function name, line number. For example,
{init,start_em,1,[{file,"init.erl"},{line,1220}]} indicates that
init.erl is the file, start_em is the function and 1220 is line #.
After manual indentation, we could better visualize the stacktrace as follows.
{badarg,[
{ets,select,[ct_attributes,[_]],[{_}]},
{ct_config,get_key_from_name,1,[{_},{_}]},
{ct_util,does_connection_exist,3,[{_},{_}]},
{ct_gen_conn,do_start,4,[{_},{_}]},
{ct_netconfc,open,4,[{_},{_}]},
{erl_eval,do_apply,7,[{_},{_}]},
{init,start_it,1,[{_},{_}]},
{init,start_em,1,[{_},{_}]}
]}
{badarg,[
{ets,select,[ct_attributes,[{{ct_conf,'$1','_','_','_',undefined,'_'},[],['$1']}]],[{error_info,#{cause=>id,module=>erl_stdlib_errors}}]},
{ct_config,get_key_from_name,1,[{file,"ct_config.erl"},{line,578}]},
{ct_util,does_connection_exist,3,[{file,"ct_util.erl"},{line,577}]},
{ct_gen_conn,do_start,4,[{file,"ct_gen_conn.erl"},{line,281}]},
{ct_netconfc,open,4,[{file,"ct_netconfc.erl"},{line,424}]},
{erl_eval,do_apply,7,[{file,"erl_eval.erl"},{line,744}]},
{init,start_it,1,[{file,"init.erl"},{line,1234}]},
{init,start_em,1,[{file,"init.erl"},{line,1220}]}
]}

Why do I suddenly get an error message after using gofmt?

For a few days now, after using gofmt ("gofmt -w test.go"), I have received an error message with which I cannot do anything:
Error: size of test.go changed during reading (from 18786 to 18742 bytes)
This message appears, although I did not change the program code, but only added a comment. What am I doing wrong?

In u-boot compile, linker script's sdram start and length are set by CONFIG_SPL_BSS_START_ADDR and CONFIG_SPL_BSS_MAX_SIZE values, why?

I'm trying to build u-boot for our simple test board. (arm64)
After setting in include/configs/ab21m.h (our board),
#define CONFIG_SPL_BSS_START_ADDR 0x4f00000
#define CONFIG_SPL_BSS_MAX_SIZE SZ_32K
when I compile it, it gives me error while linking u-boot-spl. The error message is like this.
===================== WARNING ======================
This board does not use CONFIG_DM_ETH (Driver Model
for Ethernet drivers). Please update the board to use
CONFIG_DM_ETH before the v2020.07 release. Failure to
update by the deadline may result in board removal.
See doc/driver-model/migration.rst for more info.
====================================================
UPD include/generated/timestamp_autogenerated.h
CFGCHK u-boot.cfg
CC cmd/version.o
AR cmd/built-in.o
LD u-boot
CC spl/common/spl/spl.o
OBJCOPY u-boot.srec
OBJCOPY u-boot-nodtb.bin
SYM u-boot.sym
RELOC u-boot-nodtb.bin
COPY u-boot.bin
MKIMAGE u-boot.img
LD u-boot.elf
AR spl/common/spl/built-in.o
LD spl/u-boot-spl
aarch64-none-elf-ld.bfd: invalid length for memory region .sdram
make[1]: *** [scripts/Makefile.spl:509: spl/u-boot-spl] Error 1
make: *** [Makefile:1984: spl/u-boot-spl] Error 2
make: *** Waiting for unfinished jobs....
By the way, the linker script for spl starts like this after the build.
MEMORY { .sram : ORIGIN = 0x4000000,
LENGTH = (14*1024*1024) }
MEMORY { .sdram : ORIGIN = 0x4f00000,
LENGTH = SZ_32K }
OUTPUT_FORMAT("elf64-littleaarch64", "elf64-littleaarch64", "elf64-littleaarch64")
OUTPUT_ARCH(aarch64)
ENTRY(_start)
SECTIONS
{
This is strange because this 0x4f00000 and SZ_32K is what I gave for CONFIG_SPL_BSS_START_ADDR and CONFIG_SPL_BSS_MAX_SIZE. I placed this range in the on-chip RAM area some enough space above CONFIG_SPL_TEXT_BASE and below CONFIG_SPL_STACK with enough stack space. (I referenced imx8mm_evk board). What should I correct?
BTW, I found CONFIG_SYS_SDRAM_BASE, CONFIG_SYS_INIT_RAM_ADDR are all set to 0x40000000in imx8mm_evk, which is the DRAM start addrss. But CONFIG_SYS_INIT_RAM_SIZE is set to 0x200000 (2MB) where there is actually 3072MB DDR. Why is this value set to small size?
I asked two qeustions. Any help will be very much appreciated.
So, your first problem is a literal one. You have SZ_32K as the value for CONFIG_SPL_BSS_MAX_SIZE but since you're likely lacking #include <linux/sizes.h> in include/configs/ab21m.h you're not getting that constant evaluated.
As for what this is all doing, and why you should likely use something more like 2MB as seen on other platforms and place it in SDRAM rather than much smaller on-chip memory, if you look at arch/arm/cpu/armv8/u-boot-spl.lds you can see we're defining where the BSS should reside and that's likely larger than 32KB (and you'll get an overflow error when linking, if so).

starter_fs.py: error: unrecognized arguments: --nvmain-config

I am running gem5 patched with NVMain. But when I am going to run then getting error unrecognized element --nvmain-config. I have seen all the other article is using this argument and their program run also. I also changed script from starter_fs.py to fs.py but still no good. Please help me how i can run it.
I have added the picture for better understanding .
usage: starter_fs.py [-h] [--dtb DTB] [--kernel KERNEL]
[--disk-image DISK_IMAGE] [--script SCRIPT]
[--cpu {hpi,atomic,minor}] [--cpu-freq CPU_FREQ]
[--num-cores NUM_CORES]
[--mem-type {NVMainMemory,HBM_1000_4H_1x128,DRAMCtrl,DDR3_2133_8x8,HBM_1000_4H_1x64,GDDR5_4000_2x32,HMC_2500_1x32,LPDDR3_1600_1x32,WideIO_200_1x128,DDR4_2400_8x8,DDR3_1600_8x8,DDR4_2400_4x16,DDR4_2400_16x4,SimpleMemory,LPDDR2_S4_1066_1x32}]
[--mem-channels MEM_CHANNELS] [--mem-ranks MEM_RANKS]
[--mem-size MEM_SIZE] [--checkpoint] [--restore RESTORE]
starter_fs.py: error: unrecognized arguments: --nvmain-config=./Configs/PCM_ISSCC_2012_4GB.config

PhantomJS Showing exit code 0 even after network error

I am using PhantomJS for printing pdf from my web page and then storing the resultant pdf to S3 if the pdf is generated successfully.
My problem is PhantomJS is returning exit code 0 i.e. success even after a network error occur and the resultant pdf is not which I want.
So I want to know is there any way to abort PhantomJS when error occur with an exit code .
Currently the error in which this happening is NETWORK Error : 101
But even though PhantomJS do not abort and return with exit code 0
The only time that PhantomJS exits on its own is when it encounters a Syntax Error of your script (PhantomJS 2.0.0 has a bug and simply freezes and doesn't print anything at this point).
For everything else you need to call phantom.exit() to exit. phantom.exit() takes an optional argument which is the exit code. So when you encounter an error for example by checking the success argument of the page.open() callback or when onResourceError or onResourceTimeout events are triggered, you can exit PhantomJS with your own intended exit code such as
phantom.exit(1);