Class _NSZombie_GraphicPath is implemented in both ?? and ??. One of the two will be used. Which one is undefined - iphone

I'm getting the following run time output:
"Class _NSZombie_GraphicPath is implemented in both ?? and ??. One of the two will be used. Which one is undefined."
Have no clue how to fix this. There are a couple of other questions that cover this, but it seems in those unit testing was involved. Has anyone ever come across this problem before and if so how was it fixed?

It implies that two images and/or static libraries export the class GraphicPath. For example, one may be your app, and the other a unit test. A library you link to could also export that class. In any event, you should review your projects' compilations phases including all dependencies, and ensure that GraphicPath.m is compiled exactly once, then remove all others. Also note that it is possible to compile the file twice for the same target. I expect that you would also see a log warning when running with zombies disabled. You can also use nm to dump an image's symbol names.

Related

Timescale missing on the module as other modules have it Verilator error

I am trying to add an accelerator to the rocket chip framework through the MMIO peripheral. I went through the GCD example and was able to build the basic GCD code. I then replaced the GCD with an accelerator which has it's own Config, Parameters and Field information. Now when I try to pass this information to the rocket chip there is a name clash with the freechips.rocketchip.config.{Parameters, Field, Config}. I tried specifying the whole path i.e; accelerator.util.conig.Parameters to distinguish it from freechips.rocketchip.config.Parameters but it still gave me the same error. When I remove my accelerator configs and parameters and pass simple hand made parameters the build is successful, however, when I add my config I get %Error-TIMESCALEMOD and this error is in the generated file which I am not modifying. I tried a work around by altering my verilator options but that goes down a rabbit hole of errors. I have narrowed down the problem to the fact that this is being caused because I am using two different configs both of which have their own Config.scala file shown here Is there a way to fix this problem? I have attached the error with this question.
The problem was with a blackbox, not sure why it was giving me that error, but yes we can mix two different configs having different util.config files. We just have to specify them explicitly.

Marmalade IwUIController causes crash when accessing IwUIElement objects

I created an app that works which is similar to the examples from the Marmalade SDK. Then I tried to move the IwUIController derived class in a separate files .h/.cpp to clean the code up a bit but I get a crash every time I try to access any IwUIElement? For example:
CIwUIImage* image = IwSafeCast<CIwUIImage*>(pScreen->GetChildNamed("Image"));
pScreen is declared as
static CIwUIElement *pScreen;
and then in main(): pScreen = CIwUIElement::CreateFromResource("Screen");
What can be the reason for these crashes? Does the Controller class need to be in the same file as main()? I've tried to debug and the pointer appears to be passed properly.
Not sure it really counts as an answer, but I don't have enough stackoverflow reputation to comment apparently;-)
If you've got C++ code that worked OK until you split it into two files, I would seriously check the #include and other declarations are the same in the new two files as they were in the originals. 9 times out of 10, my experience is that for some reason something is not the same. Actually one specific issue worth checking for is that a struct or class is only partly declared (e.g. a forward declaration) in one file and has lost its parent.
Having said that, as Creator, said what were the symptoms of the crash? Is this possibly the dynamic cast failing of IwSafeCast failing?

Strange behaviour when importing types in Scala 2.10

Today I cleared my .ivy cache and cleaned my project output targets. Since then I have been getting really strange behaviour when running tests with SBT or editing in the Scala IDE.
Given the following:
package com.abc.rest
import com.abc.utility.IdTLabel
I will get the following error:
object utility is not a member of package com.abc.rest.com.abc
Notice that com.abc is repeated twice, so it appears that the compiler uses the context of the current package when doing the import (maybe it's supposed to do this, but I never noticed it before).
Also, if I try to access classes in package com.abc from anywhere inside com.abc.rest (even using the full path) the compiler will complain that the type can not be found.
It appears that the errors only occur when I try to include files from parent packages. What I do find strange is that my code used to work. It only started happening after I cleaned up my project and my ivy cache, so maybe a later version of the compiler is more strict than the previous one.
I would love some ideas on what I can be doing wrong, or how I can go about troubleshooting this.
Update:
By first importing the parent classes and then defining the current package, the problem goes away:
import com.abc.utility.IdTLabel
import com.abs._
package com.abc.rest {
// Define classes belonging to com.abc.rest here
}
So this works, but I would still love to know why on earth the other way around worked, and then stopped working, and how on earth I can fix it. I had a good look, and could find no packages, objects or traits by the name of com anywhere inside the parent package.
Update relating to Worksheets:
Scala worksheets belonging to the same package share the same scope, which sounds obvious, but wasn't. Worksheets are not sand-boxed - they can see the project, and the project can see them. So all the 'test' object, traits, and classes you create inside the worksheet files, also becomes visible in the rest of the project.
I have so many worksheets that I did not even try to see where the problem came in. I simply moved them all to their own package, and like magic, the problem went away.
So, lesson learned for the day: If you create stuff inside worksheets, it's visible from outside the worksheet.
Anyway, this new found knowledge will come in handy, meaning anything 'interesting' can be build, monitored and tweaked inside the worksheet, while the rest of the project can actually use it. Quite cool actually.
It's still interesting to think how a sbt clean and cleaned up ivy cache managed to highlight the problem that was hidden before, but hey, that's another story....
(At the request of JacobusR, I'm making a proper answer out of my earlier comments).
This can happen if you have defined some class/trait/object inside package com.abc.rest.com. As soon as package com.abc.rest.com exists, and given that you are in package com.abc.rest, com would designate com.abc.rest.com as opposed to _root_.com. Fastest (but non-conclusive) way to check, without even scanning the source files, is to look for any .class files in the "com/abc/rest/com" sub-folder.
In particular you would get this behaviour if any of your files has duplicate package definitions (as in package com.abc.rest; package com.abc.rest; ...). If you have this duplicate package clause somewhere in the same file where you get the error, you wouldn't even see anything fishy with the .class files, as the failure at compiling the file would prevent the generation of .class files for any class definition inside the file.
The final bit of useful information is that as you found out the scala Worksheets are not sandboxed, and what you define in the worksheets affects your project's code (rather than only having the project's code affecting the worksheet). So a duplicate package clause in a worksheet could very well cause the error you got.
If package names conflict, there might be a custom error message for that. See if specifying the full path resolves the issue by starting from __root__. Ex. import __root__.com.foo.bar._

Obscure NSZombie console log

I tried searching on google, and got literally no results when trying to figure out what this means. My console is logging:
objc[17048]: Class _NSZombie_GEOLatLng is implemented in both ?? and ??. One of the two will be used. Which one is undefined.
objc[17048]: Class _NSZombie_GEOLatLng is implemented in both ?? and ??. One of the two will be used. Which one is undefined.
objc[17048]: Class _NSZombie_GEOLocation is implemented in both ?? and ??. One of the two will be used. Which one is undefined.
objc[17048]: Class _NSZombie_GEOLocation is implemented in both ?? and ??. One of the two will be used. Which one is undefined.
Anyone seen this before, or have any idea what it means, what's causing it, and if it's a problem?
I've seen it. Specifically, on OS X - but the cause should be the same. GEOLocation (and others) is defined in two images which are loaded into the process.
If that were a class you wrote, the class' symbols are defined in multiple object files (would likely be a linker error though…), in the linked libraries, loaded bundles, or some combination of - when code may be loaded dynamically.
If it's not a class you wrote (or synthesized), file a bug with the creator of the class.
It's also possible that the class is defined in your app, and also defined in a linked library. In that event, you would need to change the name of your class.
It is definitely a problem. The class (with that name) is being loaded into the objc runtime twice, and there are no guarantees as to which implementation will be returned when an instance is created since objc uses a flat namespace.
In this case, the class exists in the system frameworks so... send it to the bug reporter - it deserves be fixed quickly.
This is a harmless warning that occurs when you have enabled zombie warnings in the build scheme. You can ignore it.
I had this obscure message and noticed that a NIB had been removed from the project, but code was still using it. You may want to check if any resources have been removed from the bundle that are still in use.

MS VS-2005 Compiler optimization not removing unused/unexecuted code

I have a workspace built using MS-Visual Studio 2005 with all C code.In that i see many functions which are not called but they are still compiled(they are not under any compile time macro to disable them from compiling).
I set following optimization settings for the MS-VS2005 project to remove that unused code:-
Optimization level - /Ox
Enable whole program optimization - /GL
I tried both Favor speed /Ot and Favor Size /Os
Inspite of all these options, when i see the linker generated map file, I see the symbols(unsed functions) names present in the map file.
Am I missing something? I want to completely remove the unused code.
How do I do this?
The compiler compiles C files one-at-a-time. Therefore, while compiling a C-file that does contains an unused function, the compiler cannot be sure that it will not be called from another file and hence it will compile that function too. However, if that function were declared as static (file-scope), then the compiler would know it is not used and hence remove it.
Even with whole program optimization, I think it would still not be done since the compilation could be for a library.
Linkers do something similar to what you are looking for. If your code links against a library containing multiple objects, then any objects that do not contain functions used by your code (directly or indirectly) would not be included in the final executable.
One option would be to separate your code into individual libraries and object files.
PS - This is just my guess. The behavior of the compiler (with whole program optimization) or linker essentially depends on the design choices of that particular compiler or linker
On our projects we have a flag set under the project properties\Linker\Refrences. We set it to Eliminate Unreferenced Data (/OPT:REF), according to the description this is supposed to remove function calls or data that are never used. I am just going by the description, I have never tested this or worked with it. But I just happened to see it within the last hour and figured it might be something you could try.