Obfuscation causes VerifyError: Expecting a stackmap frame - obfuscation

We are using latest JDK 7 (u45) and ProGuard Version 4.10
Lately starting our distribution fails, after obfuscating it, with the following error:
Exception in thread "main" java.lang.VerifyError: Expecting a stackmap frame at
branch target 155
Exception Details:
Location:
com/bla/bla/service/ioc/SpringBootstrap.c()V #0: getstatic
Reason:
Expected stackmap frame at this location.
Bytecode:
0000000: b200 73b6 008b 9900 82b2 0073 b800 933b
0000010: 1a99 0074 b200 73b6 008d 9900 6bb2 0074
0000020: 1221 b600 cfb8 0092 4c2b b600 9c12 1db9
...
Exception Handler Table:
bci [0, 152] => handler: 155
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.getMethod0(Unknown Source)
at java.lang.Class.getMethod(Unknown Source)
at sun.launcher.LauncherHelper.getMainMethod(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
I found several discussions about this topic on StackOverflow, like
java-lang-verifyerror-expecting-a-stackmap-frame-at-branch-target-jdk-1-7
java-lang-verifyerror-expecting-a-stackmap-frame
understanding-how-to-resolve-inconsistent-stackmap-frames-exception
java-7-inconsistent-stackmap-frames-need-help-understanding-why-solution-wor
From what I understood is, that java 7 uses a stricter verification and introduced a stack map for classes to verify the code. So somehow during my obfuscation process this map seems to get corrupted, since only this exception occurs, when I obfuscate my project with proguard.
Disabling the verification with -XX:-UseSplitVerifier and starting the builded jar helps, but im not really sure if that should be the way handling this issue.
So I wonder if anyone else had a simular error? Or if anyone might even knows a specific way to solve this, for example by adjusting the proguard konfiguration for the obfuscation process?

I assume you are not specifying -dontpreverify? That option will almost certainly lead to these errors, since it will stop ProGuard from updating the StackMapTable attribute. The attribute was optional in Java 6, but it is required in Java 7.
You could still try a beta version of ProGuard 4.11, but it is unlikely that it makes a difference here. If you mail me the processed class file, I'll look into it.
(I am the developer of ProGuard)

In case you guys didn't find a solution yet, you may try to check if you have -microedition option. Here's why it related to StackMap. Removing this option fixed this issue for me.

I also faced the same challenge when migrating my application from 1.6 to 1.7. After huge struggle, we found a fix to address the issue.
Approach 1: Either you can use -XX:-UseSplitVerifier argument will resolve this issue and you don't need to worry about to upgrade the library files.
Approach 2: I have followed the below steps to overcome the issue. Step 1: Identify and keep a list of external libraries consumed by your application. Step 2: Once you identify the list, keep removing one by one external library files and plug in upgraded version library files which will help you to isolate the library which might causing the issue. In my case: j2ee.jar and openjpa-1.2.2 jar files created an issue and then I have upgraded these libraries which had resolved the migration issues.
Hence, It is bit of slow and painful process to figure out which library causing the issue and arrest it.
I hope, this information might be useful because it is based out of my real time experience.

Related

Strange Error Message when Using CMSIS 5.7 with STM CubeIDE during Code Generation

I get a strange Error Message during the Code-Generation Process in STM CubeIDE for a STM32F4 target:
The Details:
I am using STM CubeIDE for an embedded Project with an STM32F405 Microcontroller and I have added the CMSIS Package 5.7.0 to the project, because i need some of the DSP functions. I have allready done this before and never experienced such an error message.
The message pops up during the Code-Generation process, after changing something in the Hardware-Setup with the (built in) CubeMX. It occurs two times during the Code Generation process. I can click on "OK" and it does NOT interrupt the Code Generation process, which seems to finish successfully. I can also compile the project without errors and it seems to work ok.
The Question:
Even though it seems to work properly, I'd like to know: what is this, where does it come from, and what can I do to solve this? I'm affraid that might lead to some unpleasant sleeping bugs or other nasty stuff ...
Has anyone experienced anything simlilar and has an explanation or even a solution for this?
Hint: I have recently update to CubeIDE 1.6.0 - maybe this is a Bug in CubeIDE and not in CMSIS?
What I've done:
I tried to google that, with the keywords:
"SliDtzliTZ&" and the "LogicalParser:syntax error detected in expression for ARM.CMSIS.5.7.0" but did not get any usefull results. Next step was to post the question here ...
Thank you in advance,
Chris
This problem happens with release version 5.7.0. Using any older version available in the official repository solves the problem.
I'm using 5.6.0 now and all is fine.
Edit: Problem persists on 5.8.0.

Stackoverflow error when using plantuml gui

I have been using Plantuml gui using the following command.
java -jar plantuml.jar -gui
It worked fine for a while but then suddenly I started getting the following error. Everything has slowed down and diagram images are no longer being generated, the GUI does not list the image files in the folder I have selected. Any help will be much appreciated.
Exception in thread "AWT-EventQueue-0" java.lang.StackOverflowError
at java.io.InputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at net.sourceforge.plantuml.AFileRegular.open(AFileRegular.java:57)
at net.sourceforge.plantuml.preproc.FileWithSuffix.getReader(FileWithSuffix.java:65)
at net.sourceforge.plantuml.preproc.StartDiagramExtractReader.getReadLine(StartDiagramExtractReader.java:106)
at net.sourceforge.plantuml.preproc.StartDiagramExtractReader.containsStartDiagram(StartDiagramExtractReader.java:136
)
at net.sourceforge.plantuml.preproc2.PreprocessorInclude3.getReaderInclude(PreprocessorInclude3.java:326)
at net.sourceforge.plantuml.preproc2.PreprocessorInclude3.manageFileInclude(PreprocessorInclude3.java:262)
at net.sourceforge.plantuml.preproc2.PreprocessorInclude3.access$500(PreprocessorInclude3.java:75)
at net.sourceforge.plantuml.preproc2.PreprocessorInclude3$Inner.readLineInternal(PreprocessorInclude3.java:149)
at net.sourceforge.plantuml.preproc2.ReadLineInsertable.readLine(ReadLineInsertable.java:65)
at net.sourceforge.plantuml.preproc2.Preprocessor2.readLine(Preprocessor2.java:87)
I have found the problem. The StackOverflowError should have given me an hint, but I missed it. Usually it is related to a recursive loop.
I am using the file include feature and had a circular file reference. So plantuml was going (or rather I was sending it) into an infinite loop and therefore it was running out of stack space.

Codenamone One Online Build Failure

We added new features to our data collection mobile application after two -three months of inactivity, only for the build to keep failing.
This is the stack trace
ll-advised or mistaken usage of a core class (java.* or javax.*)
when not building a core library.
This is often due to inadvertently including a core library file
in your application's project, when using an IDE (such as
Eclipse). If you are sure you're not intentionally defining a
core class, then this is the most likely explanation of what's
going on.
However, you might actually be trying to define a class in a core
namespace, the source of which you may have taken, for example,
from a non-Android virtual machine project. This will most
assuredly not work. At a minimum, it jeopardizes the
compatibility of your app with future versions of the platform.
It is also often of questionable legality.
If you really intend to build a core library -- which is only
appropriate as part of creating a full virtual machine
distribution, as opposed to compiling an application -- then use
the "--core-library" option to suppress this error message.
If you go ahead and use "--core-library" but are in fact
building an application, then be forewarned that your application
will still fail to build or run, at some point. Please be
prepared for angry customers who find, for example, that your
application ceases to function once they upgrade their operating
system. You will be to blame for this problem.
If you are legitimately using some code that happens to be in a
core package, then the easiest safe alternative you have is to
repackage that code. That is, move the classes in question into
your own package namespace. This means that they will never be in
conflict with core system classes. JarJar is a tool that may help
you in this endeavor. If you find that you cannot do this, then
that is an indication that the path you are on will ultimately
lead to pain, suffering, grief, and lamentation.
1 error; aborting
:transformClassesWithDexForRelease FAILED
:transformClassesWithDexForRelease (Thread[Daemon worker,5,main]) completed. Took 11.045 secs.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':transformClassesWithDexForRelease'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Error while executing java process with main class com.android.dx.command.Main with arguments {--dex --verbose --force-jumbo --num-threads=4 --output /tmp/build8570106392456281219xxx/Application/build/intermediates/transforms/dex/release/0 --min-sdk-version 15 /tmp/build8570106392456281219xxx/Application/build/intermediates/transforms/proguard/release/0.jar}
You or one of the cn1libs you are using included a javax.xml package as part of the code. We migrated to build target 27 over the weekend and I'm guessing that Google made checks for this sort of problem more rigid.
I see a lot of keep statements in your build hints so I'm guessing this was done intentionally.

No FontFamily element found in FontFamilyCollection

My WPF application suddenly fails with the following exception:
System.IO.FileFormatException: No FontFamily element found in
FontFamilyCollection that matches current OS or greater: Windows7SP1
I've tried different OS but it's happening only on Windows 7 with SP1.
Microsoft released an official statement about this issue here (includes workarounds):
https://github.com/dotnet/announcements/issues/53
I've found out that the exception is connected to the latest security update KB4055532. When this update is uninstalled on Windows 7 SP1 then the problem disappear.
Since I'm not allowed to comment:
Answer by 'user2250152' is correct.
#Comment by #Lieven Keersmaekers:
'fwiw - installing KB4056894 also triggers this exception when starting Powershell ISE':
I really doubt this.
I'm dealing with this 'KB4055532' issue for 2 days now on all in all 8 machines. But after having installed 'KB4056894' there were no issues with starting Powershell ISE.
This only started to happen after installing 'KB4055532'.
And uninstalling this 'KB4055532' (but still having 'KB4056894' on the machines) resolves the issue with Powershell.
Btw:
There is a hint on the following site (and a way to 'fix' the issue):
https://ngb.to/threads/32709-Microsoft-Patchday-Januar-2018-KB4055532-NET-Font-Probleme.
The issue comes from a '*.CompositeFont' file that gets replaced by the update and which is then missing information for Windows 7. This makes programs based on WPF using functions to determine FontFamily fail/crash.
Effectively I'm quite sure it is only the file 'GlobalUserInterface.CompositeFont' that must be exchanged to temporarily fix this issue.
I ran into this error with MarkdownPad2. With the information from .NET Framework January 2018 Rollup Known Issue KB4074906 - "TypeInitializationException" or "FileFormatException" error in WPF applications (thanks #Boris!), I used the manual repair option to download and replace the corrupted font (installed by Microsoft's update) and it solved the problem.
The exception looks like this:
The invocation of the constructor on type 'MarkdownPad2.UserControls.MarkdownEditor' that matches the specified binding constraints threw an exception.
---> System.TypeInitializationException: The type initializer for 'System.Windows.Media.Fonts' threw an exception.
---> System.IO.FileFormatException: No FontFamily element found in FontFamilyCollection that matches current OS or greater: Windows7SP1
Damaging a font during an upgrade seems like an inexcusable error. Apparently Microsoft agrees, as they closed the tech note with this comment:
All updates are extensively tested before they are provided to you. We are investigating the gap in our testing and will resolve that for our next release.

Onelogin Drupal 7 module error onelogin_saml_password_tab_disabled

I have configured two instances of the Drupal Onelogin module d7oneloginsaml2v2.2.4.zip
as detailed on the Onelogin help page
https://support.onelogin.com/hc/en-us/articles/201173604-Configuring-SAML-for-Drupal
This is on two fresh installs of Drupal 7 and both times I have got the error:
Notice: Use of undefined constant onelogin_saml_password_tab_disabled - assumed 'onelogin_saml_password_tab_disabled' in onelogin_saml_menu_alter() (line 81 of/etc/drupal7/all/modules/contrib/onelogin_saml/onelogin_saml.module).
Please note that this error does not appear to prevent the module doing authentication.
Any ideas why this error is appearing? Is there something that I need to configure prior to enabling the module?
I am not a programmer so this may be fairly obvious to developers.
Thanks
Paul C
This was a bug, already fixed on the repository, but the patch is not yet included in any release. Maybe download the code directly from github repository: https://github.com/onelogin/drupal-saml

Resources