Bug 251760 - erlang program doesn't pass guard sequence checks
Summary: erlang program doesn't pass guard sequence checks
Status: Closed Not Accepted
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-11 16:28 UTC by Lari Sihto
Modified: 2021-10-04 07:20 UTC (History)
1 user (show)

See Also:


Attachments
simple test program to test erlang guard sequences (118 bytes, text/plain)
2020-12-11 16:28 UTC, Lari Sihto
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lari Sihto 2020-12-11 16:28:26 UTC
Created attachment 220460 [details]
simple test program to test erlang guard sequences

I can't get erlang guard sequences to work right. Maybe I'm just missing something or I've run across a bug. Could someone please test this if it affects someone else besides me? Using FreeBSD 12.2-stable and installed erlang through 'pkg install'.

$ erlc quardseq.erl 

$ erl -noshell -s guardseq.erl start -s init stop
{"init terminating in do_boot",{undef,[{'guardseq.erl',start,[],[]},{init,start_em,1,[]},{init,do_boot,3,[]}]}}
init terminating in do_boot ({undef,[{guardseq.erl,start,[],[]},{init,start_em,1,[]},{init,do_boot,3,[]}]})

this program should pass the guard sequence test but doesn't.
Comment 1 Lari Sihto 2020-12-11 16:52:00 UTC
$ pkg info erlang
erlang-21.3.8.18,4
Name           : erlang
Version        : 21.3.8.18,4
Installed on   : Fri Dec 11 01:34:52 2020 EET
Origin         : lang/erlang
Architecture   : FreeBSD:12:amd64
Prefix         : /usr/local
Categories     : java lang parallel
Licenses       : APACHE20
Maintainer     : erlang@FreeBSD.org
WWW            : https://www.erlang.org/
Comment        : Functional programming language from Ericsson
Options        :
        CORBA          : on
        DIRTY          : on
        DTRACE         : on
        FOP            : off
        HIPE           : on
        JAVA           : off
        KQUEUE         : on
        MANPAGES       : on
        NATIVE         : off
        ODBC           : off
        OPENSSL        : on
        PDF            : off
        SCTP           : on
        THREADS        : on
        WX             : off
Annotations    :
        FreeBSD_version: 1202502
        icon           : http://www.pcbsd.org/appcafe/icons/lang_erlang.png
Flat size      : 93.0MiB
Description    :
Erlang is a programming language used to build massively scalable soft
real-time systems with requirements on high availability. Some of its
uses are in telecoms, banking, e-commerce, computer telephony and
instant messaging. Erlang's runtime system has built-in support for
concurrency, distribution and fault tolerance.

WWW: https://www.erlang.org/
Comment 2 Dave Cottlehuber freebsd_committer freebsd_triage 2021-10-04 07:20:02 UTC
Lari this is because you're not using `erl -s ..` correctly. This is covered in the manpage http://erlang.org/doc/man/erl.html but you kinda need to know what you're looking at first.

-s takes a module name (guardseq) not a filename.

$ erl -noshell -s guardseq start -s init stop
4


I'd normally test this via shell:

$ erl
Erlang/OTP 24 [erts-12.1.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit] [dtrace] [sharing-preserving]

Eshell V12.1.1  (abort with ^G)
1> c(guardseq).
{ok,guardseq}
2> guardseq:add(1).
** exception error: no function clause matching guardseq:add(1) (guardseq.erl, line 4)
3> guardseq:add(4).
4
ok
4> 


For language support, best to use erlang-questions mailing list or libera.chat irc etc.