Skip to content

Instantly share code, notes, and snippets.

View chrisseaton's full-sized avatar

Chris Seaton chrisseaton

View GitHub Profile
Dir.mktmpdir("ruby_tmp") {|tmpdir|
tmpfilename = "#{tmpdir}/ruby_tmp.#{$$}"
tmp = open(tmpfilename, "w")
tmp.print "tvi925\n";
tmp.print "tvi920\n";
tmp.print "vt100\n";
tmp.print "Amiga\n";
tmp.print "paper\n";
tmp.close
/Users/chrisseaton/Documents/ruby/truffleruby/truffleruby/src/main/ruby/core/truffle/cext.rb:1225:in `execute': error in C extension (RubyTruffleError)
SulongRuntimeException com.oracle.truffle.llvm.nodes.base.LLVMBasicBlockNode.executeStatements(LLVMBasicBlockNode.java:120)
@ossl_rand_bytes at line N/A (LLVM IR block: id: 0 name: %entry)
caused by Cannot convert DynamicObject@31880efa<Hash> to LLVMAddress IllegalStateException com.oracle.truffle.llvm.runtime.nodes.api.LLVMExpressionNode$LLVMForceLLVMAddressNode.nativeToAddress(LLVMExpressionNode.java:241)
from /Users/chrisseaton/Documents/ruby/truffleruby/truffleruby/src/main/ruby/core/truffle/cext.rb:1225:in `random_bytes'
from ../test.rb:3:in `<main>'
###
# Usage:
#
# $ ruby this_script.rb
# $ ruby this_script.rb https://tenderlovemaking.com
# jt run --sulong -Xpatching=false ../openssl-raw.rb
require 'openssl'
/Users/chrisseaton/Documents/ruby/truffleruby/truffleruby/src/main/ruby/core/truffle/cext.rb:1225:in `execute': LLVM error in assignment of %call2 in first basic block in function @ossl_ssl_connect (RubyTruffleError)
RuntimeException com.oracle.truffle.llvm.nodes.base.LLVMBasicBlockNode.executeStatements(LLVMBasicBlockNode.java:117)
caused by LLVM error in assignment of %call25 in basic block %for.cond in function @ossl_start_ssl RuntimeException com.oracle.truffle.llvm.nodes.base.LLVMBasicBlockNode.executeStatements(LLVMBasicBlockNode.java:117)
caused by com.oracle.truffle.nfi.LibFFIFunction@3dea1ecc[140523323598464] IllegalStateException com.oracle.truffle.llvm.nodes.func.LLVMNativeCallUtils.callNativeFunction(LLVMNativeCallUtils.java:69)
caused by LLVM error in assignment of %call4 in first basic block in function @ossl_ssl_verify_callback RuntimeException com.oracle.truffle.llvm.nodes.base.LLVMBasicBlockNode.executeStatements(LLVMBasicBlockNode.java:117)
caused by LLVM error in @ossl_verify_cb Ru
[INFO] org.truffleruby:truffleruby:jar:0-SNAPSHOT
[INFO] +- com.oracle.truffle:truffle-api:jar:0a4208265912ecfa452f8bb174b907f17b38609e-SNAPSHOT:compile
[INFO] +- com.oracle.truffle:truffle-debug:jar:0a4208265912ecfa452f8bb174b907f17b38609e-SNAPSHOT:compile
[INFO] | \- jline:jline:jar:2.11:compile
[INFO] +- com.oracle.truffle:truffle-dsl-processor:jar:0a4208265912ecfa452f8bb174b907f17b38609e-SNAPSHOT:provided
[INFO] +- com.oracle.truffle:truffle-tck:jar:0a4208265912ecfa452f8bb174b907f17b38609e-SNAPSHOT:test
[INFO] +- com.github.jnr:jnr-posix:jar:3.0.37:compile
[INFO] +- com.github.jnr:jnr-constants:jar:0.9.6:compile
[INFO] +- com.github.jnr:jnr-ffi:jar:2.1.3:compile
[INFO] | +- org.ow2.asm:asm:jar:5.0.3:compile
# Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved. This
# code is released under a tri EPL/GPL/LGPL license. You can use it,
# redistribute it and/or modify it under the terms of the:
#
# Eclipse Public License version 1.0
# GNU General Public License version 2
# GNU Lesser General Public License version 2.1
require 'active_record'
# Copyright © 2004-2008 Brent Fulgham, 2005-2015 Isaac Gouy
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
#!/usr/bin/env ruby
# Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved. This
# code is released under a tri EPL/GPL/LGPL license. You can use it,
# redistribute it and/or modify it under the terms of the:
#
# Eclipse Public License version 1.0
# GNU General Public License version 2
# GNU Lesser General Public License version 2.1
require 'webrick'
diff --git a/truffle/src/main/java/org/jruby/truffle/nodes/core/TrufflePrimitiveNodes.java b/truffle/src/main/java/org/jruby/truffle/nodes/core/TrufflePrimitiveNodes.java
index 356a478..b8ba1cd 100644
--- a/truffle/src/main/java/org/jruby/truffle/nodes/core/TrufflePrimitiveNodes.java
+++ b/truffle/src/main/java/org/jruby/truffle/nodes/core/TrufflePrimitiveNodes.java
@@ -539,4 +539,19 @@ public abstract class TrufflePrimitiveNodes {
}
}
+ @CoreMethod(names = "clock_gettime_monotonic", onSingleton = true)
+ public abstract static class ClockGetTimeMonotonicNode extends CoreMethodArrayArgumentsNode {