Euphoria Ticket #826: Euphoria 4.1 Linux 64 bits crashes during recursion

Hi,

Euphoria crashes during recursion with a wrong message:

html_parser.e:231 in function scanTag()  
subscript value 2 is out of bounds, assigning to a sequence of length 1  
The part of code which is executed is the following:

158  public function scanTag(integer f_out) 
 
230          analyzeSequence(section, "section", f_out) 
231          section[$] = append(section[$], scanTag(f_out) ) 
 
238    return section 
239  end function 

Euphoria tells me it couldn't append to section[$] but this is wrong: it did the job!

Before the crash (after executing line 230)

section[1][1] = 'a' 
section[1][2][1] = 'href="http://s.s/search?q=abiquo+%22openstack+compute%22?page=1&expansion=1&engines=google&lang=en&ui=stat"' 

After the crash (crash routine)

section[1][1] = 'a' 
section[1][2][1] = 'href="http://s.s/search?q=abiquo+%22openstack+compute%22?page=1&expansion=1&engines=google&lang=en&ui=stat"' 
section[1][3][1][1] = 'TEXT' 
section[1][3][1][2] = ' ' 

Regards

Jean-Marc

Details

Type: Bug Report Severity: Normal Category: Interpreter
Assigned To: unknown Status: Invalid Reported Release: v4.1.0 development x64
Fixed in SVN #: View VCS: none Milestone:

1. Comment by jmduro Dec 12, 2012

This happens on KUbuntu 12.04 LTS with eui Revision Date: 2012-11-13 01:38:17, Id: 5838:c4cf83a3db32

2. Comment by jmduro Dec 13, 2012

Same problem occurs with euphoria_4.0.5_amd64.deb. Nota: I use the modified version of http.e to use set_proxy() function. I don't think this can cause the crash, but it might be important to notice.

3. Comment by jmduro Dec 13, 2012

I think I got the trick: in section[$], $ does not refer to the correct length. It has not been updated correctly when returning from the recursive call. Regards Jean-Marc

4. Comment by jmduro Dec 13, 2012

I found the error: it was mine.

Variable section was defined outside of the recursive function, that's why section[$] did not have the right value!

There is no bug. Mea Culpa, ...

Regards

Jean-Marc

Search



Quick Links

User menu

Not signed in.

Misc Menu