Skip to content

Instantly share code, notes, and snippets.

@bjfish
bjfish / test-unit-failures.txt
Created July 31, 2020 15:07
test-unit failures
% rake
/Users/bfish/Documents/truffleruby-ws/truffleruby/mxbuild/truffleruby-native/jre/languages/ruby/bin/truffleruby test/run-test.rb
Loaded suite test
Started
..................................................................................................................E
============================================================================================================================================================================================================
<internal:core> core/throw_catch.rb:36:in `catch'
<internal:core> core/throw_catch.rb:36:in `catch'
647: def test_assert_raise_jruby
648: omit("For JRuby") unless Object.const_defined?(:Java)
@bjfish
bjfish / string-split.patch
Created July 23, 2020 00:47
String#split work
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 77a39c23ca..5da6d4b423 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,20 +1,3 @@
-# 20.3.0
-
-New features:
-
-
with cellulloid
behaves like an snmp client
#get
Threads and backtraces:
#<Thread:0x6300@<foreign thread> run>
#<Celluloid::Thread:0x6308@/Users/brandonfish/Documents/oracle-workspace/gem_home/gems/celluloid-0.17.4/lib/celluloid/group/spawner.rb:47 sleep>
/Users/brandonfish/Documents/oracle-workspace/truffleruby-ws/truffleruby/mxbuild/truffleruby-jvm/jre/languages/ruby/lib/truffle/truffle/cext_ruby.rb:37:in `closed?'
/Users/brandonfish/Documents/oracle-workspace/gem_home/gems/celluloid-io-0.17.3/lib/celluloid/io/reactor.rb:52:in `wait'
// Call the exported "hello_wasm" function of our instance
wasmer_value_t params[] = {};
wasmer_value_t result_one;
wasmer_value_t results[] = {result_one};
wasmer_result_t call_result = wasmer_instance_call(instance, "_hello_wasm", params, 0, results, 1);
printf("Call result: %d\n", call_result);
assert(call_result == WASMER_OK);
assert(print_str_called);
// Use *_destroy methods to cleanup as specified in the header documentation
// Call the exported "hello_wasm" function of our instance
wasmer_value_t params[] = {};
wasmer_value_t result_one;
wasmer_value_t results[] = {result_one};
wasmer_result_t call_result = wasmer_instance_call(instance, "_hello_wasm", params, 0, results, 1);
printf("Call result: %d\n", call_result);
assert(call_result == WASMER_OK);
assert(print_str_called);
// Use *_destroy methods to cleanup as specified in the header documentation
// Read the wasm file bytes
FILE *file = fopen("wasm-sample-app/target.wasm", "r");
fseek(file, 0, SEEK_END);
long len = ftell(file);
uint8_t *bytes = malloc(len);
fseek(file, 0, SEEK_SET);
fread(bytes, 1, len, file);
fclose(file);
// Creates a WebAssembly Instance from wasm bytes and imports
// Create module name for our imports
// represented in bytes for UTF-8 compatability
char *module_name = "env";
wasmer_byte_array module_name_bytes;
module_name_bytes.bytes = module_name;
module_name_bytes.bytes_len = strlen(module_name);
// Define a function import
char *import_name = "_print_str";
wasmer_byte_array import_name_bytes;
int main()
{
wasmer_value_tag params_sig[] = {WASM_I32, WASM_I32};
wasmer_value_tag returns_sig[] = {};
wasmer_import_func_t *func = wasmer_import_func_new(print_str, params_sig, 2, returns_sig, 0);
void print_wasmer_error()
{
int error_len = wasmer_last_error_length();
printf("Error len: `%d`\n", error_len);
char *error_str = malloc(error_len);
wasmer_last_error_message(error_str, error_len);
printf("Error str: `%s`\n", error_str);
}
void print_str(wasmer_instance_context_t *ctx, int32_t ptr, int32_t len)
{
print_str_called = true;
wasmer_memory_t *memory = wasmer_instance_context_memory(ctx, 0);
uint32_t mem_len = wasmer_memory_length(memory);
uint8_t *mem_bytes = wasmer_memory_data(memory);
printf("%.*s", len, mem_bytes + ptr);
}