Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > SIGBUS with cocoa-java: help!

SIGBUS with cocoa-java: help!
Thread Tools
Forum Regular
Join Date: Nov 2001
Location: Australia
Status: Offline
Reply With Quote
May 16, 2002, 11:08 PM
 
I've just about given up. I have a small cocoa-java app that I've been playing with recently, but after it runs for a few seconds it crashes with the following message:

sample.app has exited due to signal 10 (SIGBUS).

The problem exists with the NSTableView I'm using as a one column list. I use a custom class for the data source which has an array to store the values for the table.

I've read the archive of apple and omni developer email lists and understand that I need to keep a reference to the object(s) that get sent to the NSTableView via the data source (otherwise the objects get garbage collected and cause the SIGBUS). I can't however figure out which objects to do this too and how to do it exactly.

Any help much appreciated!
     
Mac Enthusiast
Join Date: Sep 2000
Location: Vermont, USA
Status: Offline
Reply With Quote
May 17, 2002, 09:15 PM
 
I have a cocoa java app that uses several tables in different windows. Are you sure that you are calling all of the required delegate methods:

// required delegate methods, note arguments not listed.

numberOfRowsInTableView

tableViewObjectValueForLocation

tableViewSetObjectValueForLocation

intFromTableColumn

Also, have you hooked up your sourceData and delegate connections in Interface Builder?
     
V0ID  (op)
Forum Regular
Join Date: Nov 2001
Location: Australia
Status: Offline
Reply With Quote
May 18, 2002, 06:04 AM
 
Thanks for responding.

Originally posted by macrophyllum:
<STRONG>I have a cocoa java app that uses several tables in different windows. Are you sure that you are calling all of the required delegate methods:

// required delegate methods, note arguments not listed.

numberOfRowsInTableView

tableViewObjectValueForLocation

tableViewSetObjectValueForLocation

intFromTableColumn</STRONG>
I have all of those except the last one which I am not familiar with. I can't find it in the documentation.
<STRONG>

Also, have you hooked up your sourceData and delegate connections in Interface Builder?</STRONG>
I don't think so. Once again, I'm unfamiliar with this. Could you please provide an explanation for this?

Thanks again.

[ 05-18-2002: Message edited by: V0ID ]
     
V0ID  (op)
Forum Regular
Join Date: Nov 2001
Location: Australia
Status: Offline
Reply With Quote
May 21, 2002, 12:16 AM
 
Update:

I've done some experimenting and come up with the following results.

I installed the April beta developer tools (was using December with update) and created two cocoa-java projects. Both have a NSTableView with 1 column, a NSTextField and NSButton. Both have two java classes, Controller and DataSource (for the NSTableView). When you click the button, whatever is in the NSTextField gets put into the NSTableView as a new row.

The difference between the two is what the classes are subclassed from. The first one, both classes are subclassed from java.lang.Object, whereas with the second project, both are subclassed from NSObject.

And guess what, no SIGBUS on either. I can't figure out why. The only thing I did different between these two projects and the one where I get the SIGBUS error, is that I created all the classes (and instantiated) them in Interface Builder. With the original project (the SIGBUS one) I used IB to create the controller object, but I created the other two manually in PB (including the dataSource).

Does anyone have any ideas as to what's going on??

This leads me to my next question: In a cocoa-java project, when should I subclass from java.lang.Object, and when from NSObject? (I created a new thread)

Confused :/
     
V0ID  (op)
Forum Regular
Join Date: Nov 2001
Location: Australia
Status: Offline
Reply With Quote
May 21, 2002, 02:53 AM
 
I've found the problem. I'm too stupid to use a computer :o And I'd like to take this opportunity to formally resign from all programming activities.


PS. Does anyone else find Gdb infinitely more useful than Java debugger?
     
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status: Offline
Reply With Quote
May 21, 2002, 10:50 AM
 
No. The Java debugger always seems to work well for me. Most of my problems end up being "bridge" issues, but the java debugger usually gives me pretty good stack traces so I know what bug report to file.

F-bacher
     
V0ID  (op)
Forum Regular
Join Date: Nov 2001
Location: Australia
Status: Offline
Reply With Quote
May 22, 2002, 02:21 AM
 
How do you get java debugger to print a stack trace after the app has crashed?
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 03:00 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2