arturoc / oscpack

Automatically exported from code.google.com/p/oscpack
Other
7 stars 5 forks source link

Crash on << osc::EndBundle; #7

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Compile with VST or AU plugin as non-debug with Xcode 4.4.1
2. Load in REAPER for MAC OSX
3. Send Bundle of OSC Messages

What is the expected output? What do you see instead?
I expect the messages to be sent (works fine for a JUCE-based VST-Host, works 
for Cubase, works for Pro tools). When using Reaper on OSX 10.7.5 and when 
compiled with Xcode 4.4.1 for release, it will crash on a call to 
osc::OutboundPacketStream::operator<<(EndBundle). Detailed error message see 
below

What version of the product are you using? On what operating system?
The latest that can be downloaded from this googlecode-project. It crashes only 
when compiled for release (debug compiles run fine!)

Please provide any additional information below.

Okay, now detailed: I write code for a VST plugin with OSC support. I use this 
snippet of code to pack an OSC bundle:
[CODE]
char * buffer = new char[OUTPUT_BUFFER_SIZE];
            osc::OutboundPacketStream p( buffer, OUTPUT_BUFFER_SIZE );

            p << osc::BeginBundleImmediate
                << osc::BeginMessage( "/sys/port" ) 
                << (int) m_socket.get()->getLocalPort() << osc::EndMessage
                << osc::BeginMessage( "/sys/host" ) 
                << "localhost"<< osc::EndMessage
                << osc::BeginMessage( "/sys/prefix" ) 
                << "40h" << osc::EndMessage
                << osc::BeginMessage( "/40h/grid/led/all")
                << 0 << osc::EndMessage
                << osc::EndBundle;

[/CODE]

It runs fine on many hosts on OSX 10.7.5. On REAPER it crashes on the last line 
with a EXC_BAD_ACCESS (SIGSEGV). When build as debug, it won't crash... the 
crash only appears when build as release.

Here is the crash report:

Process:         REAPER [19628]
Path:            /Applications/REAPER64.app/Contents/MacOS/REAPER
Identifier:      com.cockos.reaper
Version:         ??? (4.31)
Code Type:       X86-64 (Native)
Parent Process:  launchd [259]

Date/Time:       2012-12-03 11:10:30.865 +0100
OS Version:      Mac OS X 10.7.5 (11G63)
Report Version:  9

Interval Since Last Report:          590957 sec
Crashes Since Last Report:           41
Per-App Interval Since Last Report:  3405 sec
Per-App Crashes Since Last Report:   6

Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: 0x000000000000000d, 0x0000000000000000

VM Regions Near 0:
--> 
    __TEXT                 0000000100000000-0000000100773000 [ 7628K] r-x/rwx SM=COW  /Applications/REAPER64.app/Contents/MacOS/REAPER

Application Specific Information:
objc[19628]: garbage collection is OFF

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   com.johannesneumann-net.r7      0x00000001165859e6 
osc::OutboundPacketStream::EndElement(char*) + 20
1   com.johannesneumann-net.r7      0x0000000116585d2c 
osc::OutboundPacketStream::operator<<(osc::BundleTerminator const&) + 34

[...]

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0000000104bcd000  rbx: 0x00007fff5fbfe0c0  rcx: 0x6830343004bcd000  rdx: 0x0000000000000000
  rdi: 0x00007fff5fbfe0c0  rsi: 0x0000000104bcd080  rbp: 0x00007fff5fbfdfd0  rsp: 0x00007fff5fbfdfd0
   r8: 0x0000000100a57600   r9: 0x00000000000008f0  r10: 0x0000000000000000  r11: 0x0000000104bcd07a
  r12: 0x000000011a604800  r13: 0x00007fff5fbfe108  r14: 0x000000011a604770  r15: 0x000000011a60d390
  rip: 0x00000001165859e6  rfl: 0x0000000000010206  cr2: 0x000000011658608a
Logical CPU: 6

 [...]

Original issue reported on code.google.com by jo...@gmx.net on 3 Dec 2012 at 10:16

GoogleCodeExporter commented 9 years ago
I wonder if this is a 64bit only issue? 

> works fine for a JUCE-based VST-Host, works for Cubase, works for Pro tools

Are these all 32 bit hosts?

Original comment by ross.bencina on 12 Jan 2013 at 6:33

GoogleCodeExporter commented 9 years ago
pro tools was 32bit, cubase too. I'm not exactly sure, which version of the 
juce based plugin host i chose....

I just build the JUCE-Host again as 64bit and yes, it crashes with this host, 
so your guess might be true

Original comment by jo...@gmx.net on 13 Jan 2013 at 9:10

GoogleCodeExporter commented 9 years ago
Could you please try checking out the latest SVN revision (instructions here 
https://code.google.com/p/oscpack/source/checkout ) and let me know whether the 
problem is still there?

Original comment by ross.bencina on 24 Jan 2013 at 8:11

GoogleCodeExporter commented 9 years ago
And a further suggestion: you might want to check what types your message is 
being sent with using OscDump. I just noticed that if I try to << a long value 
its sent as an int64, which is what you would expect on a 64 bit platform, but 
maybe not what the receiver expects. Therefore I would advise to use the 
osc::int32 and int64 types.

Original comment by ross.bencina on 24 Jan 2013 at 12:49

GoogleCodeExporter commented 9 years ago
This should be fixed in SVN head. The same error in oscgroups 64-bit was fixed. 
Please reopen the ticket if you find the problem is still there after trying 
svn head.

Original comment by ross.bencina on 4 Mar 2013 at 9:39