Opened 9 years ago

Closed 9 years ago

#49515 closed defect (fixed)

glib2: error: array subscript is not an integer

Reported by: j.bugzilla2@… Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.3.4
Keywords: mavericks Cc: dony@…
Port: glib2

Description

With several packages installed and in regular use on my OSX 10.9.5 machine, I upgraded MacPorts to 2.3.4 and attempted to upgrade all outdated ports. Most installed using binary archives or compiled as they always have. One triggered an upgrade of glib2. The attached file shows the specific errors. It was generated by a clean/upgrade pair.

The obviously interesting part of the log is excerpted here:

:info:build gcocoanotificationbackend.c:115:52: error: array subscript is not an integer
:info:build       const char *action = [[notification userInfo][@"default"] UTF8String];
:info:build                                                    ^~~~~~~~~~~
:info:build gcocoanotificationbackend.c:122:52: error: array subscript is not an integer
:info:build       const char *action = [[notification userInfo][@"button0"] UTF8String];
:info:build                                                    ^~~~~~~~~~~
:info:build gcocoanotificationbackend.c:161:16: error: array subscript is not an integer
:info:build       user_info[@"default"] = action_name;
:info:build                ^~~~~~~~~~~
:info:build gcocoanotificationbackend.c:181:20: error: array subscript is not an integer
:info:build           user_info[@"button0"] = action_name;
:info:build                    ^~~~~~~~~~~
:info:build 4 errors generated.

Attachments (1)

main.log (428.0 KB) - added by j.bugzilla2@… 9 years ago.

Download all attachments as: .zip

Change History (15)

Changed 9 years ago by j.bugzilla2@…

Attachment: main.log added

comment:1 Changed 9 years ago by mf2k (Frank Schima)

Keywords: mav removed
Owner: changed from macports-tickets@… to ryandesign@…

In the future, please Cc the port maintainers (port info --maintainers glib2), if any.

comment:2 in reply to:  description Changed 9 years ago by dony@…

Replying to j.bugzilla2@…:

With several packages installed and in regular use on my OSX 10.9.5 machine, I upgraded MacPorts to 2.3.4 and attempted to upgrade all outdated ports. Most installed using binary archives or compiled as they always have. One triggered an upgrade of glib2. The attached file shows the specific errors. It was generated by a clean/upgrade pair.

Just to say I have got exactly the same, also with OXS 10.9.5, trying to install a soft using glib2.
I also need help on this.
Thanks in advance.
Christophe

CHD-HD4$ sudo port install auto-multiple-choice
Password:
--->  Computing dependencies for cairo
--->  Dependencies to be installed: glib2
--->  Building glib2
Error: org.macports.build for port glib2 returned: command execution failed
Error: Failed to install glib2
Please see the log file for port glib2 for details:
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_glib2/glib2/main.log
Error: The following dependencies were not installed: glib2
Error: Unable to upgrade port: 1
Error: Unable to execute port: upgrade poppler failed
Last edited 9 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:3 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: dony@… added
Summary: Compile error on mavericks inside cleaned portglib2: error: array subscript is not an integer

@j.bugzilla2, sorry, I missed your ticket initially. What version of Xcode do you have? I suspect it may be too old to compile this code.

@dony, it is not clear whether you are experiencing the same issue; I would need to see your main.log file.

comment:4 in reply to:  3 Changed 9 years ago by j.bugzilla2@…

Replying to ryandesign@…:

@j.bugzilla2, sorry, I missed your ticket initially. What version of Xcode do you have? I suspect it may be too old to compile this code.

I have XCode 5.0.2 installed. The MacPorts installation lists XCode 5.0.1 as the requirement. WikiPedia states I could upgrade XCode as far as 6.2.

comment:5 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Xcode 5.0.2 should be fine. Does the version of the command line tools correspond to that? What do you get if you run:

/usr/bin/clang --version

comment:6 in reply to:  5 Changed 9 years ago by j.bugzilla2@…

I have to find a source to cross reference these, but it looks like there is something screwy about my installation. (The history is fussy, as this MacPorts installation is somewhat elderly and I haven't configured it since then.)

$ /usr/bin/clang --version
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix
$ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang --version
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix
$ /Library/Developer/CommandLineTools/usr/bin/clang --version
Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix
$ xcode-select -p
/Applications/Xcode.app/Contents/Developer

comment:7 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

XcodeVersionInfo says clang-600.0.57 belongs with Xcode 6.2. Ideally, you should match your Xcode and command line tools versions, so upgrading to Xcode 6.2 would be the best solution. I don't know that this will solve the issue though; I thought clang 500 was new enough to compile this type of code.

If there's a specific reason why you need to stay on Xcode 5.0.2, then you should downgrade your command line tools to the Xcode 5.0.2 version.

comment:8 Changed 9 years ago by j.bugzilla2@…

Removing all elements of XCode and install XCode 6.2 along with matching command line tools did the trick. I am not sure if it was an inconsistent installation or the version of the tools that did it. As far as I am concerned, feel free to close this ticket. If you wish to explore more carefully exactly which version of the compiler is required, I may be able to do tests for you.

comment:9 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: invalid
Status: newclosed

@j.bugzilla2, glad you got it working. No need to bother with testing; I can do some tests myself in a bit. I think any version of Xcode designated compatible with Mavericks should work, but if it does not, I'll adjust the compiler.blacklist.

@dony, if you are not running Xcode 6.2 and the Xcode 6.2 version of the command line tools, please upgrade and then clean the glib2 port and then try again. If you still have a build failure after that, check #49151, a common glib2 build failure. If that's not it, please file a new ticket and attach your main.log file.

comment:10 Changed 9 years ago by dony@…

Hi
Seems I have exactly same bug (see log file extract below) and same software configuration (same versions of Xcode, clang, etc, all the same).
So I'll try installing Xcode 6.2 ... and ... do I need to update clang CommandLineTool? or does it come with Xcode? ... (I'm not so aware about all o f this)
I'll try and tell.
thanks for the help.
Christophe


extract of log file

:info:build /bin/sh ../libtool  --tag=CC   --mode=compile /usr/bin/clang -DHAVE_CONFIG_H -I. -I..  -I/opt/local/include -DG_LOG_DOMAIN=\"GLib-GIO\" -I.. -I../glib -I../glib -I.. -I../gmodule -DG_DISABLE_CAST_CHECKS -DGIO_COMPILATION -DGIO_MODULE_DIR=\"/opt/local/lib/gio/modules\"  -I/opt/local/include -D_REENTRANT  -fvisibility=hidden -xobjective-c -pipe -Os -fstrict-aliasing -arch x86_64 -arch i386 -c -o libgio_2_0_la-gcocoanotificationbackend.lo `test -f 'gcocoanotificationbackend.c' || echo './'`gcocoanotificationbackend.c
:info:build libtool: compile:  /usr/bin/clang -DHAVE_CONFIG_H -I. -I.. -I/opt/local/include -DG_LOG_DOMAIN=\"GLib-GIO\" -I.. -I../glib -I../glib -I.. -I../gmodule -DG_DISABLE_CAST_CHECKS -DGIO_COMPILATION -DGIO_MODULE_DIR=\"/opt/local/lib/gio/modules\" -I/opt/local/include -D_REENTRANT -fvisibility=hidden -xobjective-c -pipe -Os -fstrict-aliasing -arch x86_64 -arch i386 -c gcocoanotificationbackend.c  -fno-common -DPIC -o .libs/libgio_2_0_la-gcocoanotificationbackend.o
:info:build gcocoanotificationbackend.c:115:52: error: array subscript is not an integer
:info:build       const char *action = [[notification userInfo][@"default"] UTF8String];
:info:build ^~~~~~~~~~~
:info:build gcocoanotificationbackend.c:122:52: error: array subscript is not an integer
:info:build       const char *action = [[notification userInfo][@"button0"] UTF8String];
:info:build ^~~~~~~~~~~
:info:build gcocoanotificationbackend.c:161:16: error: array subscript is not an integer
:info:build       user_info[@"default"] = action_name;
:info:build                ^~~~~~~~~~~
:info:build gcocoanotificationbackend.c:181:20: error: array subscript is not an integer
:info:build           user_info[@"button0"] = action_name;
:info:build                    ^~~~~~~~~~~ 
Last edited 9 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:11 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Please use WikiFormatting when writing in Trac.

When you say you have the "same software configuration", you mean you have Xcode 5.0.2?

Yes, you need to update both Xcode and the command line developer tools. You might see an update for both of them in the Mac App Store's Updates section. If you don't see an update for Xcode because you previously installed Xcode manually, you can either download the Xcode update manually from the Apple developer web site or you can install it using the Mac App Store. If you don't see an update for the command line tools, you can either run "xcode-select --install" or get the installer from the Apple developer web site.

comment:12 in reply to:  11 Changed 9 years ago by dony@…

Replying to ryandesign@…:

Please use WikiFormatting when writing in Trac.

Noted !

When you say you have the "same software configuration", you mean you have Xcode 5.0.2?

yes, Version 5.0.2 (5A3005)

Yes, you need to update both Xcode and the command line developer tools. You might see an update for both of them in the Mac App Store's Updates section. If you don't see an update for Xcode because you previously installed Xcode manually, you can either download the Xcode update manually from the Apple developer web site or you can install it using the Mac App Store. If you don't see an update for the command line tools, you can either run "xcode-select --install" or get the installer from the Apple developer web site.

I'll try this, thanks a lot.
Christophe

comment:13 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Keywords: mavericks added
Resolution: invalid
Status: closedreopened

Just noticed that our buildbot builder for Mavericks also fails on this. It has Xcode 5.1.1 installed. So I'm going to guess that clang 600 or greater is required.

comment:14 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: reopenedclosed

Interestingly, the problem doesn't occur when building for x86_64 only. It only occurs when building universal for both x86_64 and i386.

I've blacklisted clang < 600 when building with gcocoanotificationbackend (i.e. on OS X 10.9 and later) in r142816.

Note: See TracTickets for help on using tickets.