Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/wasm/wrt/ngx_wrt_wasmer.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,15 @@ ngx_wasmer_init_conf(ngx_wavm_conf_t *conf, ngx_log_t *log)
char *auto_compiler = NULL;
wasm_config_t *config;

ngx_wasm_assert(conf->backtraces != NGX_CONF_UNSET);

if (conf->backtraces) {
setenv("RUST_BACKTRACE", "FULL", 1);

} else {
setenv("RUST_BACKTRACE", "0", 1);
}

config = wasm_config_new();
if (config == NULL) {
goto error;
Expand Down
2 changes: 2 additions & 0 deletions src/wasm/wrt/ngx_wrt_wasmtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,11 @@ ngx_wasmtime_init_conf(ngx_wavm_conf_t *conf, ngx_log_t *log)

if (conf->backtraces) {
setenv("WASMTIME_BACKTRACE_DETAILS", "1", 1);
setenv("RUST_BACKTRACE", "FULL", 1);

} else {
setenv("WASMTIME_BACKTRACE_DETAILS", "0", 1);
setenv("RUST_BACKTRACE", "0", 1);
}

config = wasm_config_new();
Expand Down
30 changes: 15 additions & 15 deletions t/01-wasm/directives/003-shm_directives.t
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ __DATA__
[error]
[crit]
[emerg]
stub
[stub]



Expand All @@ -36,7 +36,7 @@ stub
[error]
[crit]
[emerg]
stub
[stub]



Expand All @@ -50,7 +50,7 @@ qr/\[emerg\] .*? \[wasm\] invalid shm size "1x"/
--- no_error_log
[error]
[crit]
stub
[stub]
--- must_die


Expand All @@ -65,7 +65,7 @@ qr/\[emerg\] .*? \[wasm\] shm size of 8192 bytes is too small, minimum required
--- no_error_log
[error]
[crit]
stub
[stub]
--- must_die


Expand All @@ -80,7 +80,7 @@ qr/\[emerg\] .*? \[wasm\] shm size of 16383 bytes is not page-aligned, must be a
--- no_error_log
[crit]
[error]
stub
[stub]
--- must_die


Expand All @@ -95,7 +95,7 @@ qr/\[emerg\] .*? \[wasm\] invalid shm name ""/
--- no_error_log
[error]
[crit]
stub
[stub]
--- must_die


Expand All @@ -111,7 +111,7 @@ qr/\[emerg\] .*? "my_queue" shm already defined/
--- no_error_log
[error]
[crit]
stub
[stub]
--- must_die


Expand All @@ -127,7 +127,7 @@ qr/\[emerg\] .*? "my_kv" shm already defined/
--- no_error_log
[error]
[crit]
stub
[stub]
--- must_die


Expand All @@ -143,7 +143,7 @@ qr/\[emerg\] .*? "my_shm" shm already defined/
--- no_error_log
[error]
[crit]
stub
[stub]
--- must_die


Expand All @@ -159,7 +159,7 @@ stub
[error]
[crit]
[emerg]
stub
[stub]



Expand All @@ -173,7 +173,7 @@ qr/\[emerg\] .*? shm_queue \"my_shm\": queues do not support eviction policies/
--- no_error_log
[error]
[crit]
stub
[stub]
--- must_die


Expand All @@ -188,7 +188,7 @@ qr/\[emerg\] .*? invalid option \"foo=bar\"/
--- no_error_log
[error]
[crit]
stub
[stub]
--- must_die


Expand All @@ -203,7 +203,7 @@ qr/\[emerg\] .*? invalid option \"foo=bar\"/
--- no_error_log
[error]
[crit]
stub
[stub]
--- must_die


Expand All @@ -218,7 +218,7 @@ qr/\[emerg\] .*? invalid eviction policy \"foobar\"/
--- no_error_log
[error]
[crit]
stub
[stub]
--- must_die


Expand All @@ -233,5 +233,5 @@ qr/\[emerg\] .*? invalid eviction policy \"\"/
--- no_error_log
[error]
[crit]
stub
[stub]
--- must_die
2 changes: 1 addition & 1 deletion t/01-wasm/hfuncs/wasi/000-non_host_wasi.t
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ $ENV{TEST_NGINX_USE_VALGRIND} ? '' : 'daemon off;'
qr/\[emerg\] .*? failed linking "wasi_vm_tests"/
--- no_error_log
[crit]
stub
[stub]
--- must_die: 2
6 changes: 3 additions & 3 deletions t/03-proxy_wasm/003-on_tick.t
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ qr/.*?(\[error\]|Uncaught RuntimeError: |\s+)tick_period already set.*
--- no_error_log
[warn]
[crit]
stub
stub
stub
[stub1]
[stub2]
[stub3]
--- must_die
8 changes: 4 additions & 4 deletions t/03-proxy_wasm/directives/001-proxy_wasm_directive.t
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ qr/\[emerg\] .*? \[proxy-wasm\] "a" filter missing malloc \(incompatible SDK int
[error]
[crit]
[stderr]
stub
[stub]
--- must_die: 2


Expand Down Expand Up @@ -140,7 +140,7 @@ qr/\[emerg\] .*? \[proxy-wasm\] "a" filter missing one of: .*? \(incompatible SD
[error]
[crit]
[stderr]
stub
[stub]
--- must_die: 2


Expand Down Expand Up @@ -169,7 +169,7 @@ qr/\[emerg\] .*? \[proxy-wasm\] failed loading "a" filter \(unknown ABI version\
[error]
[crit]
[stderr]
stub
[stub]
--- must_die: 2


Expand Down Expand Up @@ -198,7 +198,7 @@ qr/\[emerg\] .*? \[proxy-wasm\] failed loading "a" filter \(incompatible ABI ver
[error]
[crit]
[stderr]
stub
[stub]
--- must_die: 2


Expand Down
8 changes: 4 additions & 4 deletions t/03-proxy_wasm/hfuncs/100-proxy_log.t
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ ok
]
--- no_error_log
[alert]
stub1
[stub]



Expand Down Expand Up @@ -97,6 +97,6 @@ C
]
--- no_error_log
[emerg]
stub
stub
stub
[stub1]
[stub2]
[stub3]
10 changes: 5 additions & 5 deletions t/03-proxy_wasm/hfuncs/102-proxy_send_local_response.t
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ should produce response with valid code
[error]
[crit]
[alert]
stub
[stub]



Expand Down Expand Up @@ -187,7 +187,7 @@ Hello world
[error]
[crit]
[alert]
stub
[stub]



Expand Down Expand Up @@ -319,7 +319,7 @@ qr/.*?host trap \(bad usage\): response already sent.*
\[warn\] .*? filter 1\/1 failed resuming "on_response_body" step in "body_filter" phase \(instance trapped\)/
--- no_error_log
[alert]
stub
[stub]



Expand Down Expand Up @@ -387,7 +387,7 @@ ok
[error]
[crit]
[alert]
stub
[stub]



Expand All @@ -413,7 +413,7 @@ Hello world
[error]
[crit]
[alert]
stub
[stub]



Expand Down
46 changes: 23 additions & 23 deletions t/03-proxy_wasm/hfuncs/105-proxy_get_http_request_header.t
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ Some-Header:
[crit]
[alert]
[stderr]
stub
stub
[stub1]
[stub2]



Expand Down Expand Up @@ -93,8 +93,8 @@ GET /t/echo/header/:path
[crit]
[alert]
[stderr]
stub
stub
[stub1]
[stub2]



Expand All @@ -114,8 +114,8 @@ GET //t/echo//header/:path
[crit]
[alert]
[stderr]
stub
stub
[stub1]
[stub2]



Expand All @@ -135,8 +135,8 @@ GET /t/echo/header/:path?foo=bar&hello=world
[crit]
[alert]
[stderr]
stub
stub
[stub1]
[stub2]



Expand All @@ -160,8 +160,8 @@ request's path (/t)
[crit]
[alert]
[stderr]
stub
stub
[stub1]
[stub2]



Expand All @@ -185,8 +185,8 @@ qq^:authority: localhost:$ENV{TEST_NGINX_SERVER_PORT}^
[crit]
[alert]
[stderr]
stub
stub
[stub1]
[stub2]



Expand Down Expand Up @@ -218,8 +218,8 @@ qq{
[crit]
[alert]
[stderr]
stub
stub
[stub1]
[stub2]



Expand All @@ -245,8 +245,8 @@ stub
[crit]
[alert]
[stderr]
stub
stub
[stub1]
[stub2]



Expand Down Expand Up @@ -281,8 +281,8 @@ qq{
[crit]
[emerg]
[alert]
stub
stub
[stub1]
[stub2]



Expand All @@ -309,9 +309,9 @@ header1000: 1000
[error]
[alert]
[crit]
stub
stub
stub
[stub1]
[stub2]
[stub3]



Expand Down Expand Up @@ -351,5 +351,5 @@ path: \/t/
[crit]
[emerg]
[alert]
stub
stub
[stub1]
[stub2]
Loading