Opened 12 years ago
Last modified 12 years ago
#34470 assigned defect
xgraph segmentation fault
Reported by: | jursonovicst@… | Owned by: | ryandesign (Ryan Carsten Schmidt) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.1.0 |
Keywords: | Cc: | ||
Port: | xgraph |
Description (last modified by ryandesign (Ryan Carsten Schmidt))
xgraph -device ps -o test2-ps test.data Segmentation fault: 11
Could you apply the segmentation fault solution described by http://djconnel.blogspot.de/2012/03/installing-xgraph-on-mac-osx-lion.html, please?
But then I faced a tougher problem: I was getting a persistent segmentation fault when I ran it. gdb wasn't turning up the problem, either.
The clue was in the compiler warnings: xgraph plays fast and loose with casting between addresses and integers. Sometimes that works, sometimes... So in desperation I checked the gcc man page and started reading, looking for an option which treated all integers as longs. I didn't think this would work, because external libraries might not cooperate.
I didn't find it. But what I found instead was the "-m32" option to compile the code in 32-bit mode even on a 64-bit machine. Hmm... seemed promising. I added this to the head of the "CFLAGS" definition in Makefile (Makefile having been generated with "configure", so this isn't the best approach). I tried it and, ding-ding-ding-ding, the code ran. My little victory shout was probably out of place, since I was on Caltrain at the time...
So now it works.
Thank you for fixing the build issue yesterday...
Tamás
Attachments (3)
Change History (7)
comment:1 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)
Description: | modified (diff) |
---|---|
Owner: | changed from macports-tickets@… to ryandesign@… |
Status: | new → assigned |
Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)
Attachment: | xgraph.diff added |
---|
comment:2 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)
comment:3 follow-up: 4 Changed 12 years ago by jursonovicst@…
Hi ryandesign,
I've uploaded two files for testing xgraph.
Command $ xgraph test.dat should display an x-window application (xgraph_output.jpg) but the segmentation fault is caused by: $ xgraph -device ps -o test2.ps test.dat. I'm really sorry but I do not know hot to apply your patch. Could you check for me, please?
Thank you, T.
comment:4 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)
Replying to jursonovicst@…:
I've uploaded two files for testing xgraph.
Thanks.
Command $ xgraph test.dat should display an x-window application (xgraph_output.jpg)
Yes, that works, regardless whether I build i386 or x86_64.
but the segmentation fault is caused by: $ xgraph -device ps -o test2.ps test.dat.
Yes, I confirm that too. With x86_64 it's a segmentation fault; with i386 it's a bus error, but either way, that's a crash.
I'm really sorry but I do not know hot to apply your patch.
If you'd like to try it yourself, download the patch, then do this:
cd $(port dir xgraph) sudo port clean sudo patch < ~/Downloads/xgraph.diff sudo port install
In r93163 I fixed xgraph so that it respects -arch flags. I turned off the universal variant because it failed to build.
I've attached a patch to force the port to build 32-bit. I haven't committed it because xgraph still crashes for me. Does it work for you with this patch? If so, perhaps I just don't know how to use xgraph; please show me the command you used and let me know where to get any necessary data files.