Re: [Gambas-user] Bug with JIT and external functions

2012-07-08 Thread Jussi Lahtinen
OK. I use gmail and so I didn't see the problem. My thought was to keep these JIT bugs in same thread, but you are right. Jussi On 6 July 2012 18:44, Benoît Minisini wrote: > Le 06/07/2012 17:35, Jussi Lahtinen a écrit : > > Just quick info before I leave for couple days... > > ... > > Can

Re: [Gambas-user] Bug with JIT and external functions

2012-07-06 Thread Benoît Minisini
Le 06/07/2012 17:35, Jussi Lahtinen a écrit : > Just quick info before I leave for couple days... > ... Can you start a new thread for new bugs ? It becomes hard to read the current one now, it is too deep! Regards, -- Benoît Minisini ---

Re: [Gambas-user] Bug with JIT and external functions

2012-06-29 Thread Jussi Lahtinen
Next bug... it's crash and I don't have any clue what causes it. I'm trying to isolate it, but meanwhile here is bt from gdb: Program received signal SIGSEGV, Segmentation fault. 0x7fffe3b0e430 in llvm::BasicBlock::getContext() const () from /usr/lib/libLLVM-3.2svn.so (gdb) bt #0 0x7ff

Re: [Gambas-user] Bug with JIT and external functions

2012-06-27 Thread Jussi Lahtinen
Yes, it works now! Jussi On 27 June 2012 00:12, Emil Lenngren wrote: > It seems like when LLVM reads boolean pointers, it assumes the seven most > significant bits are always 0, which is not the case in Gambas. Does the > latest revision work? I have no opportunity to even compile it and see

Re: [Gambas-user] Bug with JIT and external functions

2012-06-26 Thread Emil Lenngren
It seems like when LLVM reads boolean pointers, it assumes the seven most significant bits are always 0, which is not the case in Gambas. Does the latest revision work? I have no opportunity to even compile it and see if it works at the moment :) /Emil 2012/6/26 Jussi Lahtinen > .../MagicBug$ G

Re: [Gambas-user] Bug with JIT and external functions

2012-06-26 Thread Jussi Lahtinen
.../MagicBug$ GB_JIT=info gbx3 gb.jit: using LLVM 3.2. gb.jit: beginning compiling MainModule.MainModule: -

Re: [Gambas-user] Bug with JIT and external functions

2012-06-26 Thread Emil Lenngren
I am in Italy now on holiday so I cannot debug the code, but could you please run gbx3 with GB_JIT=info and post the llvm code? /Emil 2012/6/26 Jussi Lahtinen > OK, here is more. This is really really weird. > > I expect message "Everything works!", but I get *only* "Something broke!!". > But i

Re: [Gambas-user] Bug with JIT and external functions

2012-06-26 Thread Jussi Lahtinen
OK, here is more. This is really really weird. I expect message "Everything works!", but I get *only* "Something broke!!". But if I add 'Return', under Message("Everything works!"), or I remove 'Fast' then everything works as expected. See attachment. Gambas 3 rev 4860 @ Xubuntu 12.04 64bit Jus

Re: [Gambas-user] Bug with JIT and external functions

2012-06-24 Thread Benoît Minisini
Le 19/06/2012 20:58, Emil Lenngren a écrit : > Hi. Kiitos for another bug report :) > > Hmm.. I forgot that classes can override extern methods as well. That's > where the real problem is. > > /Emil > Mmm. Seems weird at first sight, but finally it could be useful. -- Benoît Minisini

Re: [Gambas-user] Bug with JIT and external functions

2012-06-20 Thread Emil Lenngren
That bug was actually an interpreter bug, but it is now corrected in the latest revision :) /Emil 2012/6/20 Jussi Lahtinen > Yeah, I'm also leaving to countryside for Midsummer parties... but I made > quick test, > and I found another bug (see attachment). > > Similar problem with argument coun

Re: [Gambas-user] Bug with JIT and external functions

2012-06-20 Thread Jussi Lahtinen
Yeah, I'm also leaving to countryside for Midsummer parties... but I made quick test, and I found another bug (see attachment). Similar problem with argument counting. Jussi On 20 June 2012 19:14, Emil Lenngren wrote: > Tomorrow I will travel away for a week so I cannot do anything then, b

Re: [Gambas-user] Bug with JIT and external functions

2012-06-20 Thread Emil Lenngren
Tomorrow I will travel away for a week so I cannot do anything then, but just keep sending emails and I will reply when I come home :) /Emil 2012/6/20 Jussi Lahtinen > So far everything seems to work! > I'll continue further testing later. > > Jussi > > > > On 20 June 2012 01:10, Emil Lenngren

Re: [Gambas-user] Bug with JIT and external functions

2012-06-20 Thread Jussi Lahtinen
So far everything seems to work! I'll continue further testing later. Jussi On 20 June 2012 01:10, Emil Lenngren wrote: > Is revision #4851 useful for you? > You can now convert functions in the current running class to pointers. > > /Emil > > 2012/6/19 Emil Lenngren > > > It should work in

Re: [Gambas-user] Bug with JIT and external functions

2012-06-19 Thread Emil Lenngren
Is revision #4851 useful for you? You can now convert functions in the current running class to pointers. /Emil 2012/6/19 Emil Lenngren > It should work in the latest revision :) > > > 2012/6/19 Emil Lenngren > >> If you want a quick workaround, you can have non-fast method that creates >> a c

Re: [Gambas-user] Bug with JIT and external functions

2012-06-19 Thread Emil Lenngren
It should work in the latest revision :) 2012/6/19 Emil Lenngren > If you want a quick workaround, you can have non-fast method that creates > a callback, and immediately returns it, like: > > Private Function GenerateCallback() As Pointer > Return CallbackFunction > End > > Fast Private Funct

Re: [Gambas-user] Bug with JIT and external functions

2012-06-19 Thread Emil Lenngren
If you want a quick workaround, you can have non-fast method that creates a callback, and immediately returns it, like: Private Function GenerateCallback() As Pointer Return CallbackFunction End Fast Private Function CallbackFunction() ... End Extern extfunc(cb As Pointer) In "somelib" Fast P

Re: [Gambas-user] Bug with JIT and external functions

2012-06-19 Thread Jussi Lahtinen
No problem, I'm glad to help making Gambas more robust, when ever I have time to do so! And testing things seems to be easy contribution for me... My project has about 120 000 lines of code. And I try JIT with every module and class of it. So I think I will find more bugs... But in some point I mu

Re: [Gambas-user] Bug with JIT and external functions

2012-06-19 Thread Emil Lenngren
Hi. Kiitos for another bug report :) Hmm.. I forgot that classes can override extern methods as well. That's where the real problem is. /Emil 2012/6/19 Jussi Lahtinen > More bugs... > > Make shared library (just dummy example [or just use binary that is > included with project source]); > > #i

Re: [Gambas-user] Bug with JIT and external functions

2012-06-19 Thread Jussi Lahtinen
More bugs... Make shared library (just dummy example [or just use binary that is included with project source]); #include int yEta(int x1, int y1, int x2, int y2) {return (int) hypot(x1-x2,y1-y2);} Then run the attached project. With JIT, number of arguments is counted wrong. Jussi

Re: [Gambas-user] Bug with JIT and external functions

2012-06-19 Thread Jussi Lahtinen
Yes, it works now! Jussi On 18 June 2012 22:34, Emil Lenngren wrote: > Does it work in revision #4847? > > /Emil > > 2012/6/18 Jussi Lahtinen > > > Starting program: /usr/local/bin/gbx3 > > [Thread debugging using libthread_db enabled] > > Using host libthread_db library > "/lib/x86_64-linux

Re: [Gambas-user] Bug with JIT and external functions

2012-06-18 Thread Emil Lenngren
Does it work in revision #4847? /Emil 2012/6/18 Jussi Lahtinen > Starting program: /usr/local/bin/gbx3 > [Thread debugging using libthread_db enabled] > Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". > gbx3: ExecutionEngine.cpp:165: void > llvm::ExecutionEngine::addG

Re: [Gambas-user] Bug with JIT and external functions

2012-06-18 Thread Jussi Lahtinen
Starting program: /usr/local/bin/gbx3 [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". gbx3: ExecutionEngine.cpp:165: void llvm::ExecutionEngine::addGlobalMapping(const llvm::GlobalValue*, void*): Assertion `(CurVal == 0 || Add

Re: [Gambas-user] Bug with JIT and external functions

2012-06-18 Thread Emil Lenngren
Hi. Can you please provide more information? A gdb backtrace or something, because I get no errors at all. Everything seems to work for me ... /Emil 2012/6/18 Jussi Lahtinen > OK, I found it. See attachment. > > Jussi > > > > > On 17 June 2012 23:36, Jussi Lahtinen wrote: > > > OK, that is fix

Re: [Gambas-user] Bug with JIT and external functions

2012-06-18 Thread Jussi Lahtinen
OK, I found it. See attachment. Jussi On 17 June 2012 23:36, Jussi Lahtinen wrote: > OK, that is fixed, and I cannot see any problems with compare method > anymore. > > But with my big project, I got this with signal 6; > gbx3: ExecutionEngine.cpp:165: void > llvm::ExecutionEngine::addGlobal

Re: [Gambas-user] Bug with JIT and external functions

2012-06-17 Thread Jussi Lahtinen
OK, that is fixed, and I cannot see any problems with compare method anymore. But with my big project, I got this with signal 6; gbx3: ExecutionEngine.cpp:165: void llvm::ExecutionEngine::addGlobalMapping(const llvm::GlobalValue*, void*): Assertion `(CurVal == 0 || Addr == 0) && "GlobalMapping alr

Re: [Gambas-user] Bug with JIT and external functions

2012-06-17 Thread Emil Lenngren
It should be fixed in revision #4843! /Emil 2012/6/17 Jussi Lahtinen > Yes, it really works now. And I found a lot of errors by me. > > But for some reason JIT raises compare method when it shouldn't, > and when I tried to isolate the problem I got crash (signal 11). > This seems not to be rel

Re: [Gambas-user] Bug with JIT and external functions

2012-06-17 Thread Jussi Lahtinen
Yes, it really works now. And I found a lot of errors by me. But for some reason JIT raises compare method when it shouldn't, and when I tried to isolate the problem I got crash (signal 11). This seems not to be related to compare method, so just ignore name of the attached project. I will look i

Re: [Gambas-user] Bug with JIT and external functions

2012-06-17 Thread Emil Lenngren
Yes, it works now :) 2012/6/17 Benoît Minisini > Le 17/06/2012 02:54, Jussi Lahtinen a écrit : > > Yeah, terminal gives other position... > > With my actual project, I got error message; wanted string, got > > blaablaaClass instead. > > And that error message comes from function (from other modu

Re: [Gambas-user] Bug with JIT and external functions

2012-06-17 Thread Benoît Minisini
Le 17/06/2012 02:54, Jussi Lahtinen a écrit : > Yeah, terminal gives other position... > With my actual project, I got error message; wanted string, got > blaablaaClass instead. > And that error message comes from function (from other module without Fast) > which takes two objects are parameters. >

Re: [Gambas-user] Bug with JIT and external functions

2012-06-16 Thread Jussi Lahtinen
Yeah, terminal gives other position... With my actual project, I got error message; wanted string, got blaablaaClass instead. And that error message comes from function (from other module without Fast) which takes two objects are parameters. So either terminal isn't showing the real stack, or ther

Re: [Gambas-user] Bug with JIT and external functions

2012-06-16 Thread Emil Lenngren
The IDE is strange... If I run gbx3 from the terminal, a correct stack backtrace is shown. The IDE seems to miss a stack frame. I don't know why... /Emil 2012/6/17 Jussi Lahtinen > Aaa... OK, sorry for the trouble. > I assumed it is because of extern, > because with my actual project I had simi

Re: [Gambas-user] Bug with JIT and external functions

2012-06-16 Thread Jussi Lahtinen
Aaa... OK, sorry for the trouble. I assumed it is because of extern, because with my actual project I had similar error messages from modules where extern is used. Also the error message is pretty misleading as it points to the line I copy&pasted. I will investigate more... Jussi On 17 June 2

Re: [Gambas-user] Bug with JIT and external functions

2012-06-16 Thread Emil Lenngren
That has nothing to do with extern ;) The code you are trying to execute is "Try oo = [TestClass1]". As that code is always illegal, the jit throws an error directly at compile time, before running the code. That should help people debugging code because if there is an error in an uncommon code pa

Re: [Gambas-user] Bug with JIT and external functions

2012-06-16 Thread Jussi Lahtinen
>From this (integer to integer): Dim iResult As Integer = mTest.DoTests() Type mismatch: wanted Standard type, got Class instead in FMain:9. Jussi On 17 June 2012 02:47, Emil Lenngren wrote: > Hi. What error do you get? The "extern" part seems to work fine for me... > > /Emil > > 2012/6/16

Re: [Gambas-user] Bug with JIT and external functions

2012-06-16 Thread Emil Lenngren
Hi. What error do you get? The "extern" part seems to work fine for me... /Emil 2012/6/16 Jussi Lahtinen > See attachment. > If you comment out "Fast" from mTest, all works perfectly. > > Gambas 3 rev 4837 @ Xubuntu 12.04 64bit > > Jussi > > > ---

[Gambas-user] Bug with JIT and external functions

2012-06-16 Thread Jussi Lahtinen
See attachment. If you comment out "Fast" from mTest, all works perfectly. Gambas 3 rev 4837 @ Xubuntu 12.04 64bit Jussi GambasTester-0.9.28.tar.gz Description: GNU Zip compressed data -- Live Security Virtual Conferenc