Running stripper on an alchemy-built swc

104 views
Skip to first unread message

Der Schmale

unread,
Jun 9, 2011, 8:01:12 AM6/9/11
to apparat-framework
Hey all,

I'm currently using Alchemy to compile a 3rd party C-library for use
with Flash. However, the library gets a little log-happy with stdout/
stderr, resulting in a bunch of traces I really could do without. I
figured using the Stripper tool on the generated swc would help, but
without any luck: Stripper fails with a stack-trace. I'm using Scala
2.8.0 and Apparat RC9, and the same occurs in Windows and Ubuntu. I've
managed to run Stripper fine on other projects not using Alchemy.

I've pasted Stripper's console output at the bottom of the post. Any
idea?

Cheers!
David


[INFO] Apparat -- http://apparat.googlecode.com/
[INFO] Launching tool: Stripper
java.lang.StackOverflowError
at apparat.tools.stripper.Stripper$StripperTool$$anonfun$strip$1$
$anonfun$apply$4$$anonfun$apply$5$$anonfun$apply$6$$anonfun$apply
$7.apply(Stripper.scala:128)
at apparat.bytecode.Bytecode.loop$1(Bytecode.scala:65)
at apparat.bytecode.Bytecode.loop$1(Bytecode.scala:70)

[... same line repeated a couple hundred times ...]

at apparat.bytecode.Bytecode.loop$1(Bytecode.scala:70)
java.lang.NullPointerException
at java.util.regex.Matcher.getTextLength(Matcher.java:1140)
at java.util.regex.Matcher.reset(Matcher.java:291)
at java.util.regex.Matcher.<init>(Matcher.java:211)
at java.util.regex.Pattern.matcher(Pattern.java:888)
at java.util.Formatter.parse(Formatter.java:2458)
at java.util.Formatter.format(Formatter.java:2414)
at java.util.Formatter.format(Formatter.java:2367)
at java.lang.String.format(String.java:2769)
at scala.collection.immutable.StringLike
$class.format(StringLike.scala:251)
at scala.collection.immutable.StringOps.format(StringOps.scala:31)
at apparat.log.LoggerImpl.logIf(LoggerImpl.scala:89)
at apparat.log.LoggerImpl.fatal(LoggerImpl.scala:33)
at apparat.tools.ApparatApplication$.apply(ApparatApplication.scala:
78)
at apparat.tools.stripper.Stripper$.main(Stripper.scala:37)
at apparat.tools.stripper.Stripper.main(Stripper.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at scala.tools.nsc.util.ScalaClassLoader$$anonfun$run
$1.apply(ScalaClassLoader.scala:81)
at scala.tools.nsc.util.ScalaClassLoader
$class.asContext(ScalaClassLoader.scala:24)
at scala.tools.nsc.util.ScalaClassLoader
$URLClassLoader.asContext(ScalaClassLoader.scala:86)
at scala.tools.nsc.util.ScalaClassLoader
$class.run(ScalaClassLoader.scala:81)
at scala.tools.nsc.util.ScalaClassLoader
$URLClassLoader.run(ScalaClassLoader.scala:86)
at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:
83)
at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)

pleclech

unread,
Jun 10, 2011, 2:43:37 PM6/10/11
to apparat-framework
Hey,

Can you provide the swc here or in private, so i can test it ?

Best,
Patrick.

On Jun 9, 2:01 pm, Der Schmale <david.lenae...@gmail.com> wrote:
> Hey all,
>
> I'm currently using Alchemy to compile a 3rd party C-library for use
> with Flash. However, the library gets a little log-happy with stdout/
> stderr, resulting in a bunch of traces I really could do without. I
> figured using the Stripper tool on the generated swc would help, but
> without any luck: Stripper fails with a stack-trace. I'm using Scala
> 2.8.0 and Apparat RC9, and the same occurs in Windows and Ubuntu. I've
> managed to run Stripper fine on other projects not using Alchemy.
>
> I've pasted Stripper's console output at the bottom of the post. Any
> idea?
>
> Cheers!
> David
>
> [INFO] Apparat --http://apparat.googlecode.com/

Joa Ebert

unread,
Jun 10, 2011, 3:33:31 PM6/10/11
to apparat-...@googlegroups.com

Bytecode.loop is not tail recursive ATM that is the problem :/

pleclech

unread,
Jun 10, 2011, 4:29:59 PM6/10/11
to apparat-framework
Ok so Hopefully it is fixed now :)

I was just asking for the file to test the fix with a real test case.

Best,
Patrick

On Jun 10, 9:33 pm, Joa Ebert <joaeb...@googlemail.com> wrote:
> Bytecode.loop is not tail recursive ATM that is the problem :/
> On Jun 9, 2011 2:01 PM, "Der Schmale" <david.lenae...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Hey all,
>
> > I'm currently using Alchemy to compile a 3rd party C-library for use
> > with Flash. However, the library gets a little log-happy with stdout/
> > stderr, resulting in a bunch of traces I really could do without. I
> > figured using the Stripper tool on the generated swc would help, but
> > without any luck: Stripper fails with a stack-trace. I'm using Scala
> > 2.8.0 and Apparat RC9, and the same occurs in Windows and Ubuntu. I've
> > managed to run Stripper fine on other projects not using Alchemy.
>
> > I've pasted Stripper's console output at the bottom of the post. Any
> > idea?
>
> > Cheers!
> > David
>
> > [INFO] Apparat --http://apparat.googlecode.com/

David Lenaerts

unread,
Jun 14, 2011, 6:07:33 AM6/14/11
to apparat-...@googlegroups.com
Hey guys, 

Thanks for the updates! I've updated and rebuilt Apparat, but now I'm getting the error below. I can send the swc over privately if it'd help (NDA and all that prevents me from sending it publicly ;) ).

java.lang.NoClassDefFoundError: scala/Serializable
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:14
1)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
        at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at scala.tools.nsc.util.ScalaClassLoader$URLClassLoader.scala$tools$nsc$
util$ScalaClassLoader$$super$findClass(ScalaClassLoader.scala:86)
        at scala.tools.nsc.util.ScalaClassLoader$class.findClass(ScalaClassLoade
r.scala:51)
        at scala.tools.nsc.util.ScalaClassLoader$URLClassLoader.findClass(ScalaC
lassLoader.scala:86)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at scala.tools.nsc.util.ScalaClassLoader$URLClassLoader.scala$tools$nsc$
util$ScalaClassLoader$$super$loadClass(ScalaClassLoader.scala:86)
        at scala.tools.nsc.util.ScalaClassLoader$class.loadClass(ScalaClassLoade
r.scala:57)
        at scala.tools.nsc.util.ScalaClassLoader$URLClassLoader.loadClass(ScalaC
lassLoader.scala:86)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
        at apparat.tools.stripper.Stripper$.main(Stripper.scala:37)
        at apparat.tools.stripper.Stripper.main(Stripper.scala)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at scala.tools.nsc.util.ScalaClassLoader$$anonfun$run$1.apply(ScalaClass
Loader.scala:81)
        at scala.tools.nsc.util.ScalaClassLoader$class.asContext(ScalaClassLoade
r.scala:24)
        at scala.tools.nsc.util.ScalaClassLoader$URLClassLoader.asContext(ScalaC
lassLoader.scala:86)
        at scala.tools.nsc.util.ScalaClassLoader$class.run(ScalaClassLoader.scal
a:81)
        at scala.tools.nsc.util.ScalaClassLoader$URLClassLoader.run(ScalaClassLo
ader.scala:86)
        at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:83)
        at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
Caused by: java.lang.ClassNotFoundException: scala.Serializable
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at scala.tools.nsc.util.ScalaClassLoader$URLClassLoader.scala$tools$nsc$
util$ScalaClassLoader$$super$findClass(ScalaClassLoader.scala:86)
        at scala.tools.nsc.util.ScalaClassLoader$class.findClass(ScalaClassLoade
r.scala:51)
        at scala.tools.nsc.util.ScalaClassLoader$URLClassLoader.findClass(ScalaC
lassLoader.scala:86)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at scala.tools.nsc.util.ScalaClassLoader$URLClassLoader.scala$tools$nsc$
util$ScalaClassLoader$$super$loadClass(ScalaClassLoader.scala:86)
        at scala.tools.nsc.util.ScalaClassLoader$class.loadClass(ScalaClassLoade
r.scala:57)
        at scala.tools.nsc.util.ScalaClassLoader$URLClassLoader.loadClass(ScalaC
lassLoader.scala:86)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
        ... 30 more
--
David Lenaerts
Flash platform developer
http://www.derschmale.com

Joa Ebert

unread,
Jun 14, 2011, 6:57:03 AM6/14/11
to apparat-...@googlegroups.com
Hey David,

are you using Scala 2.9.0.1 or 2.9?

This error smells like you are using Scala 2.8.1  with Apparat and the Scala guys managed to break binary compatibility once again :)


Best,

Joa

David Lenaerts

unread,
Jun 14, 2011, 7:25:19 AM6/14/11
to apparat-...@googlegroups.com
Hey Joa,

The stracktrace I pasted was when using 2.8.0 . I had also tried with 2.9.0.1, and got a different error:

java.util.NoSuchElementException: head of empty list
        at scala.collection.immutable.Nil$.head(List.scala:371)
        at scala.collection.immutable.Nil$.head(List.scala:368)
        at apparat.bytecode.combinator.BytecodeChains$$anon$5.apply(BytecodeChai
ns.scala:46)
        at apparat.bytecode.combinator.BytecodeChains$$anon$5.apply(BytecodeChai
ns.scala:44)
        at apparat.bytecode.combinator.BytecodeChains$$anon$2.repeat$1(BytecodeC
hains.scala:67)
        at apparat.bytecode.combinator.BytecodeChains$$anon$2.apply(BytecodeChai
ns.scala:73)
        at apparat.bytecode.combinator.BytecodeChains$$anon$2.apply(BytecodeChai
ns.scala:64)
        at apparat.bytecode.combinator.BytecodeChainSequence.apply(BytecodeChain
Sequence.scala:33)
        at apparat.bytecode.combinator.BytecodeChainSequence.apply(BytecodeChain
Sequence.scala:27)
        at apparat.bytecode.combinator.BytecodeChainSequence.apply(BytecodeChain
Sequence.scala:32)
        at apparat.bytecode.combinator.BytecodeChainSequence.apply(BytecodeChain
Sequence.scala:27)
        at apparat.bytecode.combinator.BytecodeChain$$anon$1.apply(BytecodeChain
.scala:38)
        at apparat.bytecode.combinator.BytecodeChain$$anon$1.apply(BytecodeChain
.scala:37)
        at apparat.bytecode.Bytecode.replaceFrom(Bytecode.scala:112)
        at apparat.bytecode.Bytecode.replace(Bytecode.scala:101)
        at apparat.bytecode.Bytecode.rewrite(Bytecode.scala:99)
        at apparat.tools.stripper.Stripper$StripperTool$$anonfun$strip$1$$anonfu
n$apply$4$$anonfun$apply$5$$anonfun$apply$6.apply(Stripper.scala:139)
        at apparat.tools.stripper.Stripper$StripperTool$$anonfun$strip$1$$anonfu
n$apply$4$$anonfun$apply$5$$anonfun$apply$6.apply(Stripper.scala:121)
        at scala.Option.foreach(Option.scala:198)
        at apparat.tools.stripper.Stripper$StripperTool$$anonfun$strip$1$$anonfu
n$apply$4$$anonfun$apply$5.apply(Stripper.scala:121)
        at apparat.tools.stripper.Stripper$StripperTool$$anonfun$strip$1$$anonfu
n$apply$4$$anonfun$apply$5.apply(Stripper.scala:120)
        at scala.Option.foreach(Option.scala:198)
        at apparat.tools.stripper.Stripper$StripperTool$$anonfun$strip$1$$anonfu
n$apply$4.apply(Stripper.scala:120)
        at apparat.tools.stripper.Stripper$StripperTool$$anonfun$strip$1$$anonfu
n$apply$4.apply(Stripper.scala:119)
        at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimize
d.scala:34)
        at scala.collection.mutable.ArrayOps.foreach(ArrayOps.scala:38)
        at apparat.tools.stripper.Stripper$StripperTool$$anonfun$strip$1.apply(S
tripper.scala:119)
        at apparat.tools.stripper.Stripper$StripperTool$$anonfun$strip$1.apply(S
tripper.scala:112)
        at apparat.swf.SwfTagMapping$$anonfun$foreachTagSync$2.apply(SwfTagMappi
ng.scala:48)
        at apparat.swf.SwfTagMapping$$anonfun$foreachTagSync$2.apply(SwfTagMappi
ng.scala:47)
        at scala.collection.TraversableLike$WithFilter$$anonfun$foreach$1.apply(
TraversableLike.scala:704)
        at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.
scala:59)
        at scala.collection.immutable.List.foreach(List.scala:45)
        at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.s
cala:703)
        at apparat.swf.SwfTagMapping$class.foreachTagSync(SwfTagMapping.scala:47
)
        at apparat.utils.TagContainer.foreachTagSync(TagContainer.scala:25)
        at apparat.tools.stripper.Stripper$StripperTool.run(Stripper.scala:108)
        at apparat.tools.ApparatApplication$.apply(ApparatApplication.scala:73)
        at apparat.tools.stripper.Stripper$.main(Stripper.scala:37)
        at apparat.tools.stripper.Stripper.main(Stripper.scala)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at scala.tools.nsc.util.ScalaClassLoader$$anonfun$run$1.apply(ScalaClass
Loader.scala:78)
        at scala.tools.nsc.util.ScalaClassLoader$class.asContext(ScalaClassLoade
r.scala:24)
        at scala.tools.nsc.util.ScalaClassLoader$URLClassLoader.asContext(ScalaC
lassLoader.scala:88)
        at scala.tools.nsc.util.ScalaClassLoader$class.run(ScalaClassLoader.scal
a:78)
        at scala.tools.nsc.util.ScalaClassLoader$URLClassLoader.run(ScalaClassLo
ader.scala:101)
        at scala.tools.nsc.ObjectRunner$.run(ObjectRunner.scala:33)
        at scala.tools.nsc.ObjectRunner$.runAndCatch(ObjectRunner.scala:40)
        at scala.tools.nsc.MainGenericRunner.runTarget$1(MainGenericRunner.scala
:56)
        at scala.tools.nsc.MainGenericRunner.process(MainGenericRunner.scala:80)

        at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:89)
        at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
Reply all
Reply to author
Forward
0 new messages