lightning
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Lightning] Porting GNU Smalltalk to lightning 2


From: Paulo César Pereira de Andrade
Subject: Re: [Lightning] Porting GNU Smalltalk to lightning 2
Date: Fri, 24 Oct 2014 20:22:26 -0200

2014-10-24 16:44 GMT-02:00 Holger Hans Peter Freyther <address@hidden>:
> On Fri, Oct 24, 2014 at 03:11:46PM -0200, Paulo César Pereira de Andrade 
> wrote:
>
> Hi!
>
>> I think the likely cause in 32-bit is possibly code expecting a non callee
>> save register value to be kept after some non local jump. Or maybe I
>> just got confused in some step translating from lightning 1.x to
>> lightning 2.x.

  I just tested on another 32 bit arch, hoping that testing on register richer
arches would sort out issues with a register being used as a temporary,
(what lightning 2.x should do only after a non local jump with a single
path, that is, a clearly coding error, relying on undefined behavior). I am
testing right now on mip-32, (on my
http://www.lemote.com/en/products/Notebook/2010/0310/112.html
that I bought some years ago), and it shows pretty much the same
failure as i586 on make:

---%<---
Message new "<0x2b1bb4e0>" did not understand selector
/home/loongson/smalltalk/kernel/CFuncs.st:128: Aborted
/home/loongson/smalltalk/kernel/CFuncs.st:128: Error occurred while
not in byte code interpreter!!
make[2]: *** [gst.im] Aborted
make[2]: Leaving directory `/home/loongson/smalltalk'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/loongson/smalltalk'
make: *** [all] Error 2
---%<---
(I am called loongson there BTW :-)
But, I added this hack to interp.c...
long __sync_val_compare_and_swap_4(long *addr, long old, long new) {
    if (*addr != old) {
    *addr = new;
    return 0;
    }
    return 1;
}
long __sync_bool_compare_and_swap_4(long *addr, long old, long new) {
    if (*addr != old) {
    *addr = new;
    return 0;
    }
    return 1;
}

I do not know what I had done earlier that I was getting a prompt and
being able to execute simple smalltalk commands in i586, but now
I get the exact same behavior on mips and i586, example:

i586: (this is an old mock chroot btw, started as
$ linux32 mock -r fedora-rawhide-i386 --shell)
---%<---
(gdb) r
[...]
Message new "<-0xc5b7b20>" did not understand selector
Program received signal SIGABRT, Aborted.
0xf7fd6cf0 in __kernel_vsyscall ()
Missing separate debuginfos, use: debuginfo-install
glibc-2.19.90-10.fc21.i686 gmp-6.0.0-2.fc21.i686
libffi-3.1-6.fc22.i686 libsigsegv-2.10-8.fc22.i686
libtool-ltdl-2.4.2-30.fc22.i686 ncurses-libs-5.9-13.20140323.fc21.i686
readline-6.2-8.fc21.i686 zlib-1.2.8-4.fc21.i686
(gdb) bt
#0  0xf7fd6cf0 in __kernel_vsyscall ()
#1  0xf7a53657 in raise () from /lib/libc.so.6
#2  0xf7a54f59 in abort () from /lib/libc.so.6
---%<---

mips:
---%<---
(gdb) r
[...]
Message new "<0x2b1bb4e0>" did not understand selector [New Thread
0x2aace790 (LWP 12195)]

Program received signal SIGABRT, Aborted.
[Switching to Thread 0x2aace790 (LWP 12195)]
0x2af18988 in raise () from /lib/libc.so.6
---%<---

The crash in both cases is in VMpr_Object_bootstrapException in the line
              oop1, MESSAGE_SELECTOR (oop2));
that from gdb, expanding macros show:
(gdb) p *(gst_message)((OOP)(oop2))->object
(gdb) p oop1
$4 = (OOP) 0xf3a484e0
$5 = {objSize = 0xb, objClass = 0xf39ca200, selector = 0x0, args = 0xf3a48538}

that is, it pass selector=0x0 to the %O format, but would fail
anyway, as the next lines have an abort() call.

> oh great. Is there any specific help you are looking for right now? I am
> just back from vacation and your work is great!

  If you can get to the point of debugging it, I suggest on i586, as it
should be the closest to functional setup, and from there check
what could be wrong, and that caused the VMpr_Object_bootstrapException
call, it would help a lot. The procedures are as described in
https://github.com/pcpa/smalltalk/commit/8c91bc1f0e447b0f3c9cfc5739f5bd2ba24d1371
just that I messed a bit the explanation, to checkout smalltalk, run:

$ cd
$ git clone git://github.com/pcpa/smalltalk.git
$ cd smalltalk
$ git checkout origin/scratch-lightning-branch

  Remaining is as described in that commit message.

> holger

Thanks,
Paulo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]