Re: [java-gnome-hackers] gnome conflicts with gtkentry
Brought to you by:
afcowie
From: Tom B. <Tom...@Su...> - 2003-04-08 22:51:42
|
With Sun's latest it crashes regularly for me in my app. You should be able to recreate this bug using src/examples/gtk/entry or src/examples/gtk/text: just type any character into a text or entry field. I can't spend more time on this today (my real job gets in the way), but the problem seems to be in org_gnu_glib_GObject.c:jg_signal_cb() with uninitialized arguments being passed up to Java. If one changes line 129 to read: jargs = alloca(n_param_values * sizeof(jvalue)); add => memset(jargs, 0, n_param_values * sizeof(jvalue)); then problems turn up more quickly due to null handles (0xCA is another good memset choice since it's a rarely used but easily recognized memory pattern). The alloca call just allocates space on the stack, so it is "initialized" to whatever garbage was on there previously. A related problem is that the first Java parameter was never initialized due to the for loop reading "for(i = 1; i < n_param_values; i++)". I don't know if a starting index of one makes sense for a GClosureMarshall function (there's no documentation), but it doesn't for the Java argument array. When I changed it to "i = 0;" things moved further, but it fails in EventKey.getString with a bogus eventkey handle. Would someone more familiar with the jg_signal_cb() code take a look at this? Tom On Sun, 2003-04-06 at 16:00, Jeffrey Morgan wrote: > That is very strange. I can type as many characters > as I wish into the gnome entry example and the gtk > entry example and experience no problems. Can you > please try to run the examples with Sun's JDK? It > should produce an output file when it crashes named > something like hs_err_pid9999.log. If it doesn't > crash with Sun's JDK then the problem is when using > it with the Blackdown JDK. That will help me debug > it. > > On Sun, 2003-04-06 at 16:27, Mark Howard wrote: > > On Sun, 2003-04-06 at 21:24, Mark Howard wrote: > > > On Sun, 2003-04-06 at 20:37, Jeffrey Morgan wrote: > > > > What happens on your system if you run the EntryTest example > > > > under src/examples/gnome/entry? > > > > > > Typing one character works. > > > The example crashes when I type a second. > > > If I press backspace after the first character, it is deleted and I can > > > type another character. > > > > The same thing also happens when using a gtk entry. -- Tom Ball <Tom...@Su...> |