Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] In rare circumstances StackOverflows occur after aspecting Android projects

Hi Andreas.

What is the "interesting thing" you are doing with the call?

How do you go about "internal bookkeeping"?

Why do you not have the source code of your program? Is it really a library instead of a stand-alone program? If so, who uses it for what purpose? And is it possible they are also using AspectJ?

The more details you can provide, the better we can help you.

Regards
-- 
Alexander Kriegisch


Am 04.07.2016 um 07:40 schrieb Andreas Marschke <andreas.marschke@xxxxxxxxx>:

Hi all,

at work we are writing an analytics tool measuring network requests in
Android Applications leveraging AspectJ to measure them at runtime.

To that extend we have setup Aspects to run during a build of an Android
Application looking similar to the following:

pointcut URL_openConnection() : call(* java.net.URL.openConnection(..)) &&
  !within(org.example.metrics.android..*);

URLConnection around () : URL_openConnection()
{
  /* Do something interesting with this call */
  URLConnection connection = (URLConnection) proceed();

  /* Pass off the connection reference for internal bookkeeping */
  return connection;
}

In most cases this actually works flawlessly and has yet to result in a problem
in our test environment.

We do aspect both the build results (*.class-files) of the Application as well
as it's dependencies (ie. jars that the Android Application deems required at
compile/runtime to be available).

The problem begins when we received the report that this Aspect code resulted
in an unforeseen consequence of a StackOverflow (carefully reading the FAQ for
AspectJ and reviewing our Aspects I thought we would not have a similar case
to this one[0] at hand).

Receiving a compiled example of the project reporting the issue and not the code
I could clearly see in a decompiler 2 Aspects calling openConnection() where the
proceed() is and subsequently each other as aspect methods specifically.

This is curious to us and is something we have a hard time reproducing.

It would be of great help to us if someone from this forum who has more
experience could enlighten us as to what exactly is amiss here.

Thank you in advance,

Andreas Marschke

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Attachment: smime.p7s
Description: S/MIME cryptographic signature


Back to the top