Bug 2215 - SEGV due to 64bit sign extension on pointers
Summary: SEGV due to 64bit sign extension on pointers
Alias: None
Product: frysk
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Diego Novillo
Depends on: 2216
Blocks: 2127
  Show dependency treegraph
Reported: 2006-01-26 18:25 UTC by Diego Novillo
Modified: 2006-01-26 22:01 UTC (History)
0 users

See Also:
Host: x86_64-redhat-linux
Target: x86_64-redhat-linux
Build: x86_64-redhat-linux
Last reconfirmed:


Note You need to log in before you can comment on or make changes to this bug.
Description Diego Novillo 2006-01-26 18:25:04 UTC
Comment 1 Diego Novillo 2006-01-26 18:32:56 UTC
Running frysk on a 64 bit host results in

26-Jan-06 1:25:57 PM frysk.gui.FryskGui importPreferences
WARNING: /home/cygnus/dnovillo/.frysk/.settings not found. Will be created on
program exit
Exception in thread "main" java.lang.NullPointerException
   at java.lang.Object.getClass (libgcj.so.7)
   at org.gnu.gtk.frysk.EggTrayIcon.egg_tray_icon_new (EggTrayIcon.java:72)
   at org.gnu.gtk.frysk.EggTrayIcon.<init> (EggTrayIcon.java:52)
   at frysk.gui.monitor.TrayIcon.<init> (TrayIcon.java:97)
   at frysk.gui.FryskGui.mainGui (FryskGui.java:174)
   at frysk.gui.FryskGui.main (FryskGui.java:259)

The problem seems to be a dereference of a sign-extended pointer in 

#1  0x00002aaaad740686 in unwrap<java::lang::Object> (obj=0xffffffffb305f990)
    at ../../../libjava/jni.cc:223
223       if (obj == NULL || obj->getClass () != &JNIWeakRef::class$)

Pointer 'obj' is invalid.  The previous time this came up
(http://sourceware.org/bugzilla/show_bug.cgi?id=2213), a C function returning
pointers was being compiled without proper prototypes.
Comment 2 Andrew Cagney 2006-01-26 22:01:00 UTC
2006-01-26  Andrew Cagney  <cagney@redhat.com>

        * libEggTrayIcon.c: Include "eggtrayicon.h", and <gtk_java.h>.
        Cast EggTrayIcon object to GObject.