diff --git a/com.oracle.truffle.r.native/fficall/jni/src/alloc.c b/com.oracle.truffle.r.native/fficall/jni/src/alloc.c
index 3217c993e8f8e8b96655056355106d58608a8add..d8aeadae4bde78c8a55fc21faee2156f35411540 100644
--- a/com.oracle.truffle.r.native/fficall/jni/src/alloc.c
+++ b/com.oracle.truffle.r.native/fficall/jni/src/alloc.c
@@ -76,15 +76,24 @@ void *R_chk_realloc(void *p, size_t size) {
 }
 
 void R_chk_free(void *p) {
-	unimplemented("R_chk_free");
+    if(p) {
+	free(p);
+    }
 }
 
+int VMAX_MAGIC = 1234;
+
 void* vmaxget(void) {
-    unimplemented("vmaxget");
+//    unimplemented("vmaxget");
+    // ignored
+    return &VMAX_MAGIC;
 }
 
 void vmaxset(const void * x) {
-    unimplemented("vmaxget");
+//    unimplemented("vmaxget");
+    if (x != &VMAX_MAGIC) {
+	unimplemented("vmaxset with different value");
+    }
 }
 
 void R_gc(void) {
@@ -95,3 +104,4 @@ int R_gc_running() {
     unimplemented("R_gc_running");
     return 0;
 }
+
diff --git a/com.oracle.truffle.r.native/fficall/jni/src/attrib.c b/com.oracle.truffle.r.native/fficall/jni/src/attrib.c
index f72186fcbcb61d1a433026ff270870f761b9c7f4..2d357d13a7951c4276bcce12f48d75b180748098 100644
--- a/com.oracle.truffle.r.native/fficall/jni/src/attrib.c
+++ b/com.oracle.truffle.r.native/fficall/jni/src/attrib.c
@@ -25,16 +25,18 @@
 static jclass SEXPTYPEClass;
 static jmethodID gnuRCodeForObjectMethodID;
 static jmethodID NAMED_MethodID;
+static jmethodID DUPLICATE_ATTRIB_MethodID;
 
 void init_attrib(JNIEnv *env) {
 	SEXPTYPEClass = checkFindClass(env, "com/oracle/truffle/r/runtime/gnur/SEXPTYPE");
 	gnuRCodeForObjectMethodID = checkGetMethodID(env, SEXPTYPEClass, "gnuRCodeForObject", "(Ljava/lang/Object;)I", 1);
 	NAMED_MethodID = checkGetMethodID(env, CallRFFIHelperClass, "NAMED", "(Ljava/lang/Object;)I", 1);
+	DUPLICATE_ATTRIB_MethodID = checkGetMethodID(env, CallRFFIHelperClass, "DUPLICATE_ATTRIB", "(Ljava/lang/Object;Ljava/lang/Object;)V", 1);
 }
 
 int TYPEOF(SEXP x) {
-	JNIEnv *thisenv = getEnv();
-	return (*thisenv)->CallStaticIntMethod(thisenv, SEXPTYPEClass, gnuRCodeForObjectMethodID, x);
+    JNIEnv *thisenv = getEnv();
+    return (*thisenv)->CallStaticIntMethod(thisenv, SEXPTYPEClass, gnuRCodeForObjectMethodID, x);
 }
 
 SEXP ATTRIB(SEXP x){
@@ -79,6 +81,7 @@ void SET_ATTRIB(SEXP x, SEXP v){
 }
 
 void DUPLICATE_ATTRIB(SEXP to, SEXP from){
-    unimplemented("DUPLICATE_ATTRIB");
+    JNIEnv *thisenv = getEnv();
+    (*thisenv)->CallStaticVoidMethod(thisenv, CallRFFIHelperClass, DUPLICATE_ATTRIB_MethodID, to, from);
 }
 
diff --git a/com.oracle.truffle.r.runtime.ffi/src/com/oracle/truffle/r/runtime/ffi/jnr/CallRFFIHelper.java b/com.oracle.truffle.r.runtime.ffi/src/com/oracle/truffle/r/runtime/ffi/jnr/CallRFFIHelper.java
index 5a0572fb4e04cad581d50f042761b415baea8671..2501963a3b2484b277b578a9cc010ba2535f7ba8 100644
--- a/com.oracle.truffle.r.runtime.ffi/src/com/oracle/truffle/r/runtime/ffi/jnr/CallRFFIHelper.java
+++ b/com.oracle.truffle.r.runtime.ffi/src/com/oracle/truffle/r/runtime/ffi/jnr/CallRFFIHelper.java
@@ -472,6 +472,15 @@ public class CallRFFIHelper {
         }
     }
 
+    static void DUPLICATE_ATTRIB(Object to, Object from) {
+        if (from instanceof RAttributable) {
+            guaranteeInstanceOf(to, RAttributable.class);
+            RAttributes attributes = ((RAttributable) from).getAttributes();
+            ((RAttributable) to).initAttributes(attributes == null ? null : attributes.copy());
+        }
+        // TODO: copy OBJECT? and S4 attributes
+    }
+
     // Checkstyle: resume method name check
 
     static Object validate(Object x) {