This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 173248 - com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 2 of 3-byte UTF-8 sequence.
Summary: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: In...
Status: RESOLVED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Petr Pisl
URL: http://statistics.netbeans.org/except...
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-29 10:59 UTC by neuros_nid
Modified: 2011-02-22 08:52 UTC (History)
8 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 133854


Attachments
stacktrace (2.64 KB, text/plain)
2009-09-29 10:59 UTC, neuros_nid
Details

Note You need to log in before you can comment on or make changes to this bug.
Description neuros_nid 2009-09-29 10:59:22 UTC
Build: NetBeans IDE Dev (Build nbms-and-javadoc-4004-on-090928)
VM: Java HotSpot(TM) Client VM, 14.0-b16, Java(TM) SE Runtime Environment, 1.6.0_14-b08
OS: Windows Vista, 6.0, x86

User Comments:
GUEST: Debugging PHP after handy migration from version 6.5

GUEST: ???

GUEST: Debugging PHP each step produce error...

GUEST: I was working on some PHP. My intent was to create a recursive array out of my some maps. You can read about it here: http://stackoverflow.com/questions/952263

So this one guy showed me a function, I tested it out and then this happened.

The function in question is: 

function dirToArray($dir) {
    $contents = array();
    # Foreach node in $dir
    foreach (scandir($dir) as $node) {
        # Skip link to current and parent folder
        if ($node == '.')  continue;
        if ($node == '..') continue;
        # Check if it's a node or a folder
        if (is_dir($dir . DIRECTORY_SEPARATOR . $node)) {
            # Add directory recursively, be sure to pass a valid path
            # to the function, not just the folder's name
            $contents[$node] = dirToArray($dir . DIRECTORY_SEPARATOR . $node);
        } else {
            # Add node, the keys will be updated automatically
            $contents[] = $node;
        }
    }
    # done
    return $contents;
}


And that's al

neuros_nid: Stopping on a breakpoint while debugging PHP code



Stacktrace: 
com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 2 of 3-byte UTF-8 sequence.
        at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte(UTF8Reader.java:684)
        at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(UTF8Reader.java:405)
        at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(XMLEntityScanner.java:1742)
        at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.scanLiteral(XMLEntityScanner.java:1064)
        at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanAttributeValue(XMLScanner.java:974)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanAttribute(XMLDocumentFragmentScannerImpl.java:1539)
Comment 1 neuros_nid 2009-09-29 10:59:28 UTC
Created attachment 88495 [details]
stacktrace
Comment 2 Exceptions Reporter 2009-09-29 10:59:32 UTC
This issue already has 22 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=133854
Comment 3 Exceptions Reporter 2009-09-29 11:06:29 UTC
This issue already has 23 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=133854
Comment 4 rmatous 2009-09-29 12:02:19 UTC
Probably problem in xdebug. See related issue in xdebug
http://bugs.xdebug.org/view.php?id=421

So, needs to fixed in xdebug not in netbeans, but  keeping it open as reminder 
Comment 5 Filip Zamboj 2010-09-15 12:30:11 UTC
batch reassigning
Comment 6 Marian Mirilovic 2011-01-14 15:37:02 UTC
115 dups and still rising
Comment 7 Petr Pisl 2011-02-16 14:39:07 UTC
I have fixed similar issue #170309 . The solution for this issue should cover also this problem. There is no exception report from a build after the fix.

This is hart to reproduce, could someone who can reproduce, check it?
Comment 8 insanio 2011-02-17 03:50:29 UTC
(In reply to comment #7)
> I have fixed similar issue #170309 . The solution for this issue should cover
> also this problem. There is no exception report from a build after the fix.
> 
> This is hart to reproduce, could someone who can reproduce, check it?

How to update NB7b to check fix? Re-download?
Comment 9 Petr Pisl 2011-02-17 13:59:00 UTC
You can download the daily builds here: http://bits.netbeans.org/download/trunk/nightly/latest/

or today was published Beta2 that contains the fix as well.
Comment 10 insanio 2011-02-22 03:42:22 UTC
(In reply to comment #9)
> You can download the daily builds here:
> http://bits.netbeans.org/download/trunk/nightly/latest/
> 
> or today was published Beta2 that contains the fix as well.

Ah, ok. 

Beta2 seems works fine, except dialog: "This file cannot be safely opened with encoding UTF8. Do you want to continue opening it?". Slightly annoying, but I will survive.

I work with Beta2 2 days and no exceptions. Thanks! Great work!
Comment 11 Petr Pisl 2011-02-22 08:52:05 UTC
We don't need to reopen this bug. It would be better to create new one (probably P3) and describe the behavior. It would be great to have a reproducible test case.