EXC_BAD_ACCESS when trying to use X11
EXC_BAD_ACCESS when trying to use X11
- Subject: EXC_BAD_ACCESS when trying to use X11
- From: "Kustaa Nyholm" <email@hidden>
- Date: Mon, 26 Mar 2007 10:42:14 +0300
Hi List,
I've built, succesfully I think, OpenCASCADE on my Mac OS X 10.4.9 Dual
Core Intel.
Having problems running the supplied demo application DRAWEXE.
It crashes with EXC_BAD_ACCESS
This demo application uses, I think, Tcl, Tk and X11.
I can run X11 applications, like InkScape, no problem.
I've been able to run it with the Xcode debugger (gdb) and single step
to the offending statement.
The application starts and runs until 'XSynchronize' statement is
reached (see code sample below).
If I comment that out the application runs untill it reaches 'XFlush'
statement, see crash report below.
My presumption is that the application code is OK, after all it is
part of a huge open source project OpenCASCADE
and I've not seen any reports on this sort of problem from people
running it on Linuxes, Solaris or Windows.
So my thinking is that there is something wrong in my configuration or
enviroment, or the way I link the Tcl,Tk&X11
libs to the application, or the way this code accesses them.
What I find strange is that the 'Draw_WindowDisplay' parameters that is
passed to the crashing function 'XSyncronize'
has been returned from ' Tk_Display' a few line above, and looking with
the debugger it looks like a bona fide address
AFAIU (0x2DA808). Moreover, the next function 'XSetInputFocus' seems to
be totally happy with that pointer. If I
comment out the 'XSyncronize' the crash happens much later.
I'm lost here since my experience with X11 is limited, to say the
least, though I've got some +25 years of C/C++/Java under my belt.
One hunch that I have is that somehow or other the code is using
accessing wrong X11 libs from /usr/.... (there propably
are something there because I've used Fink to install some other
packages) instead of the Apple Framework stuff.
Just a thought, don't realy understand how this is supposed to work.
The OpenCASCADE is a huge project (took 5 hours to compile on 2 GHZ
dual core with 2 GB RAM) but amazingly
I had to do very minor adjustments to make it compile and link.
Removed some malloc.h refs, fixed a wrong type
for 'pthread_t' and thats about it.
I also used the apple supplied glibtool and the linking and library
building part all went smoothly.
So I expect I'm doing something right...;-)
Any ideas on what to check on my enviroment, installation, where to
look for more information, how to debug, what to test?
br Kusti
// The configuration I used for building OpenCASCADE
*********************************************
./configure CFLAGS="-O -g -isysroot /Developer/SDKs/MacOSX10.4u.sdk
-arch i386" LDFLAGS="-arch i386"
--with-gl-include=/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/include
--x-includes=/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/include
--x-libraries=/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/lib --with-x
--with-tcl=/System/Library/Frameworks/Tcl.framework
--with-tk=/System/Library/Frameworks/Tk.framework
// CODE SAMPLE FOLLOWS
*****************************************************
Standard_Boolean Init_Appli()
{
theCommands.Init();
interp = theCommands.Interp();
Tcl_Init(interp) ;
try {
OCC_CATCH_SIGNALS
Tk_Init(interp) ;
} catch (Standard_Failure) {
cout <<" Pb au lancement de TK_Init "<<endl;
}
Tcl_StaticPackage(interp, "Tk", Tk_Init, (Tcl_PackageInitProc *)
NULL);
mainWindow =
Tk_MainWindow(interp) ;
if (mainWindow == NULL) {
fprintf(stderr, "%s\n", interp->result);
exit(1);
}
Tk_Name(mainWindow) =
Tk_GetUid(Tk_SetAppName(mainWindow,
"Draw")) ;
Tk_GeometryRequest(mainWindow, 200, 200);
if (Draw_WindowDisplay == NULL) {
Draw_WindowDisplay = Tk_Display(mainWindow) ;
}
if (Draw_WindowDisplay == NULL) {
cout << "Cannot open display : "<<XDisplayName(NULL)<<endl;
cout << "Interpret commands in batch mode."<<endl;
return Standard_False;
}
//
// synchronize the display server : could be done within Tk_Init
//
********* EXECPTION HAPPENS ON THE NEXT LINE *************
XSynchronize(Draw_WindowDisplay, True);
XSetInputFocus(Draw_WindowDisplay,
PointerRoot,
RevertToPointerRoot,
CurrentTime);
Draw_WindowScreen = DefaultScreen(Draw_WindowDisplay);
Draw_WindowColorMap = DefaultColormap(Draw_WindowDisplay,
Draw_WindowScreen);
tty = isatty(0);
// CRASH REPORT FOLLOWS
*****************************************************************************
Date/Time: 2007-03-26 10:15:46.957 +0300
OS Version: 10.4.9 (Build 8P2137)
Report Version: 4
Command: DRAWEXE
Path: /usr/local/bin/DRAWEXE
Parent: bash [16286]
Version: ??? (???)
PID: 16287
Thread: 0
Exception: EXC_BAD_ACCESS (0x0001)
Codes: KERN_INVALID_ADDRESS (0x0001) at 0x5c637273
Thread 0 Crashed:
0 libX11.6.dylib 0x9cdcfd04 XFlush + 23
1 libTKDraw.0.dylib 0x01040fde Draw_Window::Flush() + 28
(Draw_Window.cxx:593)
2 libTKDraw.0.dylib 0x0103b797 Draw_Viewer::Flush() + 31
(Draw_Viewer.cxx:1123)
3 libTKDraw.0.dylib 0x01020294 Draw_Interprete(char*) + 370
(Draw.cxx:360)
4 libTKDraw.0.dylib 0x010203ba ReadInitFile(char*) + 98
(Draw.cxx:113)
5 libTKDraw.0.dylib 0x0102071d Draw_Appli(int, char**, void
(*)(Draw_Interpretor&)) + 843 (Draw.cxx:248)
6 libTKDraw.0.dylib 0x0102e93e main_(int, char**, void
(*)(Draw_Interpretor&)) + 44 (Draw_Main.cxx:179)
7 DRAWEXE 0x00002dfa main + 40 (DRAWEXE.cxx:23)
8 DRAWEXE 0x00002736 _start + 216
9 DRAWEXE 0x0000265d start + 41
Thread 1:
0 libSystem.B.dylib 0x9001a0ec select + 12
1 libSystem.B.dylib 0x90024147 _pthread_body + 84
Thread 0 crashed with X86 Thread State (32-bit):
eax: 0x5c637273 ebx: 0x01040fce ecx: 0x0000001d edx: 0x010373e0
edi: 0x15e23e29 esi: 0x002cd808 ebp: 0xbffff978 esp: 0xbffff960
ss: 0x0000001f efl: 0x00010202 eip: 0x9cdcfd04 cs: 0x00000017
ds: 0x0000001f es: 0x0000001f fs: 0x00000000 gs: 0x00000037
Binary Images Description:
0x1000 - 0x2fff DRAWEXE /usr/local/bin/DRAWEXE
0x1008000 - 0x1088fff libTKDraw.0.dylib
/usr/local/lib/libTKDraw.0.dylib
0x1b1e000 - 0x1bc0fff libTKMesh.0.dylib
/usr/local/lib/libTKMesh.0.dylib
0x274d000 - 0x2859fff libTKHLR.0.dylib
/usr/local/lib/libTKHLR.0.dylib
0x41d5000 - 0x4704fff libTKGeomAlgo.0.dylib
/usr/local/lib/libTKGeomAlgo.0.dylib
0x923d000 - 0x940efff libTKTopAlgo.0.dylib
/usr/local/lib/libTKTopAlgo.0.dylib
0xb77b000 - 0xb819fff libTKBRep.0.dylib
/usr/local/lib/libTKBRep.0.dylib
0xca1e000 - 0xce35fff libTKGeomBase.0.dylib
/usr/local/lib/libTKGeomBase.0.dylib
0x105d6000 - 0x10640fff libTKG2d.0.dylib
/usr/local/lib/libTKG2d.0.dylib
0x10f24000 - 0x11029fff libTKG3d.0.dylib
/usr/local/lib/libTKG3d.0.dylib
0x121f5000 - 0x1236cfff libTKMath.0.dylib
/usr/local/lib/libTKMath.0.dylib
0x1399a000 - 0x13b13fff libTKernel.0.dylib
/usr/local/lib/libTKernel.0.dylib
0x8fe00000 - 0x8fe4afff dyld 46.12 /usr/lib/dyld
0x90000000 - 0x90172fff libSystem.B.dylib
/usr/lib/libSystem.B.dylib
0x90219000 - 0x90256fff com.apple.CoreText 1.1.2
(???) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreText.framework/Versions/A/CoreText
0x90284000 - 0x9034cfff com.apple.CoreFoundation 6.4.7
(368.28) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
0x903a3000 - 0x90649fff com.apple.CoreServices.CarbonCore
682.18 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore
0x906cc000 - 0x9073ffff com.apple.framework.IOKit 1.4.6
(???) /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
0x90907000 - 0x90907fff com.apple.CoreServices 10.4
(???) /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices
0x90909000 - 0x909fcfff libicucore.A.dylib
/usr/lib/libicucore.A.dylib
0x90a4c000 - 0x90acbfff libobjc.A.dylib
/usr/lib/libobjc.A.dylib
0x90c57000 - 0x90c69fff libauto.dylib /usr/lib/libauto.dylib
0x90f57000 - 0x90fbffff com.apple.CoreServices.OSServices
4.1 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices
0x91047000 - 0x91057fff com.apple.WebServices 1.1.3
(1.1.0) /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/WebServicesCore.framework/Versions/A/WebServicesCore
0x91062000 - 0x910e0fff com.apple.SearchKit
1.0.5 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit
0x91115000 - 0x91133fff com.apple.Metadata 10.4.4
(121.36) /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata
0x912a5000 - 0x912adfff com.apple.speech.recognition.framework
3.6 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SpeechRecognition.framework/Versions/A/SpeechRecognition
0x913c5000 - 0x913d4fff libCGATS.A.dylib
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Resources/libCGATS.A.dylib
0x91404000 - 0x9142afff com.apple.SystemConfiguration
1.8.6 /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration
0x9143c000 - 0x91443fff libbsm.dylib /usr/lib/libbsm.dylib
0x91447000 - 0x914c0fff com.apple.audio.CoreAudio
3.0.4 /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio
0x9150e000 - 0x9150efff com.apple.ApplicationServices 10.4
(???) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices
0x91510000 - 0x9153bfff com.apple.AE 314
(313) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE
0x9165b000 - 0x916d8fff com.apple.print.framework.PrintCore 4.6
(177.13) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore
0x917d5000 - 0x91820fff com.apple.HIServices 1.5.2
(???) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices
0x9183f000 - 0x91855fff com.apple.LangAnalysis
1.6.3 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LangAnalysis.framework/Versions/A/LangAnalysis
0x91861000 - 0x9187bfff com.apple.FindByContent
1.5 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/FindByContent.framework/Versions/A/FindByContent
0x918d1000 - 0x91a70fff com.apple.security 4.5.2
(29774) /System/Library/Frameworks/Security.framework/Versions/A/Security
0x91b84000 - 0x91bc1fff com.apple.LaunchServices
182 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices
0x91bd9000 - 0x91ecefff com.apple.HIToolbox 1.4.9
(???) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox
0x92a4a000 - 0x92b28fff libxml2.2.dylib
/usr/lib/libxml2.2.dylib
0x92b45000 - 0x92c32fff libiconv.2.dylib
/usr/lib/libiconv.2.dylib
0x92ccf000 - 0x92ccffff com.apple.Carbon 10.4
(???) /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon
0x92cd1000 - 0x92ce1fff com.apple.ImageCapture
3.0.4 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/ImageCapture.framework/Versions/A/ImageCapture
0x92cfd000 - 0x92d02fff com.apple.securityhi 2.0.1
(24742) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SecurityHI.framework/Versions/A/SecurityHI
0x92d08000 - 0x92d99fff com.apple.ink.framework 101.2.1
(71) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Ink.framework/Versions/A/Ink
0x92dad000 - 0x92db0fff com.apple.help 1.0.3
(32.1) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Help.framework/Versions/A/Help
0x92db3000 - 0x92dd0fff com.apple.openscripting 1.2.5
(???) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/OpenScripting.framework/Versions/A/OpenScripting
0x92de0000 - 0x92de6fff com.apple.print.framework.Print 5.1
(192.3) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Print.framework/Versions/A/Print
0x92dec000 - 0x92e4ffff com.apple.htmlrendering 66.1
(1.1.3) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HTMLRendering.framework/Versions/A/HTMLRendering
0x92e73000 - 0x92eb4fff com.apple.NavigationServices 3.4.4
(3.4.3) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/NavigationServices.framework/Versions/A/NavigationServices
0x92edb000 - 0x92ee8fff com.apple.audio.SoundManager
3.9.1 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CarbonSound.framework/Versions/A/CarbonSound
0x92eef000 - 0x92ef4fff com.apple.CommonPanels 1.2.3
(73) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CommonPanels.framework/Versions/A/CommonPanels
0x93022000 - 0x93038fff libcups.2.dylib
/usr/lib/libcups.2.dylib
0x93e39000 - 0x94242fff libBLAS.dylib
/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
0x9441a000 - 0x947cefff libLAPACK.dylib
/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib
0x94806000 - 0x9485ffff libvMisc.dylib
/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvMisc.dylib
0x94f52000 - 0x95004fff libcrypto.0.9.7.dylib
/usr/lib/libcrypto.0.9.7.dylib
0x951e1000 - 0x951e9fff com.apple.DiskArbitration
2.1.1 /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration
0x95a5a000 - 0x95a5cfff libmathCommon.A.dylib
/usr/lib/system/libmathCommon.A.dylib
0x95a62000 - 0x95b36fff com.apple.ColorSync
4.4.9 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSync.framework/Versions/A/ColorSync
0x95c0c000 - 0x95c4afff com.apple.CFNetwork
129.20 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CFNetwork.framework/Versions/A/CFNetwork
0x95d68000 - 0x95df6fff com.apple.vImage
2.5 /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/vImage
0x95e6e000 - 0x95f44fff ATS
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS
0x96b48000 - 0x96b48fff com.apple.Accelerate.vecLib 3.3.1 (vecLib
3.3.1) /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/vecLib
0x96c67000 - 0x96ca6fff com.apple.ImageIO.framework
1.5.4 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO
0x96cbb000 - 0x96cbffff libGIF.dylib
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libGIF.dylib
0x96cc2000 - 0x96d21fff libJP2.dylib
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libJP2.dylib
0x96d35000 - 0x96d53fff libJPEG.dylib
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib
0x96e26000 - 0x96e40fff libPng.dylib
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libPng.dylib
0x96e46000 - 0x96e48fff libRadiance.dylib
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libRadiance.dylib
0x96e4b000 - 0x96ecffff libRaw.dylib
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libRaw.dylib
0x96ed4000 - 0x96f11fff libTIFF.dylib
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib
0x9ac35000 - 0x9acb3fff com.tcltk.tcllibrary 8.4.7
a /System/Library/Frameworks/Tcl.framework/Versions/8.4/Tcl
0x9accd000 - 0x9ad7cfff com.tcltk.tklibrary 8.4.7
a /System/Library/Frameworks/Tk.framework/Versions/8.4/Tk
0x9cdc8000 - 0x9ce85fff libX11.6.dylib
/usr/X11R6/lib/libX11.6.dylib
0x9d721000 - 0x9d785fff libstdc++.6.dylib
/usr/lib/libstdc++.6.dylib
0x9de5b000 - 0x9de7ffff libvDSP.dylib
/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib
0x9e132000 - 0x9e139fff libgcc_s.1.dylib
/usr/lib/libgcc_s.1.dylib
0x9e978000 - 0x9e986fff libz.1.dylib /usr/lib/libz.1.dylib
0x9f636000 - 0x9f636fff com.apple.Accelerate 1.3.1 (Accelerate
1.3.1) /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate
0x9f638000 - 0x9f644fff com.apple.speech.synthesis.framework
3.5 /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis
0x9f64b000 - 0x9f6f4fff com.apple.QD 3.10.24
(???) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD
0x9f71a000 - 0x9fb6ffff com.apple.CoreGraphics 1.258.61
(???) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics
0x9fc06000 - 0x9fc83fff com.apple.DesktopServices
1.3.6 /System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/DesktopServicesPriv
0x9fcc4000 - 0x9fef4fff com.apple.Foundation 6.4.8
(567.29) /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
Model: MacBookPro1,1, BootROM MBP11.0055.B08, 2 processors, Intel Core
Duo, 2 GHz, 2 GB
Graphics: ATI Radeon X1600, ATY,RadeonX1600, PCIe, 256 MB
Memory Module: BANK 0/DIMM0, 1 GB, DDR2 SDRAM, 667 MHz
Memory Module: BANK 1/DIMM1, 1 GB, DDR2 SDRAM, 667 MHz
AirPort: spairport_wireless_card_type_airport_extreme (0x168C, 0x86),
0.1.31.1
Bluetooth: Version 1.7.14f14, 2 service, 1 devices, 1 incoming serial
ports
Network Service: Bluetooth, PPP (PPPSerial), Bluetooth-Modem
Network Service: Built-in Ethernet, Ethernet, en0
Network Service: AirPort, AirPort, en1
Network Service: Parallels Host-Guest, Ethernet, en2
Network Service: Parallels NAT, Ethernet, en3
Serial ATA Device: Hitachi HTS541616J9SA00, 149.05 GB
Parallel ATA Device: MATSHITADVD-R UJ-857
USB Device: Built-in iSight, Micron, Up to 480 Mb/sec, 500 mA
USB Device: Apple Internal Keyboard / Trackpad, Apple Computer, Up to
12 Mb/sec, 500 mA
USB Device: IR Receiver, Apple Computer, Inc., Up to 12 Mb/sec, 500 mA
USB Device: Bluetooth HCI, Up to 12 Mb/sec, 500 mA
Kustaa Nyholm
Research Manager, Software
Research and Technology Division
PLANMECA OY
Asentajankatu 6
00880 HELSINKI
FINLAND
Please note our new telephone and fax numbers!
Tel: +358 20 7795 572 (direct)
Fax: +358 20 7795 676
GSM: +358 40 580 5193
e-mail: email@hidden
This e-mail may contain confidential or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden. We will not be liable for direct,
indirect, special or consequential damages arising from alteration of
the contents of this message by a third party or as a result of any
virus being passed for viruses.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list (email@hidden)
This email sent to email@hidden