This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Looking for ideas to fix X server crash running GCJ-compiled program


> Recent tests of my application cause the X server to crash....
> According to a gdb backtrace, the problem is a SEGV in CopyGC...

I've been working on this problem for a week, and I thought I'd report the
results so far.

I've determined that the problem is not specific to the libjava xlib peers,
in that the attached little C program (for linux/gcc/libX11) crashes the
server in the same way.  The trick is to do XCreateGC, XCopyGC and XFreeGC
for every repaint.  Most C xlib programs I've seen don't do that (not that
I've seen that many), but our java.awt implementation does.  So far the
crash has only happened on embedded systems using Xfbdev - not on desktops.

I've reported the problem on the XFree86 list, to see what folks there
think.

If I find out that we shouldn't be doing so many GC operations, maybe I'll
have to either modify java.awt.Component to preserve GCs or implement a GC
cache in gnu.gcj.xlib.GC.  I prefer the cache idea.  We'd still have a lot
of XCopyGC calls, but far fewer XCreateGC and XFreeGC, and a smaller number
of GCs simultaneously open on the server.  It might boost performance by
reducing traffic to the server.

Attachment: manyGC.c
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]