Why does dialyzer fail on nocatch? - erlang
I ran Dialyzer and got the following error:
Checking whether the PLT /tmp/.BRANCH.service.deps.plt is up-to-date...
{"init terminating in do_boot",
{{case_clause,
{{nocatch,
{dialyzer_error,
[78,111,116,32,97,32,114,101,103,117,108,97,114,32,102,105,108,
101,58,32,
"/usr/lib/erlang/lib/compiler-6.0.3/ebin/beam_a.beam",10]}},
[{dialyzer_plt,compute_md5_from_file,1,
[{file,"dialyzer_plt.erl"},{line,543}]},
{dialyzer_plt,compute_new_md5_1,3,
[{file,"dialyzer_plt.erl"},{line,509}]},
{dialyzer_plt,check_plt1,3,[{file,"dialyzer_plt.erl"},{line,485}]},
{dialyzer_plt,'-subproc/1-fun-0-',1,
[{file,"dialyzer_plt.erl"},{line,603}]}]}},
[{dialyzer_cl,check_plt,3,[{file,"dialyzer_cl.erl"},{line,249}]},
{dialyzer_cl,plt_common,3,[{file,"dialyzer_cl.erl"},{line,182}]},
{dialyzer,'-cl_check_init/1-fun-0-',1,[{file,"dialyzer.erl"},{line,94}]},
{dialyzer,doit,1,[{file,"dialyzer.erl"},{line,236}]},
{dialyzer,plain_cl,0,[{file,"dialyzer.erl"},{line,75}]},
{init,start_em,1,[]},
{init,do_boot,3,[]}]}}
What went wrong and how do I fix it? What do the list of integers mean?
The print-out inside the dialyzer_error tuple is an iolist. We can pretty print it using the Erlang shell (started with erl):
1> [78,111,116,32,97,32,114,101,103,117,108,97,114,32,102,105,108,101,58,32].
"Not a regular file: "
2>
You realize it is complaining about bytecode (.beam) from a previous compiler version than the current one I am running. I removed them, and then it ran.
Related
How to remove error limit in Clang Libtooling?
I made C/C++ source code modification tool using Clang Libtooling. I ran into the following error while executing my tool on test programs. fatal error: too many errors emitted, stopping now [-ferror-limit=] 20 errors generated. But I would like for the tool to ignore this limit, print all the errors, and execute AST modification as normal. Is there a way to fix this problem using Clang Libtooling?
Thanks to #dratenik, I solved the problem by adding an ArgumentAdjuster which passes Clang the option -ferror-limit=0. clang::tooling::ClangTool tool(compileDb, filename); tool.appendArgumentsAdjuster(clang::tooling::getInsertArgumentAdjuster( "-ferror-limit=0")); tool.run(...);
Read a list from stream using Yap-Prolog
I want to run a (python3) process from my (yap) prolog script and read its output formatted as a list of integers, e.g. [1,2,3,4,5,6]. This is what I do: process_create(path(python3), ['my_script.py', MyParam], [stdout(pipe(Out))]), read(Out, OutputList), close(Out). However, it fails at read/2 predicate with the error: PL_unify_term: PL_int64 not supported Exception ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'> BrokenPipeError: [Errno 32] Broken pipe I am sure that I can run the process correctly because with [stdout(std)] parameter given to process_create the program outputs [1,2,3,4,5,6] as expected. Weird thing is that when I change the process to output some constant term (as constant_term) it still gives the same PL_int64 error. Appending a dot to the process' output ([1,2,3,4,5,6].) doesn't solve the error. Using read_term/3 gives the same error. read_string/3 is undefined in YAP-Prolog. How can I solve this problem?
After asking at the yap-users mailing list I got the solution. Re-compiled YAP Prolog 6.2.2 with libGMP option and now it works. It may also occur in 32-bit YAP.
Exception Error, Erlang
This question is with reference to the question in the link: "** exception error: undefined function add:addfunc/0 in Erlang " I'm trying to execute a simple erlang program of adding two numbers. I'm trying to do this in Eclipse on Ubuntu 10.04 LTS. When I execute this program, I'm getting the error as shown below: -module(add). -export([addfunc/0]). addfunc() -> 6 + 5. " ** exception error: undefined function add:addfunc/0 " This program when executed in the erlang shell is working fine. But when it comes to eclipse it's giving me this error. Not this, any program for that matter is giving me the similar error. Guess I would be missing something about the eclipse configuration.
I haven't tested your code, but this very basic code should work. The message says that your function does not exist. Make sure that you have no errors at compile time. Check whether your function is exported with: add:module_info(). the result should look alike this: [{module,add}, {exports,[{addfunc,0}, .....
Trying to compile my first program in Erlang
I am getting compiler issue when trying to compile a simple test program on erlang. I have tried both on mac os x (lion) and windows 7 (64) ~module(tut). ~export([double/1]). double (N) -> N*2. I have checked that the file is named correctly and the correct modules seem to be installed I am using the otp_win64_R16B on my windows machine. I get the following error on both platforms 16> c(tut). tut.erl:1: syntax error before: '~' tut.erl:2: syntax error before: '~' tut.erl:4: no module definition tut.erl:4: Warning: function double/1 is unused Can anyone help?
Well, it should be: -module and -export, with the - not with ~.
You should replace ~ with -. Please take a try.
got SIGSEGV while calling 'require ("lsqlite3")' with lua 5.1.5
I had built lua 5.1.5 and lsqlite3-0.8.1. all of them run well on my RedHat Linux. and then I ported them to my MIPS development board. lua and other modules (such as luafilesystem, md5, cgilua and wsapi) run well. but lsqlite3 does not work. when I execute require("lsqlite3") in lua command line, it returns error messages in below: lua Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio require("lsqlite3") do_page_fault() #2: sending SIGSEGV to lua for invalid read access from 00000000 (epc == 00000000, ra == 2ac36144) Segmentation fault can any one give me any help to fix it? Thanks! I got few progress in solving this problem, I rebuilt the LUA with gcc compile option '-Wl,-E' and rebuilt lsqlite3 later. I executed require ("lsqlite3") in lua command line, and it didnt print any message. I continued running some other database operation commands and found them all been successfully executed. As it seemed the problem had been solved, I should be very happy about it. but another more strange problem raised. If I put sentence require("lsqlite3") into a file, and then execute the file in this way: lua file it still printed error messages like this: do_page_fault() #2: sending SIGSEGV to lua for invalid read access from 2ada054c (epc == 2ada054c, ra == 2abdceac) If I put more database operation sentences into a file, and then run this file by lua. Lua can give correct result of query operation and insert values to table correctly, but always print error messages showed above. If I run sentences in the file one by one in lua command line interface, it never print this error message. It seems to give the error message when executing the 'require' function. But if I put require("lfs") into a file and run this file by lua, it never print error message. I am confused that whait is the difference between the lua command line execution and lua script.
There are three places in lsqlite3.c where sqlite_int64 is used (never long long directly). When you build sqlite3 some type will be used for 64 bit integers; lsqlite3 will use the same type by including sqlite3.h for the definition of the type.