discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Segmentation fault on OSX for intel


From: Enrico Sersale
Subject: Re: Segmentation fault on OSX for intel
Date: Thu, 05 Jan 2006 15:41:21 +0200


When I've read "Program received signal EXC_BAD_ACCESS, Could not access 
memory." in the first mail, I've thougth that it was the same error I get. But the 
problem is a bit different.
On 2005-12-21 the following lines have been changed in 
make/Instance/bundle.make:

# On Apple, two-level namespaces require all symbols in bundles
# to be resolved at link time.
ifeq ($(FOUNDATION_LIB), apple)
   LINK_BUNDLE_AGAINST_ALL_LIBS = yes
 endif

has become:

# On Darwin, two-level namespaces require all symbols in bundles
# to be resolved at link time. Do this even if we don't think we need it.
ifeq ($(findstring darwin, $(GNUSTEP_TARGET_OS)), darwin)
   LINK_BUNDLE_AGAINST_ALL_LIBS = yes
 endif

After this change I get things like this:

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000007
0x000288f9 in objc_hash_string () at NSBezierPath.m:2120
2120          bleft[1].y = (coeff[0].y + coeff[1].y) / 2;
(gdb) bt
#0  0x000288f9 in objc_hash_string () at NSBezierPath.m:2120
#1  0x00250000 in _IcePaAuthDataEntries ()
#2  0xbfffe978 in ?? ()
#3  0x0002551a in objc_hash_value_for_key () at NSBezierPath.m:1434
#4  0x031271c0 in ?? ()
#5  0x00000007 in _mh_dylib_header ()
#6  0x0317eb80 in ?? ()
#7  0x0002908b in __sel_register_typed_name () at NSBitmapImageRep.m:202
#8  0x0317e1fc in ?? ()
#9  0x00000024 in _mh_dylib_header ()
#10 0xbfffe9b8 in ?? ()
#11 0x000290ab in __sel_register_typed_name () at NSBitmapImageRep.m:204
#12 0x031271c0 in ?? ()
#13 0x00000007 in _mh_dylib_header ()
#14 0x001100b6 in NSIsEmptyRect (aRect={origin = {x = 4.23249713e-37, y = 
4.30361224e-37}, size = {width = 0, height = 2.40030908e-38}}) at 
/usr/GNUstep/System/Library/Headers/Foundation/NSGeometry.h:289
#15 0x0002b6cb in __objc_thread_id () at NSBitmapImageRep.m:917
#16 0x03100640 in ?? ()
#17 0x031271c0 in ?? ()
#18 0x00000000 in _mh_dylib_header ()
#19 0x0102af6d in -[NSBezierPath elementCount] (self=0x31271c0, _cmd=0x7) at 
NSBezierPath.m:795
Previous frame inner to this frame (corrupt stack?)

reverting to the old bundle.make fixes the problem.

On 2006-01-04 22:25:08 +0200 David Ayers <d.ayers@inode.at> wrote:

joekewoud_@joekewoud.nl schrieb:

When I start *any* gnustep program. Including most from the Tools directory
I get a segmentation fault

[snip]

I use GCC4.02 FSF

[snip]

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x746f7270
0x90a418b0 in objc_msgSend ()
(gdb) bt
#0  0x90a418b0 in objc_msgSend ()
(gdb)

Hello Ewoud,

This is an indication that your binary is being linked against Apple's
libobjc as this function is called objc_msg_send on FSF libobjc.

This is the crashlog:


[snip]

Thread 0 Crashed:
0   libobjc.A.dylib     0x90a418b0 objc_msgSend + 16

Note the name.

1   dyld                0x8fe0e2d6
ImageLoaderMachO::doNotification(dyld_image_mode, unsigned, dyld_image_info
const*) + 70
2   dyld                0x8fe03409
dyld::notifyAdding(std::vector<ImageLoader*, std::allocator<ImageLoader*>

&) + 201

3   dyld                0x8fe0c4bd
ImageLoader::runInitializers(ImageLoader::LinkContext const&) + 75
4   dyld                0x8fe02cfa dyld::initializeMainExecutable() + 112
5   Affiche             0x0000214d _call_mod_init_funcs + 36 (crt.c:305)
6   Affiche             0x00002079 _start + 79 (crt.c:240)
7   Affiche             0x00002029 start + 41

Thread 0 crashed with i386 Thread State:
eax: 0x746f7250    ebx: 0x90a404e8 ecx:0x90a4f33c edx: 0x00095470
edi: 0x00000000    esi: 0x00095470 ebp:0xbfffee58 esp: 0xbfffec98
  ss: 0x0000002f    efl: 0x00010282 eip:0x90a418b0  cs: 0x00000027
  ds: 0x0000002f     es: 0x0000002f  fs:0x00000000  gs: 0x00000037

Binary Images Description:
     0x1000 -    0x17fff Affiche
/usr/GNUstep/Local/Applications/Affiche.app/Affiche
    0x81000 -    0x92fff libobjc-gnu.1.dylib
/opt/local/lib/gcc40/libobjc-gnu.1.dylib

This is the libobjc you actually want.


0x907f0000 - 0x908b9fff com.apple.CoreFoundation 6.4.4 (368.22)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundatio

Not sure where CoreFoundation comes from...

0x908fa000 - 0x909eefff libicucore.A.dylib      /usr/lib/libicucore.A.dylib
0x90a3f000 - 0x90abffff libobjc.A.dylib         /usr/lib/libobjc.A.dylib

And here is Apples libobjc

0x90ae8000 - 0x90b4cfff libstdc++.6.dylib       /usr/lib/libstdc++.6.dylib
0x90bbb000 - 0x90bc2fff libgcc_s.1.dylib        /usr/lib/libgcc_s.1.dylib

and Apples gcc.

So it seems you have linked code previously linked with something that
pulls in CoreFoundation which is possibly responsible for also linking
the NeXT runtime, so your code is currently linked with both runtimes
which is causing the confusion.

I'm no expert on Darwin but I think with otool you can figure out the
dependencies of dylibs to determine what is pulling in the Apple code.

Good luck!
David


_______________________________________________
Discuss-gnustep mailing list
Discuss-gnustep@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnustep








reply via email to

[Prev in Thread] Current Thread [Next in Thread]