32bit GTK2 application


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users 32bit GTK2 application
# 1  
Old 03-05-2015
32bit GTK2 application

Hi all,

So, I have a 32 bit gtk2.22 application that I run flawlessly in Fedora 14.
When I compile it on the 32bit machine run it on Fedora 20 64bit machine I get:

(myprogram:6736): Gtk-WARNING **: Unable to locate theme engine in module_path: "adwaita",

(myprogram.:6736): Gtk-WARNING **: Unable to locate theme engine in module_path: "adwaita",
Gtk-Message: Failed to load module "pk-gtk-module"
Executing RunOnce*** Error in `myprogram': realloc(): invalid pointer: 0xf4300040 ***

======= Backtrace: =========
/lib/libc.so.6(+0x6e143)[0xf69ea143]
/lib/libc.so.6(+0x74984)[0xf69f0984]
/lib/libc.so.6(realloc+0x2f3)[0xf69f50d3]
/home/myprogram[0x8065b47]
/home/emperor/DAQNAV_V1/myprogram[0x805d33b]
/lib/libpthread.so.0(+0x6d4c)[0xf6b40d4c]
/lib/libc.so.6(clone+0x5e)[0xf6a7382e]
======= Memory map: ========
08048000-08081000 r-xp 00000000 fe:04 3407960 /home/emperor/DAQNAV_V1/myprogram-client-backup
08081000-08086000 rw-p 00038000 fe:04 3407960 /home/emperor/DAQNAV_V1/myprogram-client-backup
08086000-08181000 rw-p 00000000 00:00 0 [heap]
f4300000-f4321000 rw-p 00000000 00:00 0
f4321000-f4400000 ---p 00000000 00:00 0
f447e000-f447f000 ---p 00000000 00:00 0
f447f000-f4c7f000 rw-p 00000000 00:00 0
f5b52000-f5b62000 r-xp 00000000 fe:00 140405 /usr/lib/libcanberra.so.0.2.5
f5b62000-f5b63000 r--p 0000f000 fe:00 140405 /usr/lib/libcanberra.so.0.2.5
f5b63000-f5b64000 rw-p 00010000 fe:00 140405 /usr/lib/libcanberra.so.0.2.5
f5b64000-f5b68000 r-xp 00000000 fe:00 140432 /usr/lib/libcanberra-gtk.so.0.1.9
f5b68000-f5b69000 r--p 00003000 fe:00 140432 /usr/lib/libcanberra-gtk.so.0.1.9
f5b69000-f5b6a000 rw-p 00004000 fe:00 140432 /usr/lib/libcanberra-gtk.so.0.1.9

And the list goes on and on......

Installed on the Fedora 20 machine are the 64 bit gtk binaries for version 2.24. My program depends on the 32bit binaries of version 2.22.
My guess is that this is why my program seg faults.....
I havea ll of the rpm packages for the gtk 32bit binaries but I am lost on how to set all of this up to run....any help?

Thanks a lot!
# 2  
Old 03-05-2015
It couldn't even try to run if you didn't have the 32-bit ones available. Linux can tell the difference.

As for why it's crashing, perhaps your 32-bit machine had a very different version of GTK, or your program simply has a bug. Troubleshoot it and see.
# 3  
Old 03-05-2015
Well I know the gtk2.22 32bit versions are not installed because I can't install the rpm package that contains them.
# 4  
Old 03-05-2015
It couldn't even try to run if you didn't have 32-bit ones available. Could not. Not even long enough to just crash. It's a logical contradiction. All you'd get is "no such file or directory." It runs, therefore, you have them.

So, they're there. How did they get there? On a 64-bit system, some common 32-bit libraries are often bundled up in one "emulation" package rather than installing 32 and 64 bit versions of the same thing. This is to avoid confusing the package manager. I don't know precisely what they call that package (or packages) in Fedora.
# 5  
Old 03-05-2015
Well I guess if the drawing calls are to an older version of gtk(2.22) maybe this is causing problems....I would really like to be able to just run the program with the old libraries....didn't think it was that hard to setup.
# 6  
Old 03-05-2015
You often do need to worry about versions, sadly. This is why different distributions often have their own packages. You may be able to be more specific about what version it uses, i.e. -lgtk-version instead of -lgtk, so that it gives 'file not found' instead of crashing when supplied with an incompatible version. Libraries are usually available under many names from the most generic to the most specific, allowing programs to be as picky or generic as will work:

Code:
lrwxrwxrwx 1 root root      11 Aug 26  2014 libpam.so -> libpam.so.0
lrwxrwxrwx 1 root root      16 Aug 26  2014 libpam.so.0 -> libpam.so.0.83.1
-rwxr-xr-x 1 root root   55760 Aug 26  2014 libpam.so.0.83.1

so linking to generic 'pam' means 'I expect this program to work with any PAM from any era', linking to pam-0 means 'I expect this to work with any version 0.*', and linking to pam-0.83.1 means 'this program will work with only this exact version of pam'

If you could find out what version of GTK you have in your emulation packages that might help solve the mystery. Try ldd ./myprogram to see what libraries it has ended up using.

Lastly, I'd note that you haven't actually ruled out a bug in your program yet. More may have changed than you realized in moving from one machine to another of any bit width. Recompile with debugging info, and check through your program step by step as it runs on the 64-bit machine (i.e. using gdb).

Last edited by Corona688; 03-05-2015 at 12:01 PM..
# 7  
Old 03-05-2015
Shots in the dark

Hi.
Quote:
Originally Posted by fedora18
So, I have a 32 bit gtk2.22 application that I run flawlessly in Fedora 14.
When I compile it on the 32bit machine run it on Fedora 20 64bit machine I get:
This sounds like you are doing cross-compiling: making the executable on F14, then transferring the binary to F20.

If so, then the comments from Corona688 are applicable. There is, what, 6 years difference between F14 and F20? Lots of time for stuff to change.

If I were in this position, I would do the following:

1) Try making a static binary of the executable on F14. That would effectively take the libraries with you. However, if it does dynamic loading, it wil probably still fail.

2) Compile it in 64-bit bit mode on F20.

Like I said, shots in the dark.

Best wishes ... cheers, drl
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Support for Unicode in GTK2 and GTK3 file selection box?

I'm on Tiny Core Linux Pure64 10.1. My locale is en_US.UTF-8 and I generally have no trouble with Unicode characters with one exception: When I try to use Unicode characters in GTK applications' file selection box, I get "Invalid file name": http://files.dantas.airpost.net/public/save_file.jpg ... (11 Replies)
Discussion started by: DevuanFan
11 Replies

2. Fedora

GTK2.22 for Fedora 20

Hi again, I maybe should have posted this question in this forum. I am looking for an RPM for gtk2.22 development for a machine running Fedora 20. I only have the gtk2.22 development binaries for Fedora 14. Anyone know where I could find them? Thanks! (8 Replies)
Discussion started by: fedora18
8 Replies

3. Shell Programming and Scripting

Gtk2-Perl

Hai how to activate (script2)page of a note book in Gtk2-Perl when one script1 is run successfully... Thanks kiran (1 Reply)
Discussion started by: kiran425
1 Replies

4. Shell Programming and Scripting

Gtk2-Perl

Hai how to activate (script2)page of a note book in Gtk2-Perl when one script1 is run successfully... Thanks kiran (0 Replies)
Discussion started by: kiran425
0 Replies

5. Shell Programming and Scripting

Perl::Gtk2 on Linux --- How to Find the Default Font Being Used?

Hello All, Wasn't sure if this was the correct thread to post this under but figured it has to do with Perl and Gtk2 so why not... Anyway.. How can I find out what the Default font being used is inside a Gtk2::Widget. In this case I'm trying to figure out the font being used inside a... (1 Reply)
Discussion started by: mrm5102
1 Replies

6. Shell Programming and Scripting

[Perl + Gtk2] Image disappears after scrolling / minimizing window

Hello everyone I don't know if it's the right place to ask, but I will try. I want to use Gtk2 in my Perl chart-drawing script, I found a sample code that could be very useful for me somewhere, but I noticed there is one problem with that - when I draw something, and then scroll the window or... (0 Replies)
Discussion started by: xqwzts
0 Replies

7. Programming

perl/Gtk2: issue with initializing Gtk2

hi everybody, currently i'm playing with perl and Gtk2. i've found a fairly old but nice looking example of a client/server application which is written in perl and Gtk2. the server part works perfect but i can't start the client part and keep getting following error message: $ ./client-gui.pl... (1 Reply)
Discussion started by: pseudocoder
1 Replies

8. UNIX Desktop Questions & Answers

gtk2-perl load error help

I write this code. It show the first dialog correctly. but, no matter i modify the code(load module by use or require, or something i think maybe error) it can't pop-up anymore. and show this warning. Thanks. (I'm sorry for my English.) Tue Mar 16 17:24:36 2010 ... (0 Replies)
Discussion started by: snyh
0 Replies

9. Linux

Need gtk2 for linux es3

I need to have the ability to read acrobat files on my Red hat linux boxes (enterprise level 3) . however acroread will not install saying i do not have gtk2 (gimp toolkit). Does anyone know where i can either get gtk2 for this linux or where i can get an acrobat reader for this flavour of linux. (1 Reply)
Discussion started by: frankkahle
1 Replies
Login or Register to Ask a Question