develooper Front page | perl.perl5.porters | Postings from October 2005

Re: [perl #37190] -DT -e 'use warnings;' crashes

Thread Previous | Thread Next
From:
Dave Mitchell
Date:
October 1, 2005 17:37
Subject:
Re: [perl #37190] -DT -e 'use warnings;' crashes
Message ID:
20051002003751.GX4615@iabyn.com
On Sat, Sep 17, 2005 at 11:31:11AM -0700, Nicholas Clark wrote:
> Using -DT with use warnings; goes bang on OS X. I was able to get "out of
> memory" failures on FreeBSD, but everything works on x86/Linux, at least for
> me. I guess x86/Linux is just lucky - this seems to be a real bug, although
> quite where, I'm not sure.

Fixed by change #25674. My debugging code had made some unwarranted
assumptions about the values of various buffer ptrs at various times.

In fact I've bypassed the problem by completely rejigging the debugging
output. -DT now shows the line number, state and curent buffer at entry to
yylex() rather than showing the buffer at exit. It now also escapes chars
when printing, eg newline is displayed as \n.

It also displays the value of a returned OP_CONST.

The format is a bit more concise, and it prints a blank line after each
return value.

Here's a before and after sample of -DT:

----------------------------------------------------------

Before:

./perl -DT -e'$a=$b+f(3)'
### LEX_NORMAL
### Tokener expecting STATE at [
;]
### <== '$' at line 1 [$a]
### LEX_NORMAL
### Tokener saw identifier '$a'
### <== WORD(opval=op_const) at line 1 [$a]
### LEX_NORMAL
### Tokener expecting OPERATOR at [=$b+f(3)
]
### <== ASSIGNOP(ival=op_null) at line 1 [$a]
### LEX_NORMAL
### Tokener expecting TERM at [$b+f(3)
]
### <== '$' at line 1 [$b]
### LEX_NORMAL
### Tokener saw identifier '$b'
### <== WORD(opval=op_const) at line 1 [$b]
### LEX_NORMAL
### Tokener expecting OPERATOR at [+f(3)
]
### <== ADDOP(ival=op_add) at line 1 [$b]
### LEX_NORMAL
### Tokener expecting TERM at [f(3)
]
### <== '&' at line 1 [f]
### LEX_KNOWNEXT
### Next token after '(3)
' was known, type 258
### <== WORD(opval=op_const) at line 1 [f]
### LEX_NORMAL
### Tokener expecting OPERATOR at [(3)
]
### <== '(' at line 1 [f]
### LEX_NORMAL
### Tokener expecting TERM at [3)
]
### Saw number in ')
'
### <== THING(opval=op_const) at line 1 [3]
### LEX_NORMAL
### Tokener expecting OPERATOR at [)
]
### <== ')' at line 1 [3]
### LEX_NORMAL
### Tokener expecting OPERATOR at [;]
### <== ';' at line 1 [3]
### LEX_NORMAL
### Tokener expecting STATE at []
### Tokener got EOF
### <== EOF at line 1 []

----------------------------------------------------------

After:

./perl -DT -e'$a=$b+f(3)'

### 0:LEX_NORMAL/XSTATE "\n;"
### <== '$'

### 1:LEX_NORMAL/XOPERATOR "=$b+f(3)\n"
### Pending identifier '$a'
### <== WORD(opval=op_const) PV("a"\0)

### 1:LEX_NORMAL/XOPERATOR "=$b+f(3)\n"
### <== ASSIGNOP(ival=op_null)

### 1:LEX_NORMAL/XTERM "$b+f(3)\n"
### <== '$'

### 1:LEX_NORMAL/XOPERATOR "+f(3)\n"
### Pending identifier '$b'
### <== WORD(opval=op_const) PV("b"\0)

### 1:LEX_NORMAL/XOPERATOR "+f(3)\n"
### <== ADDOP(ival=op_add)

### 1:LEX_NORMAL/XTERM "f(3)\n"
### <== '&'

### 1:LEX_KNOWNEXT/XOPERATOR "(3)\n"
### <== WORD(opval=op_const) PV("f"\0)

### 1:LEX_NORMAL/XOPERATOR "(3)\n"
### <== '('

### 1:LEX_NORMAL/XTERM "3)\n"
### Saw number in ")\n"
### <== THING(opval=op_const) IV(3)

### 1:LEX_NORMAL/XOPERATOR ")\n"
### <== ')'

### 1:LEX_NORMAL/XOPERATOR ";"
### <== ';'

### 1:LEX_NORMAL/XSTATE ""
### Tokener got EOF
### <== EOF

----------------------------------------------------------


-- 
"Do not dabble in paradox, Edward, it puts you in danger of fortuitous
wit." -- Lady Croom - Arcadia

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About