Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: Smirftsch on December 31, 2013, 04:53:09 pm

Title: 12.11 and 13.12 on OSX 10.5.8 PPC/Intel
Post by: Smirftsch on December 31, 2013, 04:53:09 pm
I undusted recently my old G5 and tried to use 12.11 via Macports, it compiled and installed pretty flawlessly, but same issue as I had long ago, if not started within an .app there is no focus on the app, I couldn't click anything. Unfortunately I couldn't use it, because it wouldn't start up, usually hung with 100% CPU usage, already when only using compiler plugin. I found a possible fix here in the forums for the codecompletion plugin ( http://forums.codeblocks.org/index.php?topic=17238.0 ), but I didn't come that far... I also once had a working version of 12.11 (some pre) on an older hdd which crashed, so no idea what this hung already in libcompilerplugin is caused by, unfortunately gdb gave me not much to work with.


Then I noticed release of 13.12 and gave it a try.
This all may or may not depending on old 10.5, but using Macports I am able to use any gcc up to 4.8 without any trouble.
I had to do several modifications in order to make it compile in configure:
-force_load flag was set although the compiler didn't support it (none, up to gcc4.8 )
--no-undefined flag didn't work
-Wno-unused-local-typedefs didn't work on 4.8

When using gcc4.7 or 4.8 the compilation broke due to unresolved dependencies to restGPRx and 2 others like that, unfortunately didn't write them down, sorry. So in the end I used gcc4.3 for the moment.

Then in CallTip.h I had to add #include <string> to make it compile, it broke with some missing type definition for std::string otherwise:
./src/scintilla/src/CallTip.h:20: error: field 'val' has incomplete type
./src/scintilla/src/RESearch.h:46: error: field 'pat' has incomplete type

The old bug with starting from an console and no focus is partially gone, can scroll and click "x" to close the window, but can't confirm (yes/no) the question about layout (perspective) change then. Not vital anymore at least since I learned that I can start it without a problem in an .app.

Major problem is, it won't recognize any plugin now. No matter where I put them, I always get:

Scanning for plugins in /Users/smir/Library/Application Support/codeblocks/share/codeblocks/plugins
Loaded 0 plugins
Scanning for plugins in /Applications/CodeBlocks.app/Contents/Resources/share/codeblocks
Loaded 0 plugins

Not sure yet if it depends on -force_load but for any suggestions how to get more information about how to debug this I am more than grateful.

Other than that I hope that some of my information here may help others. :)

Update:
-force_load flag seems to be an issue of underlying XCode < 3.2 from what I found.

I rebuilt 13.12 now on 10.5.8 intel, same problem that no plugins can be found, so it is no PPC specific problem at least.
The prebuilt binary crashes instantly, so I can't compare, but from the content I noticed that it has .dylib files instead of the .so files I get in my compilation (although this didnt seem to cause problems in 12.11)

Update2:
alright, the extension is the problem. Symlinking the .so to .dylib makes it find and use the plugins. So only question is now, if this is intended behavior that it only digs for dylib and if so why it creates .so instead.

Update3:
It works now flawlessly (including codecompletion plugin) on intel version, but 13.12 still freezes with 100% CPU usage on PPC like 12.11 did. So this problem is the one to debug now.

Here it gets stuck it seems, trying to track down now:
#0  0x94245c4c in GetCGSConnectionID ()
#1  0x93e12478 in FlushWindowObject ()
#2  0x93e11fdc in FlushAllBuffers ()
#3  0x914f3da4 in __CFRunLoopDoObservers ()
#4  0x914f4e18 in CFRunLoopRunSpecific ()
#5  0x93e10b18 in RunCurrentEventLoopInMode ()
#6  0x93e1093c in ReceiveNextEventCommon ()
#7  0x016f2a70 in wxApp::Yield ()
#8  0x01abb05c in wxYield ()
#9  0x016e8288 in wxGUIAppTraits::WaitForChild ()
#10 0x01abd854 in wxExecute ()
#11 0x01abdc60 in wxExecute ()
#12 0x01abb604 in wxDoExecuteWithCapture ()
#13 0x00b7e100 in Compiler::EvalXMLCondition (this=0x2099800, node=0x62165c0) at compiler.cpp:1209
#14 0x00b85ee0 in Compiler::LoadDefaultOptions (this=0x2099800, name=@0x20999dc, recursion=0) at compiler.cpp:828
#15 0x00b88b54 in Compiler::Reset (this=0x2099800) at compiler.cpp:161
#16 0x06444094 in CompilerMINGW::CompilerMINGW (this=0x2099800, name=@0xbfffed54, ID=@0xbfffed50) at compilerMINGW.cpp:35
#17 0x0641d118 in CompilerGCC::DoRegisterCompilers (this=0x632d2c0) at compilergcc.cpp:851
#18 0x064336d4 in CompilerGCC::OnAttach (this=0x632d2c0) at compilergcc.cpp:360
#19 0x00b40ddc in cbPlugin::Attach (this=0x632d2c0) at cbplugin.cpp:71
#20 0x00c58898 in PluginManager::AttachPlugin (this=0x6311460, plugin=0x632d2c0, ignoreSafeMode=false) at pluginmanager.cpp:195
#21 0x00c5bd0c in PluginManager::LoadAllPlugins (this=0x6311460) at pluginmanager.cpp:1117
#22 0x00085c84 in MainFrame::ScanForPlugins (this=0x2082600) at main.cpp:1157
#23 0x000a2bf0 in MainFrame::MainFrame (this=0x2082600, parent=0x0) at main.cpp:608
#24 0x0000d6f8 in CodeBlocksApp::InitFrame (this=0x1e3dba0) at app.cpp:437
#25 0x00010454 in CodeBlocksApp::OnInit (this=0x1e3dba0) at app.cpp:661
#26 0x000123d4 in wxAppConsole::CallOnInit (this=0x1e3dba0) at app.h:76
#27 0x01a64fe4 in wxEntry ()
#28 0x0000ac98 in main (argc=1, argv=0xbffff9b8) at app.cpp:276

Update, I thought to give it a try, but when I compile against wxWidgets 3.0 I get the following error during startup:

wxWidgets Debug Alert
../src/osx/carbon/region.cpp(1016): assert "m_refData" failed in DoOffset(): invalid wxRegion

Call stack:
[00] wxWidgetCocoaImpl::drawRect(void*, NSView*, void*)
[01] wxOSX_drawRect(NSView*, objc_selector*, _NSRect)
[02] -[NSView _drawRect:clip:]              
[03] -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
[04] -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
[05] -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
[06] -[NSNextStepFrame _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
[07] -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:]
[08] -[NSWindow displayIfNeeded]            
[09] -[NSWindow _reallyDoOrderWindow:relativeTo:findKey:forCounter:force:isModal:]
[10] -[NSWindow makeKeyAndOrderFront:]      
[11] wxNonOwnedWindowCocoaImpl::Show(bool)  
[12] wxNonOwnedWindow::Show(bool)            
[13] cbSplashScreen::cbSplashScreen(wxBitmap&, long, wxWindow*, int, long)
[14] (anonymous namespace)::Splash::Splash(bool)    app.cpp:25
[15] CodeBlocksApp::OnInit()                    app.cpp:65
[16] wxApp::CallOnInit()                    
[17] wxEntry(int&, wchar_t**)                
[18] main                                       app.cpp:27
[19] start      

Unfortunately this is "fatal" again for me, since I can't click any of the buttons ^^

Update 5:
disabled splash screen for now, with the result that it starts up now finally, finds the compiler and then leaves me alone with an empty, grey window, doing nothing...
Also tried with latest SVN, same result.
Title: Re: 12.11 and 13.12 on OSX 10.5.8 PPC/Intel
Post by: Smirftsch on January 04, 2014, 09:20:54 am
oh mighty beings, gods of codeblocks, give me a hand, as I'm stuck here now and don't prove me by torturing using crappy xcode.
I know I'm an almost extinct creature, trying to use OSX10.5.8 and even worse, PPC, but poor me can't afford a newer machine like this and I will sacrifice some virgin bits and bytes if you do.
;)
Title: Re: 12.11 and 13.12 on OSX 10.5.8 PPC/Intel
Post by: stahta01 on January 04, 2014, 02:59:29 pm
Try starting without splash screen.

Code
--no-splash-screen

From http://wiki.codeblocks.org/index.php?title=Code::Blocks_command_line_arguments#Command_line_arguments (http://wiki.codeblocks.org/index.php?title=Code::Blocks_command_line_arguments#Command_line_arguments)
Title: Re: 12.11 and 13.12 on OSX 10.5.8 PPC/Intel
Post by: Smirftsch on January 04, 2014, 08:20:52 pm
as I said already @ bottom:
Update 5:
disabled splash screen for now, with the result that it starts up now finally, finds the compiler and then leaves me alone with an empty, grey window, doing nothing...
Also tried with latest SVN, same result.

That's with wxWidgets3.0, with 2.8.12 it still freezes at startup with full CPU load (gdb result in first post).
Title: Re: 12.11 and 13.12 on OSX 10.5.8 PPC/Intel
Post by: oBFusCATed on January 04, 2014, 08:37:01 pm
Can you run it from terminal and use the --debug-log and -v command line options?
Then post the log?
Title: Re: 12.11 and 13.12 on OSX 10.5.8 PPC/Intel
Post by: Smirftsch on January 04, 2014, 09:27:01 pm
2.8.12 with -v

smirs-power-mac-g5:~ smir$ codeblocks -v
Initialize EditColourSet .....
Initialize EditColourSet: done.
Loading menubar...
Abbreviations: loaded
AStylePlugin: loaded
Autosave: loaded
ClassWizard: loaded
CodeCompletion: loaded
Compiler: loaded
Debugger: loaded
FilesExtensionHandler: loaded
OccurrencesHighlighting: loaded
OpenFilesList: loaded
ProjectsImporter: loaded
ScriptedWizard: loaded
ToDoList: loaded
Abbreviations plugin activated
Source code formatter (AStyle) plugin activated
Autosave plugin activated
Class wizard plugin activated
Code completion plugin activated
Added compiler "GNU GCC Compiler"
ClassBrowser::UpdateClassBrowserView(): No active project available.
ClassBrowser::OnThreadEvent(): Updating class browser...
ClassBrowser::OnThreadEvent(): Class browser updated.

then just hangs.
once --debug-log is appended it shows nothing anymore at all.

log from wxWidgets 3.0:

codeblocks[45318:5603] *** _NSAutoreleaseNoPool(): Object 0x91475e0 of class NSCFArray autoreleased with no pool in place - just leaking
Stack: (0x911acdac 0x910d9e14 0x943224f8 0x94457968 0x94339e78 0x19a2d48 0x78f32b0 0x78f3504 0x1fb2fd0 0x1fb8e54 0x9090ff74)
2014-01-05 13:19:07.553 codeblocks[45318:5603] *** _NSAutoreleaseNoPool(): Object 0x24088f0 of class NSCFArray autoreleased with no pool in place - just leaking
Stack: (0x911acdac 0x910d9e14 0x943224f8 0x94457968 0x9148dda0 0x94339e78 0x19a2d48 0x78f32b0 0x78f3504 0x1fb2fd0 0x1fb8e54 0x9090ff74)
2014-01-05 13:19:07.555 codeblocks[45318:5603] *** _NSAutoreleaseNoPool(): Object 0x66643e0 of class NSCFArray autoreleased with no pool in place - just leaking
Stack: (0x911acdac 0x910d9e14 0x943224f8 0x94457968 0x9148dda0 0x94339e78 0x19a2d48 0x78f32b0 0x78f3504 0x1fb2fd0 0x1fb8e54 0x9090ff74)
2014-01-05 13:19:07.556 codeblocks[45318:5603] *** _NSAutoreleaseNoPool(): Object 0x9148aa0 of class NSCFArray autoreleased with no pool in place - just leaking
Stack: (0x911acdac 0x910d9e14 0x943224f8 0x94457968 0x9148dda0 0x94339e78 0x19a2d48 0x78f32b0 0x78f3504 0x1fb2fd0 0x1fb8e54 0x9090ff74)
2014-01-05 13:19:07.558 codeblocks[45318:5603] *** _NSAutoreleaseNoPool(): Object 0x9147820 of class NSCFArray autoreleased with no pool in place - just leaking
Stack: (0x911acdac 0x910d9e14 0x943224f8 0x94457968 0x94339e78 0x19a2d48 0x19a4f4c 0x1b43a68 0x1b41bec 0xb2be50 0x1b426ac 0x1b560c0 0x1b06a6c 0x78f3358 0x78f3504 0x1fb2fd0 0x1fb8e54 0x9090ff74)
2014-01-05 13:19:07.559 codeblocks[45318:5603] *** _NSAutoreleaseNoPool(): Object 0x6606c00 of class NSCFArray autoreleased with no pool in place - just leaking
Stack: (0x911acdac 0x910d9e14 0x943224f8 0x94457968 0x94339e78 0x19a2d48 0x78f3388 0x78f3504 0x1fb2fd0 0x1fb8e54 0x9090ff74)
2014-01-05 13:19:07.561 codeblocks[45318:5603] *** _NSAutoreleaseNoPool(): Object 0x9148030 of class NSCFArray autoreleased with no pool in place - just leaking
Stack: (0x911acdac 0x910d9e14 0x943224f8 0x94457968 0x9148dda0 0x94339e78 0x19a2d48 0x78f3388 0x78f3504 0x1fb2fd0 0x1fb8e54 0x9090ff74)
2014-01-05 13:19:07.562 codeblocks[45318:5603] *** _NSAutoreleaseNoPool(): Object 0x9148070 of class NSCFArray autoreleased with no pool in place - just leaking
Stack: (0x911acdac 0x910d9e14 0x943224f8 0x94457968 0x9148dda0 0x94339e78 0x19a2d48 0x78f3388 0x78f3504 0x1fb2fd0 0x1fb8e54 0x9090ff74)
2014-01-05 13:19:07.563 codeblocks[45318:5603] *** _NSAutoreleaseNoPool(): Object 0x91351c0 of class NSCFArray autoreleased with no pool in place - just leaking
Stack: (0x911acdac 0x910d9e14 0x943224f8 0x94457968 0x9148dda0 0x94339e78 0x19a2d48 0x78f3388 0x78f3504 0x1fb2fd0 0x1fb8e54 0x9090ff74)

with -v I get additionally:
15:32:08: Deleted stale lock file '/var/folders/TY/TYuPW678G54kU7uKOxVPBk+++TI/-Tmp-/Code::Blocks-smir'.
15:32:10: Invalid regular expression '(([a-zA-Z]:)?.*?):([0-9]*):([0-9]*):(middle|beg):(.*)': quantifier operand invalid
Title: Re: 12.11 and 13.12 on OSX 10.5.8 PPC/Intel
Post by: Smirftsch on January 12, 2014, 09:46:41 am
Now as report for the remaining folks out there like me, bothering with old PPC's:
I got a workaround now by using wxgtk and running 12.11 in X11 from Terminal (xterm). Starting it from OSX directly via .app or terminal causes "Fatal IO error 35 (Resource temporarily unavailable) on X server" error message. I assume its trying to start the wrong X server and not recently installed xorg.

Not only that it starts up now in maybe 1/4 of the time it needed before, it seems to run without any of the known OSX bugs also, like "Build options" selection is working and CodeCompletion plugin.

I did not try any further with 13.12 with this method for the moment as I am having finally a working instance of CodeBlocks on my G5 and it took me already quite some time to get that far, as you can see.
No idea whats the problem with running it in (Cocoa?) wxWidgets and it also seems to be at least partially due to bugs in OSX PPC version of it, but X11+GTK version of CodeBlocks is obviously worked out way better nevertheless. Maybe shouldn't even bother with this so much and recommend/use X11+GTK version by default for any OSX build, guess this could save a lot of energy and work for the CB development team.

Either way, I now have a very annoying problem and I hope to get an answer here. When starting CB now over X11, it only provides me the build targets I have for Linux and not anymore for Mac- where is this defined, can I override it somehow? It doesn't seem to identify itself anymore as Mac. Didn't find something about it in the docs or wiki.
Title: Re: 12.11 and 13.12 on OSX 10.5.8 PPC/Intel
Post by: oBFusCATed on January 12, 2014, 10:49:00 am
We check for __WXGTK__ probably, but we need to check if platform::darwin or macos is available...
Title: Re: 12.11 and 13.12 on OSX 10.5.8 PPC/Intel
Post by: mojca on May 30, 2014, 03:21:57 pm
See also http://forums.codeblocks.org/index.php/topic,18394.new.html

Some isues have already been fixed (like the missing <string>).

Create an app from wxGTK is doable and I think that it worked for me (except that the icon is bouncing forever – probably a bug in wxWidgets).

If Code::Blocks package from MacPorts could be fixed in any way to better support 10.5, please let me know. I don't have one to test.