Skip to content
This repository has been archived by the owner on Sep 13, 2021. It is now read-only.

Illegal instruction #34

Open
Chris-Ariel opened this issue Jan 29, 2019 · 7 comments
Open

Illegal instruction #34

Chris-Ariel opened this issue Jan 29, 2019 · 7 comments

Comments

@Chris-Ariel
Copy link

Chris-Ariel commented Jan 29, 2019

root@kali:~# git clone https://github.com/ernw/ss7MAPer.git
root@kali:~# tar -jxvf ss7MAPer-v0.2_linux_x64.tar.bz2

root@kali:~# git clone git://github.com/rebar/rebar.git


root@kali:~# cd rebar
root@kali:~/rebar# ./bootstrap
No beam files found.
Recompile: src/rebar
Recompile: src/rebar_abnfc_compiler
Recompile: src/rebar_app_utils
……………………………………………………………
Recompile: src/rebar_utils
Recompile: src/rebar_xref
Recompile: src/rmemo
==> rebar (compile)
==> rebar (escriptize)
Congratulations! You now have a self-contained script called "rebar" in
your current working directory. Place this script anywhere in your path
and you can use rebar to build OTP-compliant apps.

root@kali:~/rebar# cd ../ss7MAPer

root@kali:~/ss7MAPer# mv ../rebar/rebar ./

root@kali:~/ss7MAPer# vi rebar.config

{erl_opts, [debug_info]}.
{deps, [
		{osmo_ss7, "1", {git, "git://git.osmocom.org/erlang/osmo_ss7/", "master"}},
		{osmo_sccp, "1", {git, "git://git.osmocom.org/erlang/osmo_sccp/", "master"}},
		{osmo_map, "1", {git, "git://git.osmocom.org/erlang/osmo_map/", "master"}}
	]}.
{eunit_opts, [verbose, {report,{eunit_surefire,[{dir,"."}]}}]}.
{sub_dirs, ["rel"]}.


root@kali:~/rebar# cd /usr/local/bin
root@kali:/usr/local/bin# ln -s ~/rebar/rebar /usr/local/bin/rebar

root@kali:~/ss7MAPer# ./rebar get-deps
==> ss7MAPer (get-deps)
==> rel (get-deps)
==> osmo_ss7 (get-deps)
==> epcap (get-deps)
==> pkt (get-deps)
==> osmo_sccp (get-deps)
==> osmo_map (get-deps)



root@kali:~/ss7MAPer#cd ~/ss7MAPer/deps/osmo_map/

root@kali:~/ss7MAPer/deps/osmo_map# patch -p1 < ../../patches/osmo_map.patch
(Stripping trailing CRs from patch; use --binary to disable.)
patching file asn1/MAP-Contracts.asn
(Stripping trailing CRs from patch; use --binary to disable.)
patching file ebin/osmo_map.app
(Stripping trailing CRs from patch; use --binary to disable.)
patching file rebar.config
(Stripping trailing CRs from patch; use --binary to disable.)
patching file src/map_dlg_server.erl
(Stripping trailing CRs from patch; use --binary to disable.)
patching file src/map_helper.erl
(Stripping trailing CRs from patch; use --binary to disable.)
patching file src/map_ss_server.erl


root@kali:~/ss7MAPer/deps/osmo_map# cd ../osmo_sccp/

root@kali:~/ss7MAPer/deps/osmo_sccp# patch -p1 < ../../patches/osmo_sccp.patch
(Stripping trailing CRs from patch; use --binary to disable.)
patching file ebin/osmo_sccp.app
(Stripping trailing CRs from patch; use --binary to disable.)
patching file rebar.config
(Stripping trailing CRs from patch; use --binary to disable.)
patching file src/osmo_sccp_tcap.erl
(Stripping trailing CRs from patch; use --binary to disable.)
patching file src/sccp_scrc.erl
(Stripping trailing CRs from patch; use --binary to disable.)
patching file src/sccp_user.erl

root@kali:~/ss7MAPer/deps/osmo_sccp# cd ../osmo_ss7/

root@kali:~/ss7MAPer/deps/osmo_ss7# patch -p1 < ../../patches/osmo_ss7.patch
(Stripping trailing CRs from patch; use --binary to disable.)
patching file include/osmo_ss7.hrl
(Stripping trailing CRs from patch; use --binary to disable.)
patching file include/sccp.hrl
(Stripping trailing CRs from patch; use --binary to disable.)
patching file src/m3ua_codec.erl
(Stripping trailing CRs from patch; use --binary to disable.)
patching file src/m3ua_core.erl
(Stripping trailing CRs from patch; use --binary to disable.)
patching file src/sccp_codec.erl
(Stripping trailing CRs from patch; use --binary to disable.)
patching file src/sctp_core.erl
(Stripping trailing CRs from patch; use --binary to disable.)
patching file src/ss7_link_m3ua.erl
(Stripping trailing CRs from patch; use --binary to disable.)
patching file src/ss7_links.erl
(Stripping trailing CRs from patch; use --binary to disable.)
patching file src/ss7_routes.erl



root@kali:~/ss7MAPer/deps/osmo_ss7# cd ../epcap/
root@kali:~/ss7MAPer/deps/epcap# vi rebar.config


{port_envs, [   
	  {"DRV_CFLAGS", "-g -Wall $ERL_CFLAGS"},   
	  {"DRV_LDFLAGS", "-lpcap $ERL_LDFLAGS"}   
 ]}.   

change!

 {port_envs, [   
	{"CFLAGS", "-g -Wall $ERL_CFLAGS"},   
	{"LDFLAGS", "-lpcap $ERL_LDFLAGS"}   
 ]}.  



root@kali:~/ss7MAPer/deps/epcap# cd ..
root@kali:~/ss7MAPer/deps# git clone http://cgit.osmocom.org/erlang/signerl/
Cloning into 'signerl'...





root@kali:~/ss7MAPer/deps# cd signerl/TCAP/asn_src/ITU/

root@kali:~/ss7MAPer/deps/signerl/TCAP/asn_src/ITU# make
erlc  -W -b ber_bin +optimize +debug_info Remote-Operations-Information-Objects.asn Remote-Operations-Generic-ROS-PDUs.asn Remote-Operations-Useful-Definitions.asn
Warning: The option 'ber_bin' is now called 'ber'.
Warning: The option 'optimize' is no longer needed.
Warning: The option 'ber_bin' is now called 'ber'.
Warning: The option 'optimize' is no longer needed.
Wrong format of type/value false/{'Externalvaluereference',144,
                                     'Remote-Operations-Generic-ROS-PDUs',
                                     noInvokeId}
Warning: The option 'ber_bin' is now called 'ber'.
Warning: The option 'optimize' is no longer needed.
erlc  -W -b ber_bin +optimize +debug_info TCAPMessages.asn
Warning: The option 'ber_bin' is now called 'ber'.
Warning: The option 'optimize' is no longer needed.
erlc  -W -b ber_bin +optimize +debug_info TR.asn
Warning: The option 'ber_bin' is now called 'ber'.
Warning: The option 'optimize' is no longer needed.
erlc -b beam -W -v +warn_unused_vars +debug_info -o ../../ebin/itu TR.erl
TR.erl:57: Warning: variable 'Reason' is unused
TR.erl:71: Warning: variable 'Reason' is unused
TR.erl:662: Warning: variable 'Arg' is unused
erlc  -W -b ber_bin +optimize +debug_info TC.asn
Warning: The option 'ber_bin' is now called 'ber'.
Warning: The option 'optimize' is no longer needed.
erlc -b beam -W -v +warn_unused_vars +debug_info -o ../../ebin/itu TC.erl
TC.erl:71: Warning: variable 'Reason' is unused
TC.erl:85: Warning: variable 'Reason' is unused
TC.erl:886: Warning: variable 'Arg' is unused
erlc -b beam -W -v +warn_unused_vars +debug_info -o ../../ebin/itu TCAPMessages.erl
TCAPMessages.erl:57: Warning: variable 'Reason' is unused
TCAPMessages.erl:71: Warning: variable 'Reason' is unused
TCAPMessages.erl:490: Warning: variable 'Arg' is unused
erlc  -W -b ber_bin +optimize +debug_info DialoguePDUs.asn
Warning: The option 'ber_bin' is now called 'ber'.
Warning: The option 'optimize' is no longer needed.
erlc -b beam -W -v +warn_unused_vars +debug_info -o ../../ebin/itu DialoguePDUs.erl
DialoguePDUs.erl:71: Warning: variable 'Reason' is unused
DialoguePDUs.erl:85: Warning: variable 'Reason' is unused
DialoguePDUs.erl:997: Warning: variable 'Arg' is unused
erlc  -W -b ber_bin +optimize +debug_info UnidialoguePDUs.asn
Warning: The option 'ber_bin' is now called 'ber'.
Warning: The option 'optimize' is no longer needed.
erlc -b beam -W -v +warn_unused_vars +debug_info -o ../../ebin/itu UnidialoguePDUs.erl
UnidialoguePDUs.erl:53: Warning: variable 'Reason' is unused
UnidialoguePDUs.erl:67: Warning: variable 'Reason' is unused
UnidialoguePDUs.erl:394: Warning: variable 'Arg' is unused
erlc  -W -b ber_bin +optimize +debug_info TC-TMP.asn
Warning: The option 'ber_bin' is now called 'ber'.
Warning: The option 'optimize' is no longer needed.
erlc  -W -b ber_bin +optimize +debug_info TC-Testing-User.asn
Warning: The option 'ber_bin' is now called 'ber'.
Warning: The option 'optimize' is no longer needed.
erlc -b beam -W -v +warn_unused_vars +debug_info -o ../../ebin/itu TC-Testing-User.erl
TC-Testing-User.erl:276: Warning: variable 'Arg' is unused
erlc  -W -b ber_bin +optimize +debug_info TCAP-Examples.asn
Warning: The option 'ber_bin' is now called 'ber'.
Warning: The option 'optimize' is no longer needed.
erlc -b beam -W -v +warn_unused_vars +debug_info -o ../../ebin/itu TCAP-Examples.erl
TCAP-Examples.erl:77: Warning: variable 'Reason' is unused
TCAP-Examples.erl:91: Warning: variable 'Reason' is unused
TCAP-Examples.erl:523: Warning: variable 'Arg' is unused
erlc  -W -b ber_bin +optimize +debug_info TCAP-Tools.asn
Warning: The option 'ber_bin' is now called 'ber'.
Warning: The option 'optimize' is no longer needed.
erlc -b beam -W -v +warn_unused_vars +debug_info -o ../../ebin/itu TCAP-Tools.erl
TCAP-Tools.erl:56: Warning: variable 'Reason' is unused
TCAP-Tools.erl:70: Warning: variable 'Reason' is unused
TCAP-Tools.erl:262: Warning: variable 'Arg' is unused
rm TC.erl


root@kali:~/ss7MAPer/deps/signerl/TCAP/asn_src/ITU# cp -rl ~/ss7MAPer/deps/signerl/TCAP/asn_src/ITU/* ~/ss7MAPer/deps/osmo_sccp/src/


root@kali:~/ss7MAPer/deps/signerl/TCAP/asn_src/ITU# mkdir ~/ss7MAPer/deps/epcap/deps
root@kali:~/ss7MAPer/deps/signerl/TCAP/asn_src/ITU# ln -sd ~/ss7MAPer/deps/pkt ~/ss7MAPer/deps/epcap/deps/pkt

root@kali:~/ss7MAPer/deps/signerl/TCAP/asn_src/ITU# mkdir ~/ss7MAPer/deps/osmo_sccp/deps
root@kali:~/ss7MAPer/deps/signerl/TCAP/asn_src/ITU# ln -sd ~/ss7MAPer/deps/osmo_ss7 ~/ss7MAPer/deps/osmo_sccp/deps/osmo_ss7
root@kali:~/ss7MAPer/deps/signerl/TCAP/asn_src/ITU# ln -sd ~/ss7MAPer/deps/epcap ~/ss7MAPer/deps/osmo_sccp/deps/epcap
root@kali:~/ss7MAPer/deps/signerl/TCAP/asn_src/ITU# ln -sd ~/ss7MAPer/deps/pkt ~/ss7MAPer/deps/osmo_sccp/deps/pkt
root@kali:~/ss7MAPer/deps/signerl/TCAP/asn_src/ITU# ln -sd ~/ss7MAPer/deps/signerl/MAP ~/ss7MAPer/deps/osmo_sccp/deps/MAP
root@kali:~/ss7MAPer/deps/signerl/TCAP/asn_src/ITU# ln -sd ~/ss7MAPer/deps/signerl/SCCP ~/ss7MAPer/deps/osmo_sccp/deps/SCCP
root@kali:~/ss7MAPer/deps/signerl/TCAP/asn_src/ITU# ln -sd ~/ss7MAPer/deps/signerl/TCAP ~/ss7MAPer/deps/osmo_sccp/deps/TCAP

root@kali:~/ss7MAPer/deps/signerl/TCAP/asn_src/ITU# mkdir ~/ss7MAPer/deps/osmo_map/deps
root@kali:~/ss7MAPer/deps/signerl/TCAP/asn_src/ITU# ln -sd ~/ss7MAPer/deps/osmo_ss7 ~/ss7MAPer/deps/osmo_map/deps/osmo_ss7
root@kali:~/ss7MAPer/deps/signerl/TCAP/asn_src/ITU# ln -sd ~/ss7MAPer/deps/epcap ~/ss7MAPer/deps/osmo_map/deps/epcap
root@kali:~/ss7MAPer/deps/signerl/TCAP/asn_src/ITU# ln -sd ~/ss7MAPer/deps/pkt ~/ss7MAPer/deps/osmo_map/deps/pkt


root@kali:~/ss7MAPer/deps/signerl/TCAP/asn_src/ITU# cp ~/ss7MAPer/deps/signerl/SCCP/itu/include/sccp.hrl ~/ss7MAPer/deps/osmo_sccp/src/
root@kali:~/ss7MAPer/deps/signerl/TCAP/asn_src/ITU# cp ~/ss7MAPer/deps/signerl/TCAP/include/tcap.hrl ~/ss7MAPer/deps/osmo_map/src/


root@kali:~/ss7MAPer/deps/signerl/TCAP/asn_src/ITU# cd /usr/local/bin/
root@kali:/usr/local/bin# ln -s ~/rebar/rebar /usr/local/bin/rebar



root@kali:/usr/local/bin# cd ~/ss7MAPer/
root@kali:~/ss7MAPer# ./rebar co

==> root (compile)

root@kali:~# cd ss7MAPer/
root@kali:~/ss7MAPer# ./rebar shell
==> ss7MAPer (shell)
Erlang/OTP 18 [erts-7.3] [source] [64-bit] [async-threads:10] [hipe] [kernel-poll:false]	
Eshell V7.3  (abort with ^G)
1> application:start(sasl).
	ok
			
	=PROGRESS REPORT==== 29-Jan-2019::05:32:48 ===
		 supervisor: {local,sasl_safe_sup}
		 started: [{pid,<0.60.0>},
			     {id,alarm_handler},
			     {mfargs,{alarm_handler,start_link,[]}},
			     {restart_type,permanent},
			     {shutdown,2000},
			     {child_type,worker}]
			
	=PROGRESS REPORT==== 29-Jan-2019::05:32:48 ===
		supervisor: {local,sasl_safe_sup}
		started: [{pid,<0.61.0>},
			      {id,overload},
			      {mfargs,{overload,start_link,[]}},
			      {restart_type,permanent},
			      {shutdown,2000},
			      {child_type,worker}]
2> 
	=PROGRESS REPORT==== 29-Jan-2019::05:32:48 ===
		supervisor: {local,sasl_sup}
		started: [{pid,<0.59.0>},
			       {id,sasl_safe_sup},
			       {mfargs,
			               {supervisor,start_link,
			                       [{local,sasl_safe_sup},sasl,safe]}},
			       {restart_type,permanent},
			       {shutdown,infinity},
			       {child_type,supervisor}]
			
	=PROGRESS REPORT==== 29-Jan-2019::05:32:48 ===
		supervisor: {local,sasl_sup}
		started: [{pid,<0.62.0>},
			       {id,release_handler},
			       {mfargs,{release_handler,start_link,[]}},
			       {restart_type,permanent},
			       {shutdown,2000},
			       {child_type,worker}]
			
	=PROGRESS REPORT==== 29-Jan-2019::05:32:48 ===
		application: sasl
		started_at: nonode@nohost



			2> application:start(ss7MAPer).
			
			=PROGRESS REPORT==== 29-Jan-2019::05:34:20 ===
			         application: ss7MAPer
			          started_at: nonode@nohost
			ok

root@kali:~/ss7MAPer# ./bin/ss7MAPer console
Exec: /root/ss7MAPer/erts-7.3/bin/erlexec -boot /root/ss7MAPer/releases/1/ss7MAPer -mode embedded -config /root/ss7MAPer/releases/1/sys.config -args_file /root/ss7MAPer/releases/1/vm.args -- console
Root: /root/ss7MAPer
Illegal instruction

Erlang == 18.3
kali

how to solve the problem

@0xc0decafe
Copy link
Contributor

Hi,

can you give me the output of:

  • 'uname -a'
  • 'erl -version'

best

/daniel

@moaeddy
Copy link

moaeddy commented Feb 6, 2019

after following @Chris-Ariel make i end up getting this

./rebar shell
==> ss7MAPer (shell)
ERROR: shell failed while processing /root/ss7MAPer: {'EXIT',{{badmatch,{error,bad_directory}},
[{rebar_shell,shell,2,[{file,"src/rebar_shell.erl"},{line,43}]},
{rebar_core,run_modules,4,[{file,"src/rebar_core.erl"},{line,493}]},
{rebar_core,execute,6,[{file,"src/rebar_core.erl"},{line,418}]},
{rebar_core,maybe_execute,8,
[{file,"src/rebar_core.erl"},{line,302}]},
{rebar_core,process_dir1,7,[{file,"src/rebar_core.erl"},{line,261}]},
{rebar_core,process_commands,2,
[{file,"src/rebar_core.erl"},{line,93}]},
{rebar,main,1,[{file,"src/rebar.erl"},{line,58}]},
{escript,run,2,[{file,"escript.erl"},{line,757}]}]}}

when i run ./bin/ss7MAPer console

i got this bash: ./bin/ss7MAPer: No such file or directory

how can this be fixed, and thanks chris your make really help me get somewhere

@0xc0decafe
Copy link
Contributor

Hi,

please do not hijack issues, but open a new one instead.

best

/d

@Chris-Ariel
Copy link
Author

Thanks for your reply!

root@root:~# uname -a
Linux root 4.14.0-kali3-amd64 #1 SMP Debian 4.14.12-2kali1 (2018-01-08) x86_64 GNU/Linux

root@root:~# erl -version
Erlang (ASYNC_THREADS,HIPE) (BEAM) emulator version 7.3

@0xc0decafe
Copy link
Contributor

Hi,

this seems to be a known bug when running erlang binaries on older cpus (without sse2). You can fix this by building your erlang from source and configure it with --enable-ethread-pre-pentium4-compatibility (see http://erlang.2086793.n4.nabble.com/R14B-Illegal-instruction-td2544273.html).

best

/daniel

@allstable
Copy link

allstable commented Apr 23, 2019

Bro, I find even in Docker ,It has the same issue:
图片
Should I rebuild the Erlang Env?
……
I have rebuild the Erlang with option --enable-ethread-pre-pentium4-compatibility,but it does not work. In my host,it appears the same issue:
图片

Looking forward for your response,Thank you.

@allstable
Copy link

I have tried to rebuild Erlang with options "./configure --prefix=/opt/erlang --without-javac --enable-smp-support --enable-threads --enable-m64-build", it does not work neither.Pop put the same issue when I start the ss7Maper program. Anything help? Thanks!
图片
Or I wanna to know what is the apropriate machine to run this program,the preliminary condition of a machine.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants