flat assembler
Message board for the users of flat assembler.

Index > Linux > [SOLVED] strange gtk2 (treeview) problem

Author
Thread Post new topic Reply to topic
eilenbeb



Joined: 17 Feb 2010
Posts: 21
eilenbeb 09 Jun 2012, 21:14
I can create and use treeview widgets from within my 'main' function. However, gtk2's treeview functions segfault if called from anywhere but main.

My local functions are just labels. I rarely have need for anything more formal than that.

Anybody have any idea why gtk2's treeview widget would crash like that? Makes no sense to me at all.

I haven't (yet) found any other window, container, widget or controll that has this problem.

Archlinux 64-bit
glib2 2.32.3
gtk2 2.24.10
gtk2+extra 2.1.2 (the pre-made treeviews have the same problem)
glibc 2.15


Last edited by eilenbeb on 09 Jun 2012, 23:40; edited 1 time in total
Post 09 Jun 2012, 21:14
View user's profile Send private message Reply with quote
ProphetOfDoom



Joined: 08 Aug 2008
Posts: 120
Location: UK
ProphetOfDoom 09 Jun 2012, 22:45
Hmm, when 64-bit Linux has crashed for me in the past, it's generally due to a misaligned stack. It's possible that somewhere deep within the treeview functions, some floating point instructions are used which expect the stack pointer to be a multiple of 16 bytes. If your functions are just labels, then they will start with a misaligned stack (due to the 8-byte return address). This would also explain why the gtk+ functions work in "main" but not elsewhere. You probably aligned the stack correctly at the beginning of "main" by pushing RBP. It's just a possibility though, obviously I may be completely wrong.
Post 09 Jun 2012, 22:45
View user's profile Send private message Reply with quote
eilenbeb



Joined: 17 Feb 2010
Posts: 21
eilenbeb 09 Jun 2012, 23:40
Good call, I hadn't thought of that.
Stack alignment was definitely the problem, thanks for the heads-up.
Post 09 Jun 2012, 23:40
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.