-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Core dump / Segfault #11
Comments
Looks good.
Don't know whats going on here.
Ditto.
Is the * after the executable name a typo, it will cause problems, i get an exception though.
Compiler version ? No ideas yet, but the demos do have some weird behavior for me. |
On 23/10/13 19:27, Mike Wey wrote:
If I supply a jpeg as a parameter, I get the segfault as above.
|
What is the command you are using?
The sigmoidalContrast example works correctly for me. I was having some problems but it turns out that because i wasn't using pkgconfig the HDRI version wasn't defined. |
Thanks for taking the time to help me with this - it is very much appreciated. I'm using
But lets leave that aside for now... there is something screwed up here and I'm getting more and more convinced that it's my installation using the wrong library or something. This is what I've found so far: test.d contains :
I compile and run :
I have managed to narrow down the issue to line 67 of Options.d :
but I cannot see anything wrong with it. In such a short bit of code, there isn't a lot that can go wrong! If it is of any help, here is the last few lines of output from gdb :
This is my first time ever using gdb so it doesn't make much sense to me... but the error seems to not be related to DMagick? Something gc-related? I have tried writing the equivalent code using Magic++, which seems to have no problem at all despite linking to the same libaries. I am at a loss... and I'm not able to get very excited about the prospect of compiling the IM libaries with debuging symbols. Finally, I thought I might try a different compiler, but I get this:
What exactly does that -version flag do? Have you had any success using these alternative compilers? Any other ideas? |
Okay, so if I compile with ldc2 using all the flags from pkg-config, except the -version flag, it compiles fine, and behaves exactly the same as with dmd. In other words, it segfaults with no other useful output. So perhaps it's not a compiler issue...
But what is the significance of the -version flag? |
The version defines the amount of bits used for the color information. DMagick an MagickCore need to be in sync in that regard. With HDRI support floats are used for the Quantums , and without it usually ushorts but bytes, ints or doubles are also possible. Could you also post the backtrace from gdb. (using the bt command after the segfault)
You should provide both an in and output filename, but the first thing the code checks is if you provided both on line 24. |
I thought it must be something like that, but couldn't find any
That is certainly a more useful output, yet I'm still none the wiser...
You're quite right. I tried giving it an output filename and it Thanks again for the pointers. I'm really quite keen to get this to work... |
sorry that last post is a bit of a mess - i can't persuade the code block to behave. |
Okay, I have a successful compile and run of sigmoidalContrast... but on a different machine. It seems that DMagick works fine on a 64-bit architecture, but segfaults on 32-bit. Hopefully that will help pinpoint the problem? I have tried now on three machines - two 32-bit machines which both segfault, one 64-bit machine that has no problem. Those segfaults are with the simple program from above : test.d I would like to get this working on my 32-bit machine if possible... |
I'll look into it over the weekend. |
Fixed in commit 9032d3b the pkg-config files should now contain the proper flags for gdc and ldc if one of them is used to compile the lib. |
Got it! Don't worry though, I've left you with something to do at the weekend! :) I've been comparing struct and type sizes between DMagick and Magick++, as I suspected it was a type issue. Basically, for some reason, on my 32-bit system :
and therefore (using Magick++):
but in magickType.d, line 107 does this :
so
If I change that line to :
then I can successfully compile and run draw.d from the examples folder. Without some sort of inside knowledge about the various version checks going on in magickType.d, I don't think I can go any further. Also, I cannot work out where or how MAGICKCORE_SIZEOF_FLOAT_T gets set. What I have done is effectively a hack - I have no idea how to do it correctly. So over to you... let me know if I can be of any help. Of course, all of the above is irrelevant on my 64-bit system - both DMagic and Magick++ alias/typedef MagicRealType to be a float (4 bytes). Thanks again for your help. |
You got me worried there for a minute ;) |
Can you post the output of the following code: #include <stdio.h>
#include <math.h>
int main(int argc,char **argv)
{
printf("%i \n", sizeof(float_t));
printf("%i \n", sizeof(float));
printf("%i \n", sizeof(double_t));
printf("%i \n", sizeof(double));
} |
On 25/10/13 22:42, Mike Wey wrote:
|
Just realised that perhaps you intended that code to be C, not C++... but I can confirm that the output is the same if I compile it as C. |
With ImageMagick 6.8.1 the type of MagickRealType changed from float to float_t (and double to double_t for 32bits Quantums). I still need to find out if a can always alias MagickRealType to real or if float_t can be a different type in some circumstances. |
On Windows with MinGW float_t also is float with X86_64 and real with i686. So i changed the definition of MagickRealType to real on 32-bits systems. |
It's probably my fault - I'm just starting out with D so please be patient. The following is my attempt to compile and run the two examples shipped with DMagick. It's DMagick version 6.8.7. The attempt to run draw.d using rdmd instead of dmd just hung after the strange error message below... hence the ^C. I'm on Arch Linux... I think any other info you might want is below...
Any ideas?
The text was updated successfully, but these errors were encountered: