1. 3.2 and dll loading?

On Linux, with SVN version of Euphoria, IupEu does not work. I get a machine
level exception on:

constant
    hIupOpen = define_c_func(hIup, "IupOpen", {I, P}, I),
    hIupClose = define_c_proc(hIup, "IupClose", {}),
    hIupVersion = define_c_func(hIup, "IupVersion", {}, P),

global function IupOpen()
    return c_func(hIupOpen, {0, NULL})
end function

IupOpen()


If I run from the released  3.1.1, then the 140 some wrapped functions work
fine. But in 3.2, the very first one fails.

Any thoughts?

hIup = 135334784
hIupOpen = 0
hIupClose = 1
hIupVersion = 2

Thanks!

--
Jeremy Cowgar
http://jeremy.cowgar.com

new topic     » topic index » view message » categorize

2. Re: 3.2 and dll loading?

I get errors when using 3.2 and eusqlite3.ew as well. I get a machine level
exception during sqlite_open() the first method I call that uses any method
loaded from a dll.

Is anyone else experiencing problems with 3.2 (4.0) and using libraries that
define C functions?

--
Jeremy Cowgar
http://jeremy.cowgar.com

new topic     » goto parent     » topic index » view message » categorize

3. Re: 3.2 and dll loading?

Jeremy Cowgar wrote:
> 
> I get errors when using 3.2 and eusqlite3.ew as well. I get a machine level
> exception during sqlite_open() the first method I call that uses any method
> loaded from a dll.
> 
> Is anyone else experiencing problems with 3.2 (4.0) and using libraries that
> define C functions?

I haven't rebuilt in a bit, but I've been using it with wxEuphoria pretty
extensively.

Matt

new topic     » goto parent     » topic index » view message » categorize

4. Re: 3.2 and dll loading?

Jeremy Cowgar wrote:
> 
> I get errors when using 3.2 and eusqlite3.ew as well. I get a machine level
> exception during sqlite_open() the first method I call that uses any method
> loaded from a dll.
> 
> Is anyone else experiencing problems with 3.2 (4.0) and using libraries that
> define C functions?
> 
> --
> Jeremy Cowgar
> <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a>

Hi

What tests have you done to try to trace the problem.

Is it any .so, or just the two so far mentioned (sqlite3 and iup)?

Are you using pre built eu 3.2 and 3.1, or have you built them yourself?

Which version of gcc (if building), and glibc are you running.

If all things are equal, then its a problem with 3.2, and the changes between
3.1.1 and 3,2 need to be traced.

Chris

new topic     » goto parent     » topic index » view message » categorize

5. Re: 3.2 and dll loading?

ChrisBurch3 wrote:
> 
> What tests have you done to try to trace the problem.

Asked here and also built a debug version of exu and ran thru gdb.

(gdb) bt
#0  0xb7f8bc61 in _dl_debug_state () from /lib/ld-linux.so.2
#1  0xb7f8f1a2 in dl_open_worker () from /lib/ld-linux.so.2
#2  0xb7f8afa6 in _dl_catch_error () from /lib/ld-linux.so.2
#3  0xb7f8eadc in _dl_open () from /lib/ld-linux.so.2
#4  0xb7f3dc2f in dlopen_doit () from /lib/libdl.so.2
#5  0xb7f8afa6 in _dl_catch_error () from /lib/ld-linux.so.2
#6  0xb7f3e0fc in _dlerror_run () from /lib/libdl.so.2
#7  0xb7f3db61 in dlopen@@GLIBC_2.1 () from /lib/libdl.so.2
#8  0x0809728b in OpenDll (x=-1208745996) at be_machine.c:4145
#9  0x08098929 in machine (opcode=50, x=-2130575722) at be_machine.c:4820
#10 0x0809171f in do_exec (start_pc=0x0) at be_execute.c:4183
#11 0x080949c1 in Execute (start_index=0x81126d4) at be_execute.c:1585
#12 0x08096b98 in start_backend (x=-2130546099) at be_machine.c:4558
#13 0x0809843a in machine (opcode=65, x=-2130546099) at be_machine.c:4900
#14 0x0808a15f in _23BackEnd (_il_file=0) at ./intobj/backend.c:2228
#15 0x08056462 in _2BackEnd (_x=0) at ./intobj/mode.c:127
#16 0x0806e664 in _24main () at ./intobj/main.c:845
#17 0x0804eb0b in main0 () at ./intobj/main-0.c:1197
#18 0x0804cafa in main (argc=1, argv=0xb7f99658) at ./intobj/main-.c:1966

> Is it any .so, or just the two so far mentioned (sqlite3 and iup)?

It has been any .so I've tried. I've tried Iup, pcre and now SQLite. All of them
work if I use 3.1. None of them work if I use 3.2.

> Are you using pre built eu 3.2 and 3.1, or have you built them yourself?

Pre-built 3.1, I built my own 3.2, however, it does compile w/o issue and w/no
warning.
 
> Which version of gcc (if building), and glibc are you running.

$ gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --prefix=/usr --enable-shared
--enable-languages=c,c++,fortran,objc,obj-c++,treelang --enable-threads=posix
--mandir=/usr/share/man --enable-__cxa_atexit --disable-multilib
--libdir=/usr/lib --libexecdir=/usr/lib --enable-clocale=gnu
--disable-libstdcxx-pch --with-tune=generic
Thread model: posix
gcc version 4.3.0 (GCC) 

glibc = 2.7

$ uname -a
Linux jdesk 2.6.24-ARCH #1 SMP PREEMPT Wed Mar 5 12:07:52 UTC 2008 i686 Intel(R)
Core(TM)2 Quad CPU Q6600 @ 2.40GHz GenuineIntel GNU/Linux

> If all things are equal, then its a problem with 3.2, and the changes between
> 3.1.1 and 3,2 need to be traced.

I'm not sure if all things are equal, but what I do know is that a simple make
in source of SVN is not working for me. I don't think that should be the case. I
do not have problems building any other software (and I do build my fair share of
software).

--
Jeremy Cowgar
http://jeremy.cowgar.com

new topic     » goto parent     » topic index » view message » categorize

6. Re: 3.2 and dll loading?

Matt Lewis wrote:
> 
> Jeremy Cowgar wrote:
> > 
> > I get errors when using 3.2 and eusqlite3.ew as well. I get a machine level
> > exception during sqlite_open() the first method I call that uses any method
> > loaded from a dll.
> > 
> > Is anyone else experiencing problems with 3.2 (4.0) and using libraries that
> > define C functions?
> 
> I haven't rebuilt in a bit, but I've been using it with wxEuphoria pretty
> extensively.
> 


How can anyone test 3.2 when it is not available on

the Euphoria Download page ?

Release a stable beta or alpha if you consider it worth testing.



Bernie

My files in archive:
WMOTOR, XMOTOR, W32ENGIN, MIXEDLIB, EU_ENGIN, WIN32ERU, WIN32API 

Can be downloaded here:
http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan

new topic     » goto parent     » topic index » view message » categorize

7. Re: 3.2 and dll loading?

Bernie Ryan wrote:
> 
> How can anyone test 3.2 when it is not available on
> the Euphoria Download page ?
> Release a stable beta or alpha if you consider it worth testing.
> 

Many people use it currently for testing. It's easy to get via SVN. There are
instructions on the SF page on how to use SVN. It is not ready for general
testing, but for other developers who work on the language or for the
adventurous, it can be retrieved every step of the way via SVN. There are many
here that do that, and those people were the intended audience.

Basically, to get Euphoria from SVN you can:

C:\> svn co http://rapideuphoria.svn.sourceforge.net/svnroot/rapideuphoria/trunk
euphoria-40

That will check the code, build files, doc sources, new library, ... everything
so you can play with it if you would like.

--
Jeremy Cowgar
http://jeremy.cowgar.com

new topic     » goto parent     » topic index » view message » categorize

8. Re: 3.2 and dll loading?

Jeremy Cowgar wrote:
> 
> ChrisBurch3 wrote:
> > 
> > Which version of gcc (if building), and glibc are you running.
> 
> $ gcc -v
> Using built-in specs.
> Target: i686-pc-linux-gnu
> Configured with: ../configure --prefix=/usr --enable-shared
> --enable-languages=c,c++,fortran,objc,obj-c++,treelang
> --enable-threads=posix --mandir=/usr/share/man --enable-__cxa_atexit
> --disable-multilib
> --libdir=/usr/lib --libexecdir=/usr/lib --enable-clocale=gnu
> --disable-libstdcxx-pch
> --with-tune=generic
> Thread model: posix
> gcc version 4.3.0 (GCC) 

I think this may be the problem.  I don't think that we've got the offsets
for 4.3, which must have changed.  Take a look at be_callc.c.  I updated
for the latest gcc I was using.  Looks like you'll need to do some more
ifdef'ing.

Matt

new topic     » goto parent     » topic index » view message » categorize

9. Re: 3.2 and dll loading?

Matt Lewis wrote:
> 
> I think this may be the problem.  I don't think that we've got the offsets
> for 4.3, which must have changed.  Take a look at be_callc.c.  I updated
> for the latest gcc I was using.  Looks like you'll need to do some more
> ifdef'ing.

Matt, I have not messed with the offsets in GCC, nor do I really even know what
I'm looking for. How can I find the offsets required for 4.3? I don't mind
changing, testing, etc... but I'm not sure where to even look for what they
should be. I see the file you mentioned and it seems easy enough to update, once
I figure out what I should update to.

--
Jeremy Cowgar
http://jeremy.cowgar.com

new topic     » goto parent     » topic index » view message » categorize

10. Re: 3.2 and dll loading?

Hi

Try rebuilding one of the libraries on your own machine, with an exu you built
yourself, then try running it, pound to a penny it'll work.

Chris

new topic     » goto parent     » topic index » view message » categorize

11. Re: 3.2 and dll loading?

ChrisBurch3 wrote:
> 
> Hi
> 
> Try rebuilding one of the libraries on your own machine, with an exu you built
> yourself, then try running it, pound to a penny it'll work.
> 

Sorry, it didn't work. I removed sqlite from my computer. I then did:

find / -name *sqlite*so

and it found nothing. I ran my app, and it said could not find sqlite. I then
downloaded sqlite, ran configure --prefix=/usr && make && sudo make install.

Re-ran my app, got same problem. machine exception. gdb reports the same back
trace as posted previously.

--
Jeremy Cowgar
http://jeremy.cowgar.com

new topic     » goto parent     » topic index » view message » categorize

12. Re: 3.2 and dll loading?

Owe you a pound then.

Chris

new topic     » goto parent     » topic index » view message » categorize

13. Re: 3.2 and dll loading?

Jeremy Cowgar wrote:
> 
> Matt Lewis wrote:
> > 
> > I think this may be the problem.  I don't think that we've got the offsets
> > for 4.3, which must have changed.  Take a look at be_callc.c.  I updated
> > for the latest gcc I was using.  Looks like you'll need to do some more
> > ifdef'ing.
> 
> Matt, I have not messed with the offsets in GCC, nor do I really even know
> what
> I'm looking for. How can I find the offsets required for 4.3? I don't mind
> changing,
> testing, etc... but I'm not sure where to even look for what they should be.
> I see the file you mentioned and it seems easy enough to update, once I figure
> out what I should update to.

Basically, you need to take a look at the asm output.  It's automatiacally
made (be_callc.s) during the build.  If you look in the c code, you'll see
this line:

  arg = arg+argsize+9999; // just a marker for asm code

This is there basically to help you find the critical spot, and to figure 
out what the correct values should be.  At the top of the file, you'll see
these values for gcc 4.1.2:

#define push() asm("pushl -124(%ebp)")
#define  pop() asm( "addl -128(%ebp), %esp")

You're looking for something similar.  The gcc devs like to change this
stuff a lot (Watcom has been more stable).  There's some information in
readme.txt in the source directory.  If you're still having trouble, email
me the file, and I'll take a look at it.

Matt

new topic     » goto parent     » topic index » view message » categorize

14. Re: 3.2 and dll loading?

Matt Lewis wrote:
> 
> Basically, you need to take a look at the asm output.  It's automatiacally
> made (be_callc.s) during the build.  If you look in the c code, you'll see
> this line:
> 
>   arg = arg+argsize+9999; // just a marker for asm code
> 
> This is there basically to help you find the critical spot, and to figure 
> out what the correct values should be.  At the top of the file, you'll see
> these values for gcc 4.1.2:
> 
> #define push() asm("pushl -124(%ebp)")
> #define  pop() asm( "addl -128(%ebp), %esp")
> 
> You're looking for something similar.  The gcc devs like to change this
> stuff a lot (Watcom has been more stable).  There's some information in
> readme.txt in the source directory.  If you're still having trouble, email
> me the file, and I'll take a look at it.
> 

-20 and -24 made everything work! I'll figure out the proper if/else/endif
changes and commit the code.

--
Jeremy Cowgar
http://jeremy.cowgar.com

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu