Undefined: prim_file:internal_name2native/1 #45

Closed
sivieri opened this Issue Dec 19, 2010 · 8 comments

Projects

None yet

4 participants

@sivieri

Hi,

I have just compiled Erjang, against Sun Java 1.6.0 and Erlang R14B01, on Ubuntu 10.10 64bit, but when I launch ej, it crashes with the following stack [1]. Any idea?

[1] http://pastebin.com/mmLSLMYb

@krestenkrab
Trifork member

Yep, the issue is simply that the named built-in function is missing.

If you want to help, figure out what it is supposed to do, and go implement something like this: (I only have web-access right now, so this is a rough guess at the details... you can find inspiration for how to code it in other erjang.m.*.Native classes)

file: src/main/java/erjang/m/prim_file/Native.java


public class Native extends erjang.ENative {

@BIF
public static EObject internal_name2native(EObject arg) {
...
}

}

@sivieri

I'm trying to do, but I'm still trying to find out where is located that function (which is called from prim_file.erl, but its definition is not in that file)...

@sivieri

Hi,

I have implemented a basic version of the two functions (which you can find in my branch), and they seem to behave as their C counterparts do, at least they seem to return the same values as them.
But the erjang shell still does not boot, and after some prints in the original erlang code, I have found out that name2native, when invoked from the erlang shell, receives as input different paths, while when invoked from the erjang one, it receives the same path appended to the preceeding invocation.

Any thoughts about this?

@sivieri

By the way: sorry if I am writing on a closed issue, but I have closed it by accident and I don't know how to reopen it...

@eriksoe

I tried booting with R14B01, and there appears to be a different wrt. how the efile driver communicates with prim_file (cf. translate_response/2: what used to be an OK-with-data is now given a separate tag ?FILE_RESP_ALL_DATA).

@krestenkrab
Trifork member

It looks like this may be the commit that broke our efile driver: erlang/otp@63eeba2

Should be simple enough to fix in EFile then, but we need a strategy for handling different versions of erts in a driver so Erjang works for both 5.7.x and 5.8.x versions of erts; for now, maybe we can just do erjang.Main.erts_version.startsWith("5.7.") // or "5.8."

@jetztgradnet

I got Erjang to work with R14B01. See pull request 56.

@krestenkrab
Trifork member

Super, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment