memory corruption

R

Roger Pack

Wondering if anybody's had memory corruption with mingw before. This
works fine for VC and for Linux (it's just some base rails code).
Anyway somehow or other it gets corrupted and inserts random bytes into
a "Buffer"

like \000 and EOF and random junk. It occurs in thsi snippet of erb.rb
code. Any help appreciated :)
-Roger


scanner.scan do |token|
if scanner.stag.nil?
pp "token", token
pp "out", out
case token

when PercentLine
out.push("#{@put_cmd} #{content.dump}") if content.size > 0
content = ''
out.push(token.to_s)
out.cr
when :cr
out.cr
when '<%', '<%=', '<%#'
scanner.stag = token
out.push("#{@put_cmd} #{content.dump}") if content.size > 0
content = ''
when "\n"
content << "\n"
out.push("#{@put_cmd} #{content.dump}")
out.cr
content = ''
when '<%%'
content << '<%'
else
content << token
end
else
case token
when '%>'
case scanner.stag
when '<%'
if content[-1] == ?\n
content.chop!
out.push(content)
out.cr
else
out.push(content)
end
when '<%='
out.push("#{@insert_cmd}((#{content}).to_s)")
when '<%#'
# out.push("# #{content.dump}")
end
scanner.stag = nil
content = ''
when '%%>'
content << '%>'
else
content << token
end
end
end
out.push("#{@put_cmd} #{content.dump}") if content.size > 0
pp "out is", out
out.close
out.script
 
R

Roger Pack

Roger said:
Wondering if anybody's had memory corruption with mingw before. This
works fine for VC and for Linux (it's just some base rails code).
Anyway somehow or other it gets corrupted and inserts random bytes into
a "Buffer"

like \000 and EOF and random junk. It occurs in thsi snippet of erb.rb
code. Any help appreciated :)
-Roger

This line turned out to be the culprit. Rmagick on mingw still had a
'legacy' bug of rewriting String.dump poorly. Rewrote it and rails
works now, in case anyone wonders.
Thanks!
-Roger
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top