bugGnash - The GNU Flash player - Bugs: bug #18204, assertion fails in ActionSubString...

 
 

bug #18204: assertion fails in ActionSubString (0.7.2 - head untested)

Submitted by:  Sandro Santilli <strk>
Submitted on:  Sun 05 Nov 2006 10:22:56 AM UTC  
 
Category: ActionScriptSeverity: 5 - Blocker
Release: NoneStatus: Fixed
Privacy: PublicAssigned to: Sandro Santilli <strk>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Sun 05 Nov 2006 08:47:22 PM UTC, comment #10:

Well, since I was the original reporter, and I can confirm the
bug is gone, I'll just consider this item as closed (segfault)

As for the 'substring' opcode, in case Udo finds out a way
to actually generate it I suggest a new bug item is opened (if we have a bug there, who knows). Maybe we can just forget about this
all thing and wait for somebody else to report eventual failures :)

Sandro Santilli <strk>
Project MemberIn charge of this item.
Sun 05 Nov 2006 08:14:57 PM UTC, comment #9:

About substring opcode:
http://sswf.m2osw.com/SWFalexref.html#action_substring

I've fixed handling of your testcases, btw in both head and 0.7.2 branches (implementing automatic cast of strings to String objects and numbers to Number objects when attempting to call methods of them)

Sandro Santilli <strk>
Project MemberIn charge of this item.
Sun 05 Nov 2006 05:57:08 PM UTC, comment #8:

It's exported to SWF 6 (MX). Do you have any info on the opcode? Maybe it must be used like substring(str, 0, 5)...

Can't use any tools before tomorrow afternoon

Udo Giacomozzi <udog>
Project Member
Sun 05 Nov 2006 05:32:55 PM UTC, comment #7:

Nope, that's the same thing.
Maybe the substring opcode will be generated by
setting a target SWF to an older version ?
Can you use 'flasm' to disassemble the swf yourself so
you can directly check ?
You should see a 'substring' opcode listed,
take my first attachment as reference.

Sandro Santilli <strk>
Project MemberIn charge of this item.
Sun 05 Nov 2006 05:25:24 PM UTC, comment #6:

No clue how to generate that opcode, I just took your reference.

The new version (#11167) uses this code:

var str=new String("a_string");

if (str.substring(0, 4) == "a_st")
trace("PASSED:substring(0,4)");
else
trace("FAILED:substring(0,4)");

if (str.substring(-3, 4) == "a_st")
trace("PASSED:substring(-3,4)");
else
trace("FAILED:substring(-3,4)");

if (str.substring(0, -1) == "")
trace("PASSED:substring(0,-1)");
else
trace("FAILED:substring(0,-1)");

if (str.substring(4) == "ring")
trace("PASSED:substring(4)");
else
trace("FAILED:substring(4)");

if (str.substring(16) == "")
trace("PASSED:substring(16)");
else
trace("FAILED:substring(16)");

if (str.substring(-16) == "a_string")
trace("PASSED:substring(-16)");
else
trace("FAILED:substring(-16)");

Udo Giacomozzi <udog>
Project Member
Sun 05 Nov 2006 05:18:45 PM UTC, comment #5:

Nope, that's not using 'substring' opcode:

push 4, -3, 2, 'a_string', 'substring'
callMethod

It's calling the 'substring' method.
(also a bug not finding it, but that's another one)

Sandro Santilli <strk>
Project MemberIn charge of this item.
Sun 05 Nov 2006 05:10:18 PM UTC, comment #4:

Here you are.

ActionScript code for reference:

if ("a_string".substring(0, 4) == "a_st")
trace("PASSED:substring(0,4)");
else
trace("FAILED:substring(0,4)");

if ("a_string".substring(-3, 4) == "a_st")
trace("PASSED:substring(-3,4)");
else
trace("FAILED:substring(-3,4)");

if ("a_string".substring(0, -1) == "")
trace("PASSED:substring(0,-1)");
else
trace("FAILED:substring(0,-1)");

if ("a_string".substring(4) == "ring")
trace("PASSED:substring(4)");
else
trace("FAILED:substring(4)");

if ("a_string".substring(16) == "")
trace("PASSED:substring(16)");
else
trace("FAILED:substring(16)");

if ("a_string".substring(-16) == "a_string")
trace("PASSED:substring(-16)");
else
trace("FAILED:substring(-16)");

Udo Giacomozzi <udog>
Project Member
Sun 05 Nov 2006 01:34:51 PM UTC, comment #3:

What I need is an SWF that contains the 'substring' opcode (0x15)
used in all valid (and some invalid) ways.
For example:

"a_string".substring(0, 4) == ??
"a_string".substring(-3, 4) == ??
"a_string".substring(0, -1) == ??
"a_string".substring(4) == ??
"a_string".substring(16) == ??
"a_string".substring(-16) == ?

...
The ?? should be replaced with the expected
result and the checks should be embedded in a condition
that either triggers trace("FAILED: <statement>") or
trace("PASSED: <statement>")

Sandro Santilli <strk>
Project MemberIn charge of this item.
Sun 05 Nov 2006 12:40:20 PM UTC, comment #2:

I can create any kind of movie you want, just tell me what you need. I don't know what kind of assertion failure this is as I can't run Gnash right now. If you don't want to wait, let me know what exactly you need. A substring test case like in the other bug item?

Udo Giacomozzi <udog>
Project Member
Sun 05 Nov 2006 11:30:56 AM UTC, comment #1:

It turns out that the given string was either NULL or UNDEFINED.
I committed a fix handling this case, but I really think the
whole ActionSubString function needs a complete rewrite driven
by a deep testcase.
Unfortunately Ming seems unable to output such opcode (substring)
replacing it with calls to the substring() method instead.
A complete testcase for 'primitive-string' substring would help
finishing it, anyway, one segfault less for 0.7.2.

REF ming bug:
http://bugs.libming.org/show_bug.cgi?id=6

oh, btw.. if 'base' is 0 there still is a bug.. we really need that testcase. Added Udo for this :)

Sandro Santilli <strk>
Project MemberIn charge of this item.
Sun 05 Nov 2006 10:22:56 AM UTC, original submission:

attached movie triggers an assertion failure

Sandro Santilli <strk>
Project MemberIn charge of this item.

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #11167:  substring-test.swf added by udog (264B - application/x-shockwave-flash - new version)
file #11166:  substring-test.swf added by udog (243B - application/x-shockwave-flash - substring testcase)
file #11164:  load3_82.swf added by strk (17KiB - application/x-shockwave-flash)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 7 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Sun 05 Nov 2006 08:47:22 PM UTCstrkStatusReady For Test=>Fixed
  Open/ClosedOpen=>Closed
Sun 05 Nov 2006 05:24:05 PM UTCudogAttached File-=>Added substring-test.swf, #11167
Sun 05 Nov 2006 05:10:18 PM UTCudogAttached File-=>Added substring-test.swf, #11166
Sun 05 Nov 2006 11:30:56 AM UTCstrkStatusConfirmed=>Ready For Test
  Carbon-Copy-=>Added udog
Sun 05 Nov 2006 10:22:56 AM UTCstrkAttached File-=>Added load3_82.swf, #11164

Back to the top


Powered by Savane 3.1-cleanup1