Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 8957
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: George Shapovalov <george@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Jonathan Nall <nall@themountaingoats.net>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
xcircuit-2.5.4-badptrptr.patch patch for SIGSEGV patch Jonathan Nall 2002-10-09 22:41 0000 311 bytes Details | Diff
xcircuit-2.5.4.ebuild modified ebuild application/octet-stream George Shapovalov 2002-10-13 22:18 0000 1.06 KB Details
xcircuit-2.5.4.patch combined patch patch George Shapovalov 2002-10-13 22:19 0000 1.10 KB Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 8957 depends on: Show dependency tree
Bug 8957 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2002-10-09 22:40 0000
app-sci/xcircuit SIGSEGVs during startup. i've confirmed this on both x86 and
PPC. i'm attaching a patch that will fix this problem. the faulty code is

foo** bar;
*bar = malloc();

my solution is:
foo** bar;
foo* baz;
bar = &baz;
*bar = malloc();

------- Comment #1 From Jonathan Nall 2002-10-09 22:41:32 0000 -------
Created an attachment (id=4558) [details]
patch for SIGSEGV

------- Comment #2 From SpanKY 2002-10-10 01:14:43 0000 -------
what a crazy hack :) 

------- Comment #3 From Jonathan Nall 2002-10-10 07:27:57 0000 -------
not so crazy... i'm pretty sure it's what the author intended. 
let's talk in char's.

he made a char** called newinst. that's a pointer to a pointer to a char.
then he says *newinst = malloc(...). that says i'd like the thing that newinst
points to (a char*) to be assigned whatever malloc returns. but there's a
problem here. his declaration:
char** newinst;
doesn't initialize it's variable. let's say the compiler is nice and initializes
it to NULL. if that's the case,
*newinst = malloc(...);
is really saying
*(NULL) = malloc(...);
which is an obvious SIGSEGV.

all my patch does is create a char* and initialize newinst to the address of
that char*. this allows code like: *newinst = malloc(...) to work just fine.

------- Comment #4 From George Shapovalov 2002-10-13 22:16:14 0000 -------
Hi Jonathan

Thanks for tracking the problem and the patch!
I tried the patch, however the compilation halts with a somewhat misterious
message (the modified code looks syntactically correct to me, but gcc apparently
thinks otherwise). Here is the tailing part:

gcc -DPACKAGE=\"xcircuit\" -DVERSION=\"2.5\" -DPROTOTYPES=1 -DHAVE_LIBM=1
-DHAVE_LIBXT=1 -DSTDC_HEADERS=1 -DHAVE_SETENV=1 -DHAVE_PUTENV=1
-DHAVE_DIRENT_H=1 -DHAVE_U_CHAR=1 -DSCHEMA=1 -DSCHEM_FLAG=\"-schema\" -DLGF=1
-DINPUT_FOCUS=1 -DGS_EXEC=\"gs\" -DHAVE_PYTHON=1 -DHAVE_X11_XPM_H=1 -DHAVE_XPM=1
 -I. -I.  -IXw -DPROG_VERSION=2.5  -DTEMP_DIR=\"/tmp\"     
-DRESOURCES_DIR=\"/usr/share/xcircuit-2.5/app-defaults\"       
-DBUILTINS_DIR=\"/usr/share/xcircuit-2.5\"     -DBUILTINS_FILE=\"\"   
-DUSER_RC_FILE=\".xcircuitrc\"  -DPROLOGUE_DIR=\"/usr/share/xcircuit-2.5\"    
-DPROLOGUE_FILE=\"xcircps2.pro\"        -DSTARTUP_FILE=\"xcstartup.py\"        
-DLGF_LIB=\"lgf.lps\"  -I/usr/X11R6/include -DDOUBLEBUFFER
-I/usr/include/python2.2  -march=i686 -O2 -pipe -fforce-addr
-fomit-frame-pointer -funroll-loops -frerun-loop-opt -malign-functions=4 
-fexpensive-optimizations -ffast-math -c files.c
files.c: In function `objectread':
files.c:1977: parse error before `*'
files.c:2029: `newpath' undeclared (first use in this function)
files.c:2029: (Each undeclared identifier is reported only once
files.c:2029: for each function it appears in.)
files.c:2036: `startpoint' undeclared (first use in this function)
make[1]: *** [files.o] Error 1
make[1]: Leaving directory `/var/tmp/portage/xcircuit-2.5.4/work/xcircuit-2.5.4'
make: *** [all-recursive] Error 1

The same happens without any optimizations. Could you please take a look?
I attach below the modofied ebuild and the patch (combining this bug and #8960)
Thanks!

George

------- Comment #5 From George Shapovalov 2002-10-13 22:18:20 0000 -------
Created an attachment (id=4686) [details]
modified ebuild

------- Comment #6 From George Shapovalov 2002-10-13 22:19:11 0000 -------
Created an attachment (id=4687) [details]
combined patch

------- Comment #7 From Jonathan Nall 2002-10-13 23:03:01 0000 -------
george, 
which version of gcc are you using? i just used your combined patch with your
modified ebuild and compilation completed without a hitch. i'm using gcc 3.2.

------- Comment #8 From George Shapovalov 2002-10-14 22:45:36 0000 -------
Hi Jonathan

That was a quick way to find the problem, nice :).
I made this patch conditional on gcc version and the other one unconditional
(for the record: this patch is necessary on gcc-3.2 but breaks on 2.95.x). 
Please test the ebuild. I committed and masked it (I did not bump the revision
not to force the recompilation on platforms where it works now). 
To unmask, please remove '~' (tilda) in KEYWORDS inside the ebuild.
Please report the result, so I could unmask it.
Thanks for your work!

George

------- Comment #9 From Jonathan Nall 2002-10-15 08:31:41 0000 -------
tested on PPC and x86 (both gcc 3.2 boxes)-- it works great on both
architectures.

------- Comment #10 From Jonathan Nall 2002-10-15 15:03:43 0000 -------
george,
i looked at the xcircuit-2.5.4 available from sourceforge.net and it's different
than the one on the gentoo mirror. specifically this section of code is
different. do you know what this is about?

i'm looking at xcircuit-2.5.4 as available from:
http://sourceforge.net/project/showfiles.php?group_id=4952


------- Comment #11 From George Shapovalov 2002-10-15 15:27:31 0000 -------
Hi Jonathan.

Well, to tell the truth I have little idea why this is a different code than the
one on sourceforge. I wasn't the one who created/added this ebuild, so I
wouldn't really know its original whereabouts. According to Changelog Tod Neidt
might be able to tell little bit more about this. I added him to this bug.

Tod: could you please comment if you have any info on the question?


George

------- Comment #12 From Tod M. Neidt 2002-10-15 19:22:08 0000 -------
Hi!

Perusing the manifest, it seems the developer of xcircuit makes multiple
releases with incremental changes using the same version number.  It also
appears that the offical homepage has changed to   http://xcircuit.ece.jhu.edu 
which should be updated in the ebuild.  the latest and greatest sources are
found at http://xcircuit.ece.jhu.edu/archive/     Incidentally, the latest
release is 3.0

You will notice that the 2.5.4 tarball is dated 14 May 2002 at the above archive
while the 2.5.4 version on sourceforge is dated  28 April 2002.  Incidentally, I
committed the original ebuild on 5 April 2002 with the src uri pointing to the
old homepage  (It worked fine then, honest :),  so there appears to be at least
three different flavors of 2.5.4 floating around.

I would update the HOMEPAGE and SRC_URI to http://xcircuit.ece.jhu.edu/ and
http://xcircuit.ece.jhu.edu/archive/ respectively as those seem to be the most
current and maintained. Would you mind updating that George, my box is not
developer enable at the moment. It doesn't appear that the sourceforge page is
kept current.

Sorry, for any confusion, I have be out of the saddle for a while and haven't
been able to track changes.

tod

P.S. might consider floating the patches upstream.






------- Comment #13 From George Shapovalov 2002-10-15 22:52:15 0000 -------
Hi Tod

Thanks for clarification! 
I updated HOMEPAGE and SRC_URI in the present ebuild (the source seems to be the
same at least according to diff and md5 sums).
Most likely I'll take care of newer versions, as I am overseing app-sci as well
as couple of dev categories. Though this will have to wait since we are now in a
feature freeze. 
As for this issue: it seems to be resolved now, so I'll just wait for test
reports from ppc/gcc-2.95.3 people and close this bug, unless anythig else comes
up :).

George

------- Comment #14 From George Shapovalov 2002-10-22 02:38:14 0000 -------
Closing the bug, as resolved and tested and no complaints within a week (still
~
in ppc, but I'll let ppc people remove it).

George

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug