Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

freebsd core dump #2

Closed
cduret opened this issue Jun 11, 2015 · 16 comments
Closed

freebsd core dump #2

cduret opened this issue Jun 11, 2015 · 16 comments

Comments

@cduret
Copy link

cduret commented Jun 11, 2015

hi,
I could not compile Elymas.

OS:
$ uname -a
FreeBSD darkstar 10.1-STABLE FreeBSD 10.1-STABLE #0 r277559: Fri Jan 23 10:05:15 CET 2015 root@darkstar:/usr/obj/usr/src/sys/THINKPKERNEL amd64

PERL version:
$ perl -v
This is perl 5, version 14, subversion 4 (v5.14.4) built for amd64-freebsd

it stop here :
$ gmake
......
cd compiler &&
../interpreter/elymas elymas.ey ../elymas/interpreter.ey
Makefile:7: recipe for target 'elymas/interpreter' failed
gmake: *** [elymas/interpreter] Segmentation fault (core dumped)

@Drahflow
Copy link
Owner

This happens because Elymas does not depend on libc, but instead does everything itself. It happily expects the Linux syscall interface.

To port Elymas to BSD, all syscall invocations must be ported. Look here for example:
https://github.com/Drahflow/Elymas/blob/master/compiler/standardClient.ey#l413

@cduret
Copy link
Author

cduret commented Jun 11, 2015

ok I'll check it out and let u know if I make it
thanks

@lutoma
Copy link

lutoma commented Jun 12, 2015

Wouldn't it be considerably more practical to just link with a libc, even if it's just a small portable one like newlib? Especially in terms of porting, but also compatbility.

@Drahflow
Copy link
Owner

Define "practical". Linking against shared libraries would mean to replace / patch the memory allocation routine when waking up from the first freeze (before freeze we'd have to use the Perl-loaded mmap, after freeze whatever the linker came up with.) I'll put it into the TODO for the time being...

@cduret
Copy link
Author

cduret commented Jun 21, 2015

freebsd amd64 has same syscall call convention. Only call numbers and constants number are differents.

I changed some syscall numbers in compiler/standardClient.ey and compiler/elymasAsmLib.ey

The core dump does not occurs now but still some error occurs :
@ gmake
cd compiler &&
../interpreter/elymas elymas.ey ../elymas/interpreter.ey
Makefile:7: recipe for target 'elymas/interpreter' failed
gmake: *** [elymas/interpreter] Error 2

@Drahflow
Copy link
Owner

I think, it's probably best if I take a look at this on a FreeBSD system. Need to grab one first though, this might take a while.

@cduret
Copy link
Author

cduret commented Jun 24, 2015

no problem.
brilliant project anyway ;-)

@Drahflow
Copy link
Owner

I'd be glad to hear whether you have any success with the new freebsd branch (I'll put it into some arch directory later, but let's first see what really needs to be changed...)

Shared library support is not there yet, so you'll only get the loaded executable (and the sys .linux scope will be there but ... it'll try very hard to talk to a Linux kernel). Nonetheless, most of the tutorial stuff should work with loaded just as well.

@Drahflow
Copy link
Owner

Shared library support is now available. You might get a shared as well.

@lutoma
Copy link

lutoma commented Jun 29, 2015

Nice! Once you've got the FreeBSD thing merged into the main branch in some arch folder or something, I might port Elymas to Xelix just for the heck of it. 😸

@cduret
Copy link
Author

cduret commented Jun 29, 2015

hello,
it compiles fine : interpreter, optimize and shared
I play with tutorial to test a little bit more

@Drahflow
Copy link
Owner

Drahflow commented Jul 1, 2015

FYI: FreeBSD support is now in master, please switch away from the freebsd branch (which I pruned).

@danieltanfh95
Copy link

Seems like it fails on ubuntu, probably the same problem as before

@Drahflow
Copy link
Owner

@shadowys Sorry for late answer, was away during easter.

Thanks for trying to build and reporting a failure. Could you be more specific about what you observed while trying to build (ideally a log or screencast) and which Ubuntu Version you use exactly?

I'm rather certain, it's not the same problem I had on FreeBSD (wrong syscall numbers), because Ubuntu does use a Linux kernel and thus the same syscall numbers my Debian has.

@danieltanfh95
Copy link

Hmm, it might be something else then, this is what I did:

https://asciinema.org/a/bgt2p6zit6vvfvhxb14p0l4ao

Distributor ID: Ubuntu
Description:    Ubuntu 16.04.2 LTS
Release:        16.04
Codename:       xenial

I tried it on CloudLinux and it works perfectly fine.

@Drahflow
Copy link
Owner

Now that is sure interesting, thank you very much indeed. I'll have a look with some Ubuntu VM, but it might take some days (busy with work).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants