Re: [AD] OSX fixes

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Sorry Peter, once again I’ve sent the message direct to you. >_<… Here’s the message I sent to Peter:

Sadly this doesn’t work here. I compiled Allegro with the latest changes (I think, git log doesn’t show anything… but it says I’m on the right branch and your most recent change (linked below) appears to be in the code). Then I compiled a level editor of mine (https://github.com/Nooskewl/AshEdit) as a 32 bit app. It gives me this bad selector crash dump:

2015-11-13 17:19:37.315 AshEdit[2547:95509] -[ALLEGMenuTarget menu]: unrecognized selector sent to instance 0x7af65bc0
2015-11-13 17:19:37.318 AshEdit[2547:95509] An uncaught exception was raised
2015-11-13 17:19:37.319 AshEdit[2547:95509] -[ALLEGMenuTarget menu]: unrecognized selector sent to instance 0x7af65bc0
2015-11-13 17:19:37.320 AshEdit[2547:95509] (
	0   CoreFoundation                      0x921b2c19 __raiseError + 201
	1   libobjc.A.dylib                     0x979b9f11 objc_exception_throw + 276
	2   CoreFoundation                      0x921b66c3 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
	3   CoreFoundation                      0x920a831c ___forwarding___ + 1020
	4   CoreFoundation                      0x920a7efe _CF_forwarding_prep_0 + 14
	5   AshEdit                             0x0010ada2 -[ALLEGMenuTarget insertItem:atIndex:] + 66
	6   AshEdit                             0x0010a4cd _al_insert_menu_item_at + 77
	7   AshEdit                             0x00108625 al_insert_menu_item + 485
	8   AshEdit                             0x00108338 parse_menu_info + 328
	9   AshEdit                             0x001081d3 al_build_menu + 115
	10  AshEdit                             0x000e1894 _al_mangled_main + 164
	11  AshEdit                             0x00156215 +[AllegroAppDelegate app_main:] + 37
	12  Foundation                          0x9b8d8987 -[NSThread main] + 45
	13  Foundation                          0x9b8d8712 __NSThread__start__ + 1550
	14  libsystem_pthread.dylib             0x9935d794 _pthread_body + 138
	15  libsystem_pthread.dylib             0x9935d70a _pthread_body + 0
	16  libsystem_pthread.dylib             0x9935afa6 thread_start + 34
)
2015-11-13 17:19:37.321 AshEdit[2547:95509] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[ALLEGMenuTarget menu]: unrecognized selector sent to instance 0x7af65bc0'
*** Call stack at first throw:
(
	0   CoreFoundation                      0x921b2c19 __raiseError + 201
	1   libobjc.A.dylib                     0x979b9f11 objc_exception_throw + 276
	2   CoreFoundation                      0x921b66c3 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
	3   CoreFoundation                      0x920a831c ___forwarding___ + 1020
	4   CoreFoundation                      0x920a7efe _CF_forwarding_prep_0 + 14
	5   AshEdit                             0x0010ada2 -[ALLEGMenuTarget insertItem:atIndex:] + 66
	6   AshEdit                             0x0010a4cd _al_insert_menu_item_at + 77
	7   AshEdit                             0x00108625 al_insert_menu_item + 485
	8   AshEdit                             0x00108338 parse_menu_info + 328
	9   AshEdit                             0x001081d3 al_build_menu + 115
	10  AshEdit                             0x000e1894 _al_mangled_main + 164
	11  AshEdit                             0x00156215 +[AllegroAppDelegate app_main:] + 37
	12  Foundation                          0x9b8d8987 -[NSThread main] + 45
	13  Foundation                          0x9b8d8712 __NSThread__start__ + 1550
	14  libsystem_pthread.dylib             0x9935d794 _pthread_body + 138
	15  libsystem_pthread.dylib             0x9935d70a _pthread_body + 0
	16  libsystem_pthread.dylib             0x9935afa6 thread_start + 34
)
Trace/BPT trap: 5

Though I’m not sure why insertItem is a bad selector, perhaps that object is not of the right type? I’m not really sure, Objective C isn’t my strong point but if you need me to I can investigate further.

> On Nov 12, 2015, at 10:18 AM, Peter Hull <peterhull90@xxxxxxxxxx> wrote:
> 
> Was just a straightforward one-liner,
> https://github.com/peterhull90/allegro5/commit/1b775c0ca6081bb822780d3d0135c519f4f7d5e5
> I think if you re-run the pull command that Elias suggested, it will include this latest commit and you can retest.
> Pete
> 
> On Thu, 12 Nov 2015 at 09:09 Peter Hull <peterhull90@xxxxxxxxxx> wrote:
> Hi Trent,
> Thanks for taking the time to check this out. It seems that the Obj-C runtime for i386 and x64 is different, and the former requires the instance variables for each class to be declared in the interface. For x64 it's enough to use the @property modifier and the variable is synthesized automatically (this is the origin of  _menu). See here for discussion:
> http://stackoverflow.com/questions/12015307/properties-vs-instance-variables
> Always a new thing to learn, eh? Anyway it should be a straightforward patch to go back to using the 'old' way, I'll get on it today.
> 
> To whoever is in charge of Travis - should the script be modified to add a 32-bit build for OS X?
> 
> Pete
> 
> On Thu, 12 Nov 2015 at 01:55 Trent Gamblin <trent@xxxxxxxxxx> wrote:
> Ok, the instructions worked fine.
> 
> So at first I built your patch, Peter, for x86_64 only and that worked fine. Then I noticed it wasn’t built for i386 and when I built that way I ran into a little problem.
> 
> /Users/trent/code/allegro/addons/native_dialog/osx_dialog.m:544:15: error: 'ALLEGMenuTarget' does not have a member named '_menu'; did you mean 'amenu'?
>         self->_menu = [[NSMenu alloc] init];
>               ^~~~~
>               amenu
> /Users/trent/code/allegro/addons/native_dialog/osx_dialog.m:370:19: note: 'amenu' declared here
>     ALLEGRO_MENU* amenu;
>                   ^
> /Users/trent/code/allegro/addons/native_dialog/osx_dialog.m:567:12: error: 'ALLEGMenuTarget' does not have a member named '_menu'; did you mean 'amenu'?
>     [self->_menu release];
>            ^~~~~
>            amenu
> /Users/trent/code/allegro/addons/native_dialog/osx_dialog.m:370:19: note: 'amenu' declared here
>     ALLEGRO_MENU* amenu;
> 
> 
> Those two lines do not compile here. I’m building with the 10.11 SDK and deployment target set to 10.6. It suggested changing _menu to amenu but that doesn’t look correct? Maybe you know how to fix this?
> 
> Besides that (which I got around by just accepting the “amenu” substitution), I didn’t experience any problems while testing a game with the patch. It launched up fine, switched between fullscreen window and windowed fine and input worked fine.
> 
> > On Nov 11, 2015, at 6:21 PM, Elias Pschernig <elias@xxxxxxxxxx> wrote:
> >
> > Since you are a project member you can click on the "view command line instructions" next to the Merge button. But basically it's:
> >
> > git pull --rebase git://github.com/peterhull90/allegro5.git osx-fixes
> >
> > Then you will have his commits at the very top of the git history with "git log". (The github instructions actually keep the timeline and do a merge, but I find that more confusing.)
> >
> > To delete all the changes again just do:
> >
> > git checkout .
> >
> > And you will be back at the Allegro5 master.
> >
> >
> > On Wed, Nov 11, 2015 at 8:10 PM, Trent Gamblin <trent@xxxxxxxxxx> wrote:
> > I have not yet understood how to test these pull requests without lots of messing with my checkout. What’s the easiest way?
> >
> >
> >
> > From: Allegro-developers [mailto:allegro-developers-bounces@xxxxxxxxxx] On Behalf Of Peter Hull
> > Sent: November 10, 2015 1:59 PM
> > To: allegro-developers@xxxxxxxxxx
> > Subject: [AD] OSX fixes
> >
> >
> >
> > Hi all,
> >
> > I've put in a pull request relating to some general fixes for OS X to make it work on 10.11.
> > https://github.com/liballeg/allegro5/pull/522
> >
> > Hopefully the CI build will pass. Sorry it's a whole string of commits but I couldn't get them to apply separately (git skills insufficient) - let me know if there's a better way.
> >
> > Pete
> >
> >
> > _______________________________________________
> > Allegro-developers mailing list
> > Allegro-developers@xxxxxxxxxx
> > https://mail.gna.org/listinfo/allegro-developers
> >
> >
> > _______________________________________________
> > Allegro-developers mailing list
> > Allegro-developers@xxxxxxxxxx
> > https://mail.gna.org/listinfo/allegro-developers
> 
> 
> _______________________________________________
> Allegro-developers mailing list
> Allegro-developers@xxxxxxxxxx
> https://mail.gna.org/listinfo/allegro-developers





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/