64-bit build


#1

I just finished removing the last remnants of carbon code, and managed to do a mac 32/64 bit universal build. Haven’t got a 64-bit mac to try it on though! If anyone’s interesting in 64-bit stuff, would love to hear whether you can also get it working!


#2

I have a pretty nice MacPro with Leopard - would that be running in 64-bit?

In which case, I’d be happy to try stuff.

Bruce


#3

Just get the tip and try the demo enough? I’m not really set up to compile the audio stuff.

Bruce


#4

Yeah, you’d have to change the build settings to make it do a 64-bit build, but that’s it really.


#5

Some feedback.
The current tip do not build in x86_64 and ppc64
the error is in juce_setKioskComponent
so obviously the comment here is kinda wrong.

the following technote
http://developer.apple.com/technotes/tn2002/tn2062.html
tell us to simply remove the Quit and Hide menu items from the program.

If I remove the content of this function, it builds fine.

Now Juce Demo
I set universal 64bits build and remove carbon from the frameworks.
(What about removing carbon from the frameworks by default)
I have to remove the setKioskComponent content in the amalgated version too.
otherwise it won’t build.
It now build and links fine(even if it takes a looooott of time to link)
minor linking warning though
ld warning: in /System/Library/Frameworks//QuickTime.framework/QuickTime, missing required architecture ppc64 in file

The ppc64 is kinda dead anyway, so no big deal.

If I launch the x86_64 version, it crashes
if I force the opening in 32 bits, it works fine.
I’m unable to debug it as xcode launch the 32 bits version
(if there is a way let me know)

Testing are done on 10.5.6 with xcode 3.1.2

Thread 0 Crashed:
0 …awmaterialsoftware.jucedemo 0x000000010012b7e3 juce::String::createInternal(int) + 105 (juce_amalgamated.cpp:9823)
1 …awmaterialsoftware.jucedemo 0x000000010012e90e juce::String::String(char const*, int) + 82
2 …awmaterialsoftware.jucedemo 0x000000010012e982 juce::SystemStats::getCpuVendor() + 44 (juce_amalgamated.cpp:264028)
3 …awmaterialsoftware.jucedemo 0x000000010001f86d JUCEDemoApplication::collectSomeSystemInfo() + 233 (ApplicationStartup.cpp:132)
4 …awmaterialsoftware.jucedemo 0x000000010001febb JUCEDemoApplication::initialise(juce::String const&) + 161 (ApplicationStartup.cpp:76)
5 …awmaterialsoftware.jucedemo 0x00000001001aaf51 juce::JUCEApplication::main(juce::String&, juce::JUCEApplication*) + 459 (juce_amalgamated.cpp:15652)
6 …awmaterialsoftware.jucedemo 0x00000001001ab3ba juce::JUCEApplication::main(int, char**, juce::JUCEApplication*) + 190 (juce_amalgamated.cpp:15742)
7 …awmaterialsoftware.jucedemo 0x000000010001f593 main + 93 (ApplicationStartup.cpp:176)
8 …awmaterialsoftware.jucedemo 0x0000000100002028 start + 52

Here is my config
Model: MacBookPro2,1, BootROM MBP21.00A5.B08, 2 processors, Intel Core 2 Duo, 2.33 GHz, 3 GB
Graphics: kHW_ATIr520Item, ATY,RadeonX1600, spdisplays_pcie_device, 256 MB
Memory Module: BANK 0/DIMM0, 2 GB, DDR2 SDRAM, 667 MHz
Memory Module: BANK 1/DIMM1, 1 GB, DDR2 SDRAM, 667 MHz
AirPort: spairport_wireless_card_type_airport_extreme (0x168C, 0x87), 1.4.8.0
Bluetooth: Version 2.1.3f8, 2 service, 1 devices, 1 incoming serial ports
Network Service: Ethernet, Ethernet, en0
Serial ATA Device: TOSHIBA MK2035GSS, 186.31 GB
Parallel ATA Device: MATSHITADVD-R UJ-85J
USB Device: Built-in iSight, (null) mA
USB Device: IR Receiver, (null) mA
USB Device: Bluetooth USB Host Controller, (null) mA
USB Device: Apple Optical USB Mouse, (null) mA
USB Device: Apple Internal Keyboard / Trackpad, (null) mA


#6

I figured how to launch the 64bits in xcode, so I am able to debug it now.
Still I’m puzzled.

it crashes in

[code]void String::createInternal (const int numChars) throw()
{
jassert (numChars > 0);

text = (InternalRefCountedStringHolder*) juce_malloc (sizeof (InternalRefCountedStringHolder)
                                                       + numChars * sizeof (tchar));
text->refCount = 1;
text->allocatedNumChars = numChars;
text->text[0] = 0;

}[/code]

on the 2nd line. (the malloc)

numChars is equals to 12
hard to say, but it looks like to be related to InternalRefCountedStringHolder
Unfortunately xcode is not very helpful(as usual?)

Want me to try some stuff ?


#7

Well, I guess I need to get myself a new mac.

Though I did mange to build it as a 64-bit target, including the kiosk stuff, and can’t think why it’d be different for you.

Very peculiar about the malloc crashing, I really need to get my hands on it and do some debugging.


#8

FWIW, if you thought to get an iMac maybe wait a bit there is some rumors new ones will come shortly.


#9

OK. Here’s my attempt. Using SVN 689, clean build.

Built the demo (debug) as 32/64 bit Universal as OS 10.5 only. No errors, only 8 warnings (2 x 4, both unused variables in the demo).

Ran in the debugger on my MacBook Pro - everything works.

Tried to run from the finder, long hold, then crash (report below).

Told finder to run as 32-bit, that runs fine.

Moved app to Xeon MacPro, same issue.

Going back to the Macbook, I found how to enable 64-bit debugging (Project > Set Active Architecture) and hit the debugger where otristan did with an EXEC_BAD_ACCESS.

So, I did some testing, and it seems that the value being provided to malloc made sense. Since on Mac, juce_malloc just macros to malloc, that didn’t seem likely (although you might want to look - there’s some 'int’s in those macros in some platforms, AFAICT.

Started to look at the return value then - it is the cast that causes the error, not the malloc, as far as I can tell. This looked good: http://www.belle-aurore.com/mike/more.php?id=A466_0_1_0_M
but when I added #include <stdlib.h> it didn’t help, plus the pointer appeared to have at least 33 bits.

So, with this code:size_t bytesNeeded = sizeof (InternalRefCountedStringHolder) + (numChars * sizeof (tchar)); void* allocatedMem = juce_malloc (bytesNeeded); text = (InternalRefCountedStringHolder*) allocatedMem;

bytesNeeded is 60, allocatedMem is 0x103727850, and the cast or assignment throws the signal.

Bruce

[code]Process: jucedemo [44400]
Path: /Juce_Folder/juce/extras/juce demo/build/macosx/build/Debug/jucedemo.app/Contents/MacOS/jucedemo
Identifier: com.rawmaterialsoftware.jucedemo
Version: ??? (1.0)
Code Type: X86-64 (Native)
Parent Process: launchd [313]

Date/Time: 2009-02-11 14:19:52.972 -0800
OS Version: Mac OS X 10.5.6 (9G55)
Report Version: 6

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x000000005fbff6a0
Crashed Thread: 0

Thread 0 Crashed:
0 …awmaterialsoftware.jucedemo 0x000000010012c4ef juce::String::createInternal(int) + 105 (juce_amalgamated.cpp:9823)
1 …awmaterialsoftware.jucedemo 0x000000010012f61a juce::String::String(char const*, int) + 82
2 …awmaterialsoftware.jucedemo 0x000000010012f68e juce::SystemStats::getCpuVendor() + 44 (juce_amalgamated.cpp:264028)
3 …awmaterialsoftware.jucedemo 0x0000000100020591 JUCEDemoApplication::collectSomeSystemInfo() + 233 (ApplicationStartup.cpp:132)
4 …awmaterialsoftware.jucedemo 0x0000000100020bdf JUCEDemoApplication::initialise(juce::String const&) + 161 (ApplicationStartup.cpp:76)
5 …awmaterialsoftware.jucedemo 0x00000001001abd03 juce::JUCEApplication::main(juce::String&, juce::JUCEApplication*) + 459 (juce_amalgamated.cpp:15652)
6 …awmaterialsoftware.jucedemo 0x00000001001ac16c juce::JUCEApplication::main(int, char**, juce::JUCEApplication*) + 190 (juce_amalgamated.cpp:15742)
7 …awmaterialsoftware.jucedemo 0x00000001000202b7 main + 93 (ApplicationStartup.cpp:176)
8 …awmaterialsoftware.jucedemo 0x0000000100001dc4 start + 52

Thread 0 crashed with X86 Thread State (64-bit):
rax: 0x000000005fbff6a0 rbx: 0x000000005fbff6a0 rcx: 0x0000000000000001 rdx: 0x0000000101b3ae40
rdi: 0x0000000101a83070 rsi: 0x000000000000003c rbp: 0x00007fff5fbff550 rsp: 0x00007fff5fbff530
r8: 0x0000000101a83070 r9: 0x0000000000000000 r10: 0x000000000000002c r11: 0x00007fff5fbff570
r12: 0x0000000000000000 r13: 0x0000000000000000 r14: 0x0000000000000000 r15: 0x0000000000000000
rip: 0x000000010012c4ef rfl: 0x0000000000010206 cr2: 0x000000005fbff6a0
[/code]

[code]Process: jucedemo [44450]
Path: /Juce_Folder/juce/extras/juce demo/build/macosx/build/Debug/jucedemo.app/Contents/MacOS/jucedemo
Identifier: com.rawmaterialsoftware.jucedemo
Version: ??? (1.0)
Code Type: X86-64 (Native)
Parent Process: launchd [313]

Date/Time: 2009-02-11 14:29:30.731 -0800
OS Version: Mac OS X 10.5.6 (9G55)
Report Version: 6

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x000000005fbff6a0
Crashed Thread: 0

Thread 0 Crashed:
0 …awmaterialsoftware.jucedemo 0x000000010012c4ef juce::String::createInternal(int) + 105 (juce_amalgamated.cpp:9823)
1 …awmaterialsoftware.jucedemo 0x000000010012f61a juce::String::String(char const*, int) + 82
2 …awmaterialsoftware.jucedemo 0x000000010012f68e juce::SystemStats::getCpuVendor() + 44 (juce_amalgamated.cpp:264028)
3 …awmaterialsoftware.jucedemo 0x0000000100020591 JUCEDemoApplication::collectSomeSystemInfo() + 233 (ApplicationStartup.cpp:132)
4 …awmaterialsoftware.jucedemo 0x0000000100020bdf JUCEDemoApplication::initialise(juce::String const&) + 161 (ApplicationStartup.cpp:76)
5 …awmaterialsoftware.jucedemo 0x00000001001abd03 juce::JUCEApplication::main(juce::String&, juce::JUCEApplication*) + 459 (juce_amalgamated.cpp:15652)
6 …awmaterialsoftware.jucedemo 0x00000001001ac16c juce::JUCEApplication::main(int, char**, juce::JUCEApplication*) + 190 (juce_amalgamated.cpp:15742)
7 …awmaterialsoftware.jucedemo 0x00000001000202b7 main + 93 (ApplicationStartup.cpp:176)
8 …awmaterialsoftware.jucedemo 0x0000000100001dc4 start + 52

Thread 0 crashed with X86 Thread State (64-bit):
rax: 0x000000005fbff6a0 rbx: 0x000000005fbff6a0 rcx: 0x0000000000000001 rdx: 0x0000000101b3b070
rdi: 0x0000000101a83070 rsi: 0x000000000000003c rbp: 0x00007fff5fbff550 rsp: 0x00007fff5fbff530
r8: 0x0000000101a83070 r9: 0x0000000000000000 r10: 0x000000000000002c r11: 0x00007fff5fbff570
r12: 0x0000000000000000 r13: 0x0000000000000000 r14: 0x0000000000000000 r15: 0x0000000000000000
rip: 0x000000010012c4ef rfl: 0x0000000000010206 cr2: 0x000000005fbff6a0

Binary Images:
0x100000000 - 0x100363fe4 +com.rawmaterialsoftware.jucedemo ??? (1.0) <104b809e6dcce7a3dfb06c3d8a6ab9e4> /Juce_Folder/juce/extras/juce demo/build/macosx/build/Debug/jucedemo.app/Contents/MacOS/jucedemo
0x1007ed000 - 0x10080afff com.apple.audio.midi.CoreMIDI 1.6.1 (42) /System/Library/Frameworks/CoreMIDI.framework/Versions/A/CoreMIDI
0x100820000 - 0x1008ebfe5 com.apple.DiscRecording 4.0.3 (4030.4.3) <225d6fc00e93c603b4ae24ffea9c0df1> /System/Library/Frameworks/DiscRecording.framework/Versions/A/[/code][/url]


#10

Likewise, adding
#include <sys/malloc.h>
didn’t help, sorry.

Bruce


#11

[quote=“Bruce Wheaton”]OK. Here’s my attempt. Using SVN 689, clean build.

Built the demo (debug) as 32/64 bit Universal as OS 10.5 only. No errors, only 8 warnings (2 x 4, both unused variables in the demo).

[/quote]

I guess I had errors because I removed the Carbon Framework, looks like there is maybe some Carbon bits that has been ported to 64bits just not the UI part.

juce_setKioskComponent build in 64bits thanks to the Carbon framework… Still it’s maybe thanks to weak linking with Framework.
You would have to test kiosk mode in 64bits to be sure.