FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

segfault - solution paradox

 
Post new topic   Reply to topic     Forum Index -> gtkD
View previous topic :: View next topic  
Author Message
Ant



Joined: 06 Mar 2004
Posts: 306
Location: Canada

PostPosted: Mon Feb 27, 2006 9:24 pm    Post subject: segfault - solution paradox Reply with quote

So, I was very happy to be able to continue to work on Duit.
and I did, but...
I forgot to change the wrapper to move the import to the module level!
rebuilt all Duit classes and...
Did I get the same problem again? did I?
No!

Shocked Confused Shocked Confused Shocked Confused

Ant
Back to top
View user's profile Send private message
larsivi
Site Admin


Joined: 27 Mar 2004
Posts: 453
Location: Trondheim, Norway

PostPosted: Tue Feb 28, 2006 12:55 am    Post subject: Reply with quote

Hmm, I haven't made a comment on your discoveries, yet, but, I think the problems we looked into the other day (and the results you get now), IS a bug in DMD.

As long as class internal imports are allowed, and gives inconsistent results for some different versions of the rest of the code, the feature must be considered dangerous. Also, the exact errors we saw (calling the wrong methods) certainly don't have to do with symbol conflicts or similar, it wasn't as if the wrong drawRectangle method were called, but entirely other addresses in the executable (someone unnamed as far as I could see). As for why it matched those two parameters, I guess it has to do with the calling convention and how arguments are passed (the other way round).
Back to top
View user's profile Send private message
Ant



Joined: 06 Mar 2004
Posts: 306
Location: Canada

PostPosted: Tue Feb 28, 2006 7:54 am    Post subject: Reply with quote

larsivi wrote:
Hmm, I haven't made a comment on your discoveries, yet, but, I think the problems we looked into the other day (and the results you get now), IS a bug in DMD.

As long as class internal imports are allowed, and gives inconsistent results for some different versions of the rest of the code, the feature must be considered dangerous. Also, the exact errors we saw (calling the wrong methods) certainly don't have to do with symbol conflicts or similar, it wasn't as if the wrong drawRectangle method were called, but entirely other addresses in the executable (someone unnamed as far as I could see). As for why it matched those two parameters, I guess it has to do with the calling convention and how arguments are passed (the other way round).

Agree.

What can we do to help Walter and D?
I don't think telling Walter to download the the DuitBUG tar ball and follow the instructions on the README* is going to cut it.
But I think that's what I'm going to do...
I don't know better.

Ant
Back to top
View user's profile Send private message
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Tue Feb 28, 2006 11:08 am    Post subject: Reply with quote

I don't understand what you are saying, Ant.

Are you saying that the DUIT demo now works whether or not the imports are moved out of the class?

So the import wasn't the issue after all? It's not clear what you mean, but Lars seems to understand you?

What bug are you referring to in DMD?

-JJR
Back to top
View user's profile Send private message
larsivi
Site Admin


Joined: 27 Mar 2004
Posts: 453
Location: Trondheim, Norway

PostPosted: Tue Feb 28, 2006 2:31 pm    Post subject: Reply with quote

I'm not sure I understood what happens now, after Ant did some stuff, I only said that what we observed the other day definately is a bug, whether it is in the within the class import code, or elsewhere. The address of the functions called (as inspected by printing the address using writef), equalled the address of some other function in the executable (these addresses was found by inspecting the executable using an early version of ELF-empowered ddlinfo). For example i printed drawRectangle's address using writef, then I searched the exe for that address, and got the symbol for Window.move (the one that was actually called).

This means that symbol conflicts or whatever would be a very bad excuse, as the function within the program get another address than originally assigned to it during linking. Getting it correct is "just" a matter of looking up the correct symbol, but I don't know where this happens. It might be a linux related problem, maybe a bug there, maybe related to the recently added -fPic code. Who knows. As it happens with a coding style few other even has tried the last year, I personally don't think it is an important bug, but a bug nonetheless. If nothing else, Walter should disallow such usage.
Back to top
View user's profile Send private message
h3r3tic



Joined: 30 Mar 2004
Posts: 261
Location: Torun, Poland

PostPosted: Fri Mar 03, 2006 9:24 am    Post subject: Reply with quote

The problem occurs only when linking a separate .a file with Duit. When all (with the example program) is compiled using Build, everything is fine.

Back to the bug:
I've tried 3 times stripping Duit to get a smaller version and each time I apparently stripped too much and got ... a working version :/
Have you got a version without all the gdk_ and g_object_ calls ? It's much easier to work without it...
Back to top
View user's profile Send private message MSN Messenger
h3r3tic



Joined: 30 Mar 2004
Posts: 261
Location: Torun, Poland

PostPosted: Fri Mar 03, 2006 10:50 am    Post subject: Reply with quote

Nevermind. Regexps to the rescue Wink
Back to top
View user's profile Send private message MSN Messenger
h3r3tic



Joined: 30 Mar 2004
Posts: 261
Location: Torun, Poland

PostPosted: Fri Mar 03, 2006 2:31 pm    Post subject: Reply with quote

I've got the bug pinned down. Posted a report on D.bugs Cool Long life Duit !
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> gtkD All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group