View previous topic :: View next topic |
Author |
Message |
Ant
Joined: 06 Mar 2004 Posts: 306 Location: Canada
|
Posted: Mon Feb 27, 2006 9:24 pm Post subject: segfault - solution paradox |
|
|
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!
Ant |
|
Back to top |
|
|
larsivi Site Admin
Joined: 27 Mar 2004 Posts: 453 Location: Trondheim, Norway
|
Posted: Tue Feb 28, 2006 12:55 am Post subject: |
|
|
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 |
|
|
Ant
Joined: 06 Mar 2004 Posts: 306 Location: Canada
|
Posted: Tue Feb 28, 2006 7:54 am Post subject: |
|
|
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 |
|
|
JJR
Joined: 22 Feb 2004 Posts: 1104
|
Posted: Tue Feb 28, 2006 11:08 am Post subject: |
|
|
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 |
|
|
larsivi Site Admin
Joined: 27 Mar 2004 Posts: 453 Location: Trondheim, Norway
|
Posted: Tue Feb 28, 2006 2:31 pm Post subject: |
|
|
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 |
|
|
h3r3tic
Joined: 30 Mar 2004 Posts: 261 Location: Torun, Poland
|
Posted: Fri Mar 03, 2006 9:24 am Post subject: |
|
|
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 |
|
|
h3r3tic
Joined: 30 Mar 2004 Posts: 261 Location: Torun, Poland
|
Posted: Fri Mar 03, 2006 10:50 am Post subject: |
|
|
Nevermind. Regexps to the rescue |
|
Back to top |
|
|
h3r3tic
Joined: 30 Mar 2004 Posts: 261 Location: Torun, Poland
|
Posted: Fri Mar 03, 2006 2:31 pm Post subject: |
|
|
I've got the bug pinned down. Posted a report on D.bugs Long life Duit ! |
|
Back to top |
|
|
|
|
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
|