Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 98711 - GNUStep: segfaults in Gorm/GWorkspace, and other apps
Summary: GNUStep: segfaults in Gorm/GWorkspace, and other apps
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High blocker (vote)
Assignee: Gentoo Gnustep project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-11 15:44 UTC by SciYro
Modified: 2005-07-15 06:49 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description SciYro 2005-07-11 15:44:11 UTC
i get segfaults everytime in Gorm, and GWorkspace (on a reliable interval (always))


dont know how related it is: but i get errors on the terminal coming from NSView
when i use applications, heres it is: (comes in Gorm when i tell it to open that
new appliciation working window

2005-07-09 16:48:50.000 Gorm[13157] File NSView.m: 863. In [NSClipView
-setFrame:] given negative width
2005-07-09 16:48:50.000 Gorm[13157] File NSView.m: 868. In [NSClipView
-setFrame:] given negative height

im assuming the segfault comes from the AppKit, as multiple apps are effected,
even ones that people say are stable, and even simple test programs, altho i
havent tried to trace it down further yet (i havent got a clue where to start,
as im still learning objective-c/gnustep api)

backtraces dont give any info, every time i run a backtrace all i get are
numbers and "??" marks, even with "debug" in the USE variables

Reproducible: Always
Steps to Reproduce:
in GWorkspace the segfault comes when i use NSTextFields and select all text

i even modified the button app in the mine-tutorial to show a editable
NSTextField (this is a simple app, and altho im new and all, i dont think there
is anyway i could have make it segfault myself), the same segfault comes when i
write in the field, then select the text (it cames after a release the button)

as for Gorm: 
1) open it
2) menu->Document->new application
3) in the palete, press any widget as to drag it over
4) the segfault comes always the second i press the button (as to drag the widget)
Actual Results:  
segfaults

Expected Results:  
working apps

Portage 2.0.51.22-r1 (!/etc/portage-profile, gcc-3.3.5-20050130,
glibc-2.3.4.20041102-r1, 2.6.10-gentoo-r6369 i686)
=================================================================
System uname: 2.6.10-gentoo-r6369 i686 AMD Athlon(tm) XP 2600+
Gentoo Base System version 1.6.12
dev-lang/python:     2.3.5
sys-apps/sandbox:    1.2.10
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.5
sys-devel/binutils:  2.15.92.0.2-r10
sys-devel/libtool:   1.5.18-r1
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=athlon-xp -O2 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib/X11/xkb /usr/share/texmf/dvipdfm/config/
/usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/
/usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=athlon-xp -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache digest distlocks nostrip notitles sandbox sfperms userpriv"
GENTOO_MIRRORS="http://gentoo.binarycompass.org http://chod.cwru.edu/gentoo
http://gentoo.osuosl.org http://www.ibiblio.org/pub/Linux/distributions/gentoo"
LC_ALL="en_US.utf8"
MAKEOPTS="-j1"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/tmp/"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="x86 3dnow 3dnowex X Xaw3d a52 aac aalib acpi aim alsa audiofile avi
bash-completion bitmap-fonts bzlib cdparanoia cdr cups curl debug dlloader dv
dvd dvdread encode erandom esd faac faad fam ffmpeg flac flash fpx freetype gdbm
gif gimp gnustep graphviz gstreamer gtk gtk2 hardened icq imagemagick imlib
imlib2 jabber jbig joystick jpeg ladcca lcms libcaca libffi libwww live logging
lzo mad man mapeditor maps matroska mmx mmx2 mng motif mpeg mplayer music
ncurses network nptl nptlonly objc offensive ogg oggvorbis ogm openal opengl
oscar pam pcre pdflib perl physfs pic pie plotutils png python readline real rtc
sdl sftp silc slang sndfile sounds sox speex spell sse ssl ssp svg szip tcpd
tetex theora tiff truetype truetype-fonts type1-fonts unicode usb userlocales
v4l2 videos vorbis xanim xml2 xpm xv yahoo yv12 zlib"
Unset:  ASFLAGS, CTARGET, LANG, LDFLAGS, LINGUAS, PORTDIR_OVERLAY

and the test program or NSTextField:

#include <Foundation/Foundation.h>
#include <AppKit/AppKit.h>

@interface MyDelegate : NSObject
{
  NSWindow *myWindow;
}
- (void) printHello: (id)sender;
- (void) createMenu;
- (void) createWindow;
- (void) applicationWillFinishLaunching: (NSNotification *)not;
- (void) applicationDidFinishLaunching: (NSNotification *)not;
@end

@implementation MyDelegate : NSObject 
- (void) dealloc
{
  RELEASE (myWindow);
}

- (void) printHello: (id)sender
{
  printf ("Hello!\n");
}

- (void) createMenu
{
  NSMenu *menu;

  menu = AUTORELEASE ([NSMenu new]);

  [menu addItemWithTitle: @"Quit"  
        action: @selector (terminate:)  
        keyEquivalent: @"q"];

  [NSApp setMainMenu: menu];
}

- (void) createWindow
{
  NSRect rect;
  unsigned int styleMask = NSTitledWindowMask 
                           | NSMiniaturizableWindowMask;
  NSTextField *myButton;
  NSSize buttonSize;

  myButton = AUTORELEASE ([NSTextField new]);
  [myButton setEditable: YES];
  buttonSize = [myButton frame].size;
  rect = NSMakeRect (100, 100, 
                     100, 
                     50);

  myWindow = [NSWindow alloc];
  myWindow = [myWindow initWithContentRect: rect
                       styleMask: styleMask
                       backing: NSBackingStoreBuffered
                       defer: NO];
  [myWindow setTitle: @"This is a test window"];
  [myWindow setContentView: myButton];
}

- (void) applicationWillFinishLaunching: (NSNotification *)not
{
  [self createMenu];
  [self createWindow];
}

- (void) applicationDidFinishLaunching: (NSNotification *)not;
{
  [myWindow makeKeyAndOrderFront: nil];
}
@end

int main (int argc, const char **argv)
{ 
  [NSApplication sharedApplication];
  [NSApp setDelegate: [MyDelegate new]];

  return NSApplicationMain (argc, argv);
}
Comment 1 Armando Di Cianno (RETIRED) gentoo-dev 2005-07-11 18:52:24 UTC
I believe that I've seen this problem before.  Could you rebuild gnustep-base
with USE="ffcall -gcc-libffi", and try the applications again?  If you weren't
using libffi (and thus using ffcall) already, please say so.

Feedback would be greatly appreciated.
Comment 2 Armando Di Cianno (RETIRED) gentoo-dev 2005-07-11 18:53:23 UTC
Also, could you post the contents of `cat /proc/cpuinfo` out of curiousity.  Thanks.
Comment 3 SciYro 2005-07-12 15:28:10 UTC
 -- CPU Info --
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 6
model           : 10
model name      : AMD Athlon(tm) XP 2600+
stepping        : 0
cpu MHz         : 1916.714
cache size      : 512 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 mmx fxsr sse pni syscall mmxext 3dnowext 3dnow
bogomips        : 3809.28

-- --

nope, i used the ffcall thing, but it still segfaults just like usual
Comment 4 Armando Di Cianno (RETIRED) gentoo-dev 2005-07-12 16:05:41 UTC
Ahh...I may not have seen this before, actually.

To clarify, did you switch to ffcall or did you use it to begin with?  If you
had used it to begin with, can you try it with libffi?  If you

USE="-ffcall -gcc-libffi" emerge gnustep-base

... it should emerge dev-libs/libffi (if you your gcc provides this, i.e. you
built 3.3.5* series with gcj, you can in fact use gcc-libffi use flag).

Please let me know which you started with (I had assumed you had started with
libffi), and also if libffi ends up working for you.
Comment 5 SciYro 2005-07-12 20:16:52 UTC
i started with the defailt (libffi), i tryed ffcall, gcc-libffi, and libffi,
with no diffrence.
Comment 6 Armando Di Cianno (RETIRED) gentoo-dev 2005-07-14 15:58:21 UTC
Okay, I've seeing if anyone upstream knows anything about this (as it still
seems similar an error I personally had); I have one last round of suggestions.

Summary: make sure we emerge gnustep with ffcall and not libffi; run latest
soon-to-be-stablized versions of gnustep core packages (which have fixes that
fixed the similar issue I was having).

Steps:
- # emerge -pv unmerge `qpkg -I gnustep -nc` dev-libs/libffi dev-libs/ffcall
--+ above assumes you have qpkg from "gentoolkit" installed
--+ there aren't mant other packages that depends on the external version of
libffi -- if you are running them, you'd know (e.g. sablevm); in that case,
don't unmerge libffi

- # ACCEPT_KEYWORDS="~x86" USE="ffcall -gcc-libffi" emerge -pv gnustep-env
--+ ffcall should be merged
--+ libffi should not be merged
--+ Important packages that are currently ~x86: ffcall-1.10 and
gnustep-base-1.10.3-r1

- merge the programs that were failing for you

- let me know :-)

You likely didn't merge -r1 of gnustep-base, which actually enables use of
ffcall via the use flag -- I believe this may be it, if it is the problem i've
seen before.

Thanks for the help!
Comment 7 SciYro 2005-07-14 20:41:53 UTC
thanks!, apparently ffcall was never emerged, even tho i had it set in use
flags, but those commanands you gave made it install, along with everything else
in gnustep, so im not seeing any more segfaults, and gorm is working fine.

thanks again, now i can start using gorm/projectcenter
Comment 8 Armando Di Cianno (RETIRED) gentoo-dev 2005-07-15 06:49:30 UTC
No, thank you for testing. :-)

I'm going to stabilze gnustep-base-1.10.3-r1 soon, so any updates you do should
be transparent. Note that if you emerge sync before I do this, it may want to
downgrade gnustep-base, so don't let it. :-)

Also, for further reference, generaly, let devs close the bugs, as most keep
their open bugs as a sort of TODO list.

Thanks again.