Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 335268 - An internal error occurred during: "Reading Debug Symbol Information: Hello World".
Summary: An internal error occurred during: "Reading Debug Symbol Information: Hello W...
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-core (show other bugs)
Version: 8.0   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: 8.0   Edit
Assignee: Marc-André Laperle CLA
QA Contact: Ken Ryall CLA
URL:
Whiteboard:
Keywords:
: 302623 306342 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-01-24 19:56 EST by Marc-André Lapointe CLA
Modified: 2011-06-01 02:23 EDT (History)
5 users (show)

See Also:


Attachments
Error stack (1.57 KB, text/rtf)
2011-01-24 19:56 EST, Marc-André Lapointe CLA
no flags Details
It's a picture of the problem (200.70 KB, image/png)
2011-01-24 19:59 EST, Marc-André Lapointe CLA
no flags Details
Mach-O 64 parser, readLong patch (1.68 KB, patch)
2011-01-25 00:18 EST, Marc-André Laperle CLA
malaperle: iplog-
Details | Diff
Mach-O 64 parser, readLong patch, with API changes (17.45 KB, patch)
2011-03-31 10:00 EDT, Marc-André Laperle CLA
malaperle: iplog-
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marc-André Lapointe CLA 2011-01-24 19:56:56 EST
Created attachment 187486 [details]
Error stack

I have the error of the title, when in the debbuger, in the executables tab i click on the executable name to see the source file name.

There's the error stack atached.
Comment 1 Marc-André Lapointe CLA 2011-01-24 19:59:04 EST
Created attachment 187487 [details]
It's a picture of the problem
Comment 2 Marc-André Laperle CLA 2011-01-24 23:14:21 EST
I can reproduce this too. Can you change the component of the bug to cdt-core? I will try to fix this.
Comment 3 Marc-André Laperle CLA 2011-01-25 00:18:16 EST
Created attachment 187493 [details]
Mach-O 64 parser, readLong patch

-readLong was calling readInt, I copied readLong from utils.ERandomAccessFile
-added a null check when no lines info, handles stripped binaries
Comment 4 Marc-André Laperle CLA 2011-01-25 10:34:51 EST
Andrew, would you mind looking at this when you have a few cycles to spare? It is a simple patch, just copied stuff and a null check. It would be a nice fix for 7.0.2! Thanks :)
Comment 5 James Blackburn CLA 2011-01-25 10:54:06 EST
This class is now almost a verbatim clone of org.eclipse.cdt.utils.ERandomAccessFile.  Is there a good reason to have this code duplicated?
Comment 6 Marc-André Lapointe CLA 2011-01-25 11:05:27 EST
Can someone tell me how to apply the patch, I new to Eclipse and I don't really know how to patch it.
Comment 7 Marc-André Laperle CLA 2011-01-25 13:58:14 EST
(In reply to comment #5)
> This class is now almost a verbatim clone of
> org.eclipse.cdt.utils.ERandomAccessFile.  Is there a good reason to have this
> code duplicated?

I tried to change the cdt.utils.macho one to delegate to the cdt.utils one so that it would avoid API compatibility problems, but it doesn't work. Maybe because it's creating two RandomAccessFile objects for the same file (because it needs to call super), hmmmmm. Using the cdt.utils class inside the macho code creates compatibility problems and also readIntE returns a long instead of an int which means lots of casts or lots of compatibility filers. Changing the base class also creates a compatibility problem and readIntE is final and the return type can't be overridden.

So, I'm not sure what's worse, the API changes or the duplication?

(In reply to comment #6)
> Can someone tell me how to apply the patch, I new to Eclipse and I don't really
> know how to patch it.

I think you should wait for the fix to be in a nightly build. I will paste the link here when it is available. Or if you want to get started with CDT development: http://wiki.eclipse.org/Getting_started_with_CDT_development
Comment 8 Marc-André Laperle CLA 2011-02-22 15:18:12 EST
Now that 7.0.2 is done, I will look at reusing utils.ERandomAccessFile. I doubt that anyone is depending on macho.ERandomAccessFile so I think it's fine to break the API.
Comment 9 James Blackburn CLA 2011-02-22 17:18:02 EST
AFAIK we don't tests for any of the binary parsers.  This means we're flying blind when making changes here :s.  It would be good to add a test case when fixing bugs in them...
Comment 10 Marc-André Laperle CLA 2011-03-08 03:12:59 EST
*** Bug 306342 has been marked as a duplicate of this bug. ***
Comment 11 Marc-André Laperle CLA 2011-03-08 03:20:09 EST
*** Bug 302623 has been marked as a duplicate of this bug. ***
Comment 12 Marc-André Laperle CLA 2011-03-31 10:00:16 EDT
Created attachment 192275 [details]
Mach-O 64 parser, readLong patch, with API changes
Comment 13 Marc-André Laperle CLA 2011-03-31 23:40:37 EDT
The last patch:
-deprecates macho.ERandomAccessFile
-changes efile member of MachO64 and AR to a utils.ERandomAccessFile
-creates API problem filters for the two changed members
-adds a null check when no lines info (for stripped binaries)

The original MachO is still using macho.ERandomAccessFile but it is also marked as deprecated so the two could be removed next release. Removing the classes now would bump the major version of the core plugin and I think it's not reasonable to do that at this point. 

James, how bad is it to create API filters? It shouldn't matter since it is very unlikely that someone is depending on it, right?

(In reply to comment #9)
> AFAIK we don't tests for any of the binary parsers.  This means we're flying
> blind when making changes here :s.  It would be good to add a test case when
> fixing bugs in them...

It would be good yes. I'd like to handle that in a separate bug and provide at least some basic tests for all binary parsers.
Comment 14 James Blackburn CLA 2011-04-01 03:15:07 EDT
(In reply to comment #13)
> James, how bad is it to create API filters? It shouldn't matter since it is
> very unlikely that someone is depending on it, right?

This is a problem we have when we make implementation too visible.

API freeze has passed, which means we can't even add new API, far less break existing API.  So a few questions:
  - Is it expected that people can extend the MachO64 / AR classes?
  - Do they need access these protected fields?  
If either the above is true, we have a problem.  If this class isn't designed to be extended can you also make the classes @noextend, so changing protected & private implementation won't be API breaking in the future.

The change is small, and the risk is low but there's still a risk.   At this point you should email cdt-dev for any objections.
Comment 15 Marc-André Laperle CLA 2011-05-31 00:17:09 EDT
(In reply to comment #14)
> (In reply to comment #13)
> > James, how bad is it to create API filters? It shouldn't matter since it is
> > very unlikely that someone is depending on it, right?
> 
> This is a problem we have when we make implementation too visible.
> 
> API freeze has passed, which means we can't even add new API, far less break
> existing API.  So a few questions:
>   - Is it expected that people can extend the MachO64 / AR classes?

It is not clear to me if these classes are meant to be extended or not. It seems that it would be pretty hard and convoluted to do so. In any case, I would like to fix this for 8.0 and the safest way to go at this point in the release cycle would be patch
https://bugs.eclipse.org/bugs/attachment.cgi?id=187493

James, let me know if you have any objections. If not, I will commit this more conservative patch tomorrow.
Comment 16 Marc-André Laperle CLA 2011-06-01 02:00:32 EDT
Fixed in HEAD (8.0). Will defer potential API changes to next version part of bug 347187.