snow leopard, gcc 4.2.1, mysql gem 2.8.1 mysql.c: In function ‘stmt_init’: mysql.c:878: error: expected identifier or ‘(’ before numeric constant mysql.c:883: error: lvalue required as unary ‘&’ operand Does this look familiar to anyone? --- http://twitter.com/wagerlabs
mysql-gem does not install with mysql-5.1.47 because ext/mysql_api/mysql.c:878 has this code: my_bool true = 1; Unfortunately, 'true' is defined as 1 so you end up with my_bool 1 = 1; which is an error. I fixed the issue in my local mysql-gem directory but for the life of me can't figure out how to make that into a proper gem and install it. Help! Thanks, Joel --- http://twitter.com/wagerlabs
Hi Joel, Indeed, we noticed that problem too. The plan for 0.7 is to clean out our public headers so that the true symbol is no longer pre-defined. Feel free to file a ticket if you want to track that issue. In the meantime I'm afraid you will have to change the code manually, as you already did... Laurent On May 22, 2010, at 6:48 PM, Joel Reymont wrote:
mysql-gem does not install with mysql-5.1.47 because ext/mysql_api/mysql.c:878 has this code:
my_bool true = 1;
Unfortunately, 'true' is defined as 1 so you end up with
my_bool 1 = 1;
which is an error.
I fixed the issue in my local mysql-gem directory but for the life of me can't figure out how to make that into a proper gem and install it. Help!
Thanks, Joel
--- http://twitter.com/wagerlabs
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
On May 23, 2010, at 9:02 AM, Laurent Sansonetti wrote:
Feel free to file a ticket if you want to track that issue.
https://www.macruby.org/trac/ticket/728
In the meantime I'm afraid you will have to change the code manually, as you already did...
My problem is that I can't manage to install the gem with source code or rebuild it :-(. This is after I make the change to the source code. This is driving me nuts! Thanks, Joel --- http://twitter.com/wagerlabs
On May 23, 2010, at 1:10 AM, Joel Reymont wrote:
On May 23, 2010, at 9:02 AM, Laurent Sansonetti wrote:
Feel free to file a ticket if you want to track that issue.
Thanks :)
In the meantime I'm afraid you will have to change the code manually, as you already did...
My problem is that I can't manage to install the gem with source code or rebuild it :-(. This is after I make the change to the source code. This is driving me nuts!
What's happening exactly? What problem do you see? I assume there is a gemspec file in the project with a makefile or rakefile task to generate the gem. Maybe we could contact the maintainer of that gem and ask if they can rename that variable then generate a new gem. It anyway sounds a bad idea to use true as a variable name, since it's a macro in C99 (it's even surprising that they never got any problem with that...). Laurent
On May 23, 2010, at 9:19 AM, Laurent Sansonetti wrote:
What's happening exactly? What problem do you see? I assume there is a gemspec file in the project with a makefile or rakefile task to generate the gem.
The problem was due to a missing ~/.rubyforge/user-config.yml which 'rubyforge setup' creates. Found out by dtrace-ing calls to 'open'. --- http://twitter.com/wagerlabs
I was able to advance with the mysql gem but somehow '-arch i386' is making its way into my build pipeline, despite building for x86_64. extconf.rb seems to store the wrong flags into the Makefile. Any suggestions how to fix this? Thanks, Joel --- biggie:mysql-gem joelr$ ARCHFLAGS="-arch x86_64" macrake ARCHFLAGS="-arch x86_64" (in /Users/joelr/Work/ruby/mysql-gem) rake-compiler must be configured first to enable cross-compilation rake-compiler must be configured first to enable cross-compilation mkdir -p tmp/universal-darwin10.0/mysql_api/1.9.0 cd tmp/universal-darwin10.0/mysql_api/1.9.0 /Library/Frameworks/MacRuby.framework/Versions/0.6/usr/bin/macruby -I. ../../../../ext/mysql_api/extconf.rb checking for mysql_ssl_set()... no checking for rb_str_set_len()... yes checking for rb_thread_start_timer()... no checking for mysql.h... yes creating Makefile cd - cd tmp/universal-darwin10.0/mysql_api/1.9.0 GNU Make 3.81 Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This program built for i386-apple-darwin10.0.0 gmake /usr/bin/gcc -I. -I/Library/Frameworks/MacRuby.framework/Versions/0.6/usr/include/ruby-1.9.0/universal-darwin10.0 -I/Library/Frameworks/MacRuby.framework/Versions/0.6/usr/include/ruby-1.9.0/ruby/backward -I/Library/Frameworks/MacRuby.framework/Versions/0.6/usr/include/ruby-1.9.0 -I../../../../ext/mysql_api -DHAVE_RB_STR_SET_LEN -DHAVE_MYSQL_H -I/usr/local/mysql/include -g -Os -arch x86_64 -fno-common -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT -DDONT_DECLARE_CXA_PURE_VIRTUAL -fno-common -fexceptions -fno-common -pipe -O3 -g -Wall -Wno-parentheses -arch i386 -arch x86_64 -o mysql.o -c ../../../../ext/mysql_api/mysql.c ... /usr/bin/gcc -dynamic -bundle -undefined suppress -flat_namespace -arch i386 -arch x86_64 -o mysql_api.bundle mysql.o -L. -L/Library/Frameworks/MacRuby.framework/Versions/0.6/usr/lib -arch i386 -arch x86_64 -lmacruby -L/usr/local/mysql/lib -lmysqlclient -lz -lm -lmygcc ld: warning: in /usr/local/mysql/lib/libmysqlclient.dylib, file was built for unsupported file format which is not the architecture being linked (i386) ld: warning: in /usr/local/mysql/lib/libmygcc.a, file was built for unsupported file format which is not the architecture being linked (i386) cd - cp tmp/universal-darwin10.0/mysql_api/1.9.0/mysql_api.bundle lib/mysql_api.bundle /Library/Frameworks/MacRuby.framework/Versions/0.6/usr/bin/macruby -w -Ilib:bin:test:. -e 'require "rubygems"; require "test/unit"; require "test/test_mysql.rb"' -- unknown: warning: instance variable @post_install_hooks not initialized unknown: warning: instance variable @post_uninstall_hooks not initialized unknown: warning: instance variable @pre_uninstall_hooks not initialized unknown: warning: instance variable @pre_install_hooks not initialized unknown: warning: instance variable @suffix_pattern not initialized unknown: warning: instance variable @path not initialized unknown: warning: instance variable @home not initialized /Library/Frameworks/MacRuby.framework/Versions/0.6/usr/lib/ruby/1.9.0/test/unit/assertions.rb:31: warning: shadowing outer local variable - line Loaded suite -e Started .EEunknown: [BUG] Bus Error MacRuby version 0.6 (ruby 1.9.0) [universal-darwin10.0, x86_64] rake aborted! Command failed with status (): [/Library/Frameworks/MacRuby.framework/Vers...] macruby(94810,0x7fff703d4be0) malloc: *** error for object 0x10a4b4e78: incorrect checksum for freed object - object was probably modified after being freed. *** set a breakpoint in malloc_error_break to debug Abort trap biggie:mysql-gem joelr$ --- http://twitter.com/wagerlabs
Narrowing this down further, the issue seems to be with CFLAGS generated by mkmf, e.g. macirb require 'mkmf' create_makefile 'test' This puts both '-arch i386' and '-arch x86_64' into CFLAGS. Any suggestions on how to control the architectures that mkmf puts in CFLAGS? ARCHFLAGS="-arch x86_64" macirb <- doesn't do it, for example. Thanks, Joel --- http://twitter.com/wagerlabs
Finally, I was able to narrow it down to a bug in macruby. I had to edit rbconfig.rb to remove "-arch i386" from ARCH_FLAG, leaving it with just "-arch x86_64" which works for me. Then I had to remove the compiled rbconfig.rbo. All of the above leaves me with the bus error below. How do I debug it? Thanks, Joel --- biggie:mysql-gem joelr$ macrake (in /Users/joelr/work/ruby/mysql-gem) rake-compiler must be configured first to enable cross-compilation mkdir -p tmp/universal-darwin10.0/mysql_api/1.9.0 cd tmp/universal-darwin10.0/mysql_api/1.9.0 /Library/Frameworks/MacRuby.framework/Versions/0.6/usr/bin/macruby -I. ../../../../ext/mysql_api/extconf.rb checking for mysql_ssl_set()... yes checking for rb_str_set_len()... yes checking for rb_thread_start_timer()... no checking for mysql.h... yes creating Makefile cd - cd tmp/universal-darwin10.0/mysql_api/1.9.0 GNU Make 3.81 Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This program built for i386-apple-darwin10.0.0 gmake /usr/bin/gcc -I. -I/Library/Frameworks/MacRuby.framework/Versions/0.6/usr/include/ruby-1.9.0/universal-darwin10.0 -I/Library/Frameworks/MacRuby.framework/Versions/0.6/usr/include/ruby-1.9.0/ruby/backward -I/Library/Frameworks/MacRuby.framework/Versions/0.6/usr/include/ruby-1.9.0 -I../../../../ext/mysql_api -DHAVE_MYSQL_SSL_SET -DHAVE_RB_STR_SET_LEN -DHAVE_MYSQL_H -I/usr/local/mysql/include -g -Os -arch x86_64 -fno-common -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT -DDONT_DECLARE_CXA_PURE_VIRTUAL -fno-common -fexceptions -fno-common -pipe -O3 -g -Wall -Wno-parentheses -arch x86_64 -o mysql.o -c /usr/bin/gcc -dynamic -bundle -undefined suppress -flat_namespace -arch x86_64 -o mysql_api.bundle mysql.o -L. -L/Library/Frameworks/MacRuby.framework/Versions/0.6/usr/lib -arch x86_64 -lmacruby -L/usr/local/mysql/lib -lmysqlclient -lz -lm -lmygcc cd - cp tmp/universal-darwin10.0/mysql_api/1.9.0/mysql_api.bundle lib/mysql_api.bundle /Library/Frameworks/MacRuby.framework/Versions/0.6/usr/bin/macruby -w -Ilib:bin:test:. -e 'require "rubygems"; require "test/unit"; require "test/test_mysql.rb"' -- unknown: warning: instance variable @post_install_hooks not initialized unknown: warning: instance variable @post_uninstall_hooks not initialized unknown: warning: instance variable @pre_uninstall_hooks not initialized unknown: warning: instance variable @pre_install_hooks not initialized unknown: warning: instance variable @suffix_pattern not initialized unknown: warning: instance variable @path not initialized unknown: warning: instance variable @home not initialized /Library/Frameworks/MacRuby.framework/Versions/0.6/usr/lib/ruby/1.9.0/test/unit/assertions.rb:31: warning: shadowing outer local variable - line Loaded suite -e Started .EEunknown: [BUG] Bus Error MacRuby version 0.6 (ruby 1.9.0) [universal-darwin10.0, x86_64] rake aborted! Command failed with status (): [/Library/Frameworks/MacRuby.framework/Vers...] (See full trace by running task with --trace) --- http://twitter.com/wagerlabs
Hi Joel! On May 23, 2010, at 12:01 PM, Joel Reymont wrote:
Finally, I was able to narrow it down to a bug in macruby.
I had to edit rbconfig.rb to remove "-arch i386" from ARCH_FLAG, leaving it with just "-arch x86_64" which works for me. Then I had to remove the compiled rbconfig.rbo.
I see. Indeed, it looks like our rbconfig.rb file does not honor the ARCH_FLAG environment variable, as it should! Could you file a ticket for this?
All of the above leaves me with the bus error below. How do I debug it?
Do you have a gdb backtrace or a crash log handy? Laurent
On May 23, 2010, at 8:37 PM, Laurent Sansonetti wrote:
Do you have a gdb backtrace or a crash log handy?
I don't know how to get one. I am just installing llvm and preparing to build macruby from source. --- http://twitter.com/wagerlabs
On May 23, 2010, at 12:38 PM, Joel Reymont wrote:
On May 23, 2010, at 8:37 PM, Laurent Sansonetti wrote:
Do you have a gdb backtrace or a crash log handy?
I don't know how to get one. I am just installing llvm and preparing to build macruby from source.
Every time a program crashes, a crash log file is generated in ~/Library/Logs/CrashReporter (look for a macruby file there with the appropriate time stamp). Otherwise, since the crashing line seems to be /Library/Frameworks/MacRuby.framework/Versions/0.6/usr/bin/macruby -w -Ilib:bin:test:. -e 'require "rubygems"; require "test/unit"; require "test/test_mysql.rb"' -- You can try gdb --args /Library/Frameworks/MacRuby.framework/Versions/0.6/usr/bin/macruby -w ... Then inside gdb, hit 'r', then when it crashes, type 'thread apply all bt'. A good thing to do in order to know if it's a GC problem is to set the GC_DISABLE environment variable to something and try again. 'set env GC_DISABLE 1' then 'r' again. If you can attach that information to a new ticket I will have a look Monday. Also, I would try if normal mysql-ruby scripts are working too. Maybe the test suite is doing a corner-case thing. Laurent
On May 23, 2010, at 8:45 PM, Laurent Sansonetti wrote:
Every time a program crashes, a crash log file is generated in ~/Library/Logs/CrashReporter (look for a macruby file there with the appropriate time stamp).
It's crashing in rb_vm_dispatch, e.g. http://gist.github.com/411199 --- http://twitter.com/wagerlabs
It looks like rb_vm_dispatch is going into an infinite loop... What is the test_mysql.rb file that you are running? Also, with the exact same procedure, in lieu of doing "thread apply all bt", could you try: p (char *)sel This is hoping the variable is not optimized away... -- Thibault Martin-Lagardette On May 23, 2010, at 12:50, Joel Reymont wrote:
On May 23, 2010, at 8:45 PM, Laurent Sansonetti wrote:
Every time a program crashes, a crash log file is generated in ~/Library/Logs/CrashReporter (look for a macruby file there with the appropriate time stamp).
It's crashing in rb_vm_dispatch, e.g.
--- http://twitter.com/wagerlabs
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
On May 24, 2010, at 8:35 PM, Thibault Martin-Lagardette wrote:
What is the test_mysql.rb file that you are running?
I don't think I'm doing any thread application or running test_mysql.rb at all. I'm just running macrake in the mysql gem directory. --- http://twitter.com/wagerlabs
On May 23, 2010, at 9:02 AM, Laurent Sansonetti wrote:
In the meantime I'm afraid you will have to change the code manually, as you already did...
I can't manage to do this: http://pastie.org/973144 Thanks, Joel --- http://twitter.com/wagerlabs
participants (3)
-
Joel Reymont
-
Laurent Sansonetti
-
Thibault Martin-Lagardette