<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>6791</bug_id>
          
          <creation_ts>2009-04-08 14:04:13 +0000</creation_ts>
          <short_desc>Crash on generic XML file</short_desc>
          <delta_ts>2009-04-10 09:26:26 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Amaya</product>
          <component>XML</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Magnus Henoch">magnus.henoch+w3bugzilla</reporter>
          <assigned_to name="lcarcone">carcone</assigned_to>
          <cc>carcone</cc>
    
    <cc>emilien.kia</cc>
    
    <cc>fred.wang</cc>
    
    <cc>Irene.Vatton</cc>
    
    <cc>vincent.quint</cc>
          
          <qa_contact name="lcarcone">carcone</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>24622</commentid>
    <comment_count>0</comment_count>
      <attachid>681</attachid>
    <who name="Magnus Henoch">magnus.henoch+w3bugzilla</who>
    <bug_when>2009-04-08 14:04:13 +0000</bug_when>
    <thetext>Created attachment 681
File that crashes Amaya

I just compiled Amaya from CVS, and tried to open the attached XML file.  This results in a segfault, with the following backtrace:

#0  0xb71cd18a in strcmp () from /lib/libc.so.6
#1  0x08173cd4 in EndOfAttributeName (xmlName=0xa867328 &quot;a|a&quot;) at ../../amaya/Xml2thot.c:3182
#2  0x08174b29 in Hndl_ElementStart (userData=0x0, name=0xa8894cf &quot;b&quot;, attlist=0xa888a90) at ../../amaya/Xml2thot.c:4446
#3  0xb7f96aaa in ?? () from /usr/lib/libxmlparse.so.0
#4  0xb7f97fe9 in ?? () from /usr/lib/libxmlparse.so.0
#5  0xb7f94012 in XML_Parse () from /usr/lib/libxmlparse.so.0
#6  0x0816fb4e in XmlParse (infile=0xa880bb0, charset=UNDEFINED_CHARSET, xmlDec=0xbfffadeb, xmlDoctype=0xbfffadea) at ../../amaya/Xml2thot.c:5924
#7  0x08175760 in StartXmlParser (doc=1, fileName=0xa881c90 &quot;/home/magnus/.amaya/1/foo.xml&quot;, documentName=0x9d61298 &quot;foo.xml&quot;, documentDirectory=0x9d62260 &quot;/home/magnus/.amaya/1&quot;, pathURL=0xa881640 &quot;/tmp/foo.xml&quot;, withDec=false, withDoctype=false, useMath=false, externalDoc=false) at ../../amaya/Xml2thot.c:6087
#8  0x081480bf in LoadDocument (doc=1, pathname=0xa881640 &quot;/tmp/foo.xml&quot;, form_data=0x0, initial_url=0x9d59550 &quot;/tmp/foo.xml&quot;, method=8, tempfile=0xa881968 &quot;&quot;, documentname=0x9d61298 &quot;foo.xml&quot;, http_headers=0x0, history=false, inNewWindow=0xbfffbb77, realdocname=0x0) at ../../amaya/init.c:3878
#9  0x0814842c in GetAmayaDoc_callback (newdoc=1, status=0, urlName=0x9d61c10 &quot;/tmp/foo.xml&quot;, outputfile=0x9d618e8 &quot;&quot;, proxyName=0x0, http_headers=0x0, context=0x9d5aef8) at ../../amaya/init.c:4811
#10 0x081496c9 in GetAmayaDoc (urlname=0xbfffc668 &quot;/tmp/foo.xml&quot;, form_data=0x0, doc=0, baseDoc=0, method=8, history=false, cbf=0, ctx_cbf=0x0) at ../../amaya/init.c:5323
#11 0x08149bd0 in CallbackDialogue (ref=37310, typedata=1, data=0x1 &lt;Address 0x1 out of bounds&gt;) at ../../amaya/init.c:5602
#12 0x0814bbee in OpenNewDocFromArgv (url=0x99c4998 &quot;/tmp/foo.xml&quot;) at ../../amaya/init.c:7222
#13 0x0814e033 in InitAmaya (event=0xbfffce24) at ../../amaya/init.c:7130
#14 0x082f6678 in CallAction (notifyEvent=0xbfffce24, event=TteInit, pre=false, type=0, element=0x0, schStruct=0x0, attr=false) at ../../thotlib/dialogue/callback.c:174
#15 0x082f691b in CallEventType (notifyEvent=0xbfffce24, pre=false) at ../../thotlib/dialogue/callback.c:335
#16 0x083066fd in TtaMainLoop () at ../../thotlib/dialogue/interface.c:174
#17 0x080d959c in amaya_main (argc=2, argv=0x99c2610) at EDITORAPP.c:1667
#18 0x082a289b in AmayaApp::OnIdle (this=0x996f658, event=@0xbfffef38) at ../../thotlib/base/AmayaApp.cpp:463
#19 0xb744aaf1 in wxAppConsole::HandleEvent(wxEvtHandler*, void (wxEvtHandler::*)(wxEvent&amp;), wxEvent&amp;) const () from /usr/lib/libwx_baseu-2.8.so.0
#20 0xb74e9d2a in wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase const&amp;, wxEvtHandler*, wxEvent&amp;) () from /usr/lib/libwx_baseu-2.8.so.0
#21 0xb74eaf44 in wxEventHashTable::HandleEvent(wxEvent&amp;, wxEvtHandler*) () from /usr/lib/libwx_baseu-2.8.so.0
#22 0xb74eb04b in wxEvtHandler::ProcessEvent(wxEvent&amp;) () from /usr/lib/libwx_baseu-2.8.so.0
#23 0xb77bd8d2 in wxAppBase::ProcessIdle() () from /usr/lib/libwx_gtk2u_core-2.8.so.0
#24 0xb770c8f3 in ?? () from /usr/lib/libwx_gtk2u_core-2.8.so.0
#25 0xb68e6a71 in ?? () from /usr/lib/libglib-2.0.so.0
#26 0xb68e89a8 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#27 0xb68ec063 in ?? () from /usr/lib/libglib-2.0.so.0
#28 0xb68ec582 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
#29 0xb6ce2239 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#30 0xb77264f5 in wxEventLoop::Run() () from /usr/lib/libwx_gtk2u_core-2.8.so.0
#31 0xb77bd6be in wxAppBase::MainLoop() () from /usr/lib/libwx_gtk2u_core-2.8.so.0
#32 0xb77bd291 in wxAppBase::OnRun() () from /usr/lib/libwx_gtk2u_core-2.8.so.0
#33 0xb74846ba in wxEntry(int&amp;, wchar_t**) () from /usr/lib/libwx_baseu-2.8.so.0
#34 0xb74848b7 in wxEntry(int&amp;, char**) () from /usr/lib/libwx_baseu-2.8.so.0
#35 0x082a462b in main (argc=6357089, argv=0xa534670) at ../../thotlib/base/AmayaApp.cpp:51</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>24623</commentid>
    <comment_count>1</comment_count>
      <attachid>682</attachid>
    <who name="Magnus Henoch">magnus.henoch+w3bugzilla</who>
    <bug_when>2009-04-08 14:07:28 +0000</bug_when>
    <thetext>Created attachment 682
Don&apos;t pass NULL to strcmp

This patch makes Amaya load the file.  Not sure if this is the right change; should UriName really be NULL here?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>24643</commentid>
    <comment_count>2</comment_count>
    <who name="Vatton">Irene.Vatton</who>
    <bug_when>2009-04-10 09:26:26 +0000</bug_when>
    <thetext>(In reply to comment #0)
&gt; Created an attachment (id=681) [details]
&gt; File that crashes Amaya

The main problem is that a prefix is used but it&apos;s not defined.
Amaya won&apos;t crash when parsing that kind of document.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>681</attachid>
            <date>2009-04-08 14:04:13 +0000</date>
            <delta_ts>2009-04-08 14:04:13 +0000</delta_ts>
            <desc>File that crashes Amaya</desc>
            <filename>foo.xml</filename>
            <type>application/xml</type>
            <size>79</size>
            <attacher name="Magnus Henoch">magnus.henoch+w3bugzilla</attacher>
            
              <data encoding="base64">PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPGE6YSB4bWxuczphPSJhIj4K
ICA8eiBhOmE9ImEiLz4KPC9hOmE+Cg==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>682</attachid>
            <date>2009-04-08 14:07:28 +0000</date>
            <delta_ts>2009-04-08 14:07:28 +0000</delta_ts>
            <desc>Don&apos;t pass NULL to strcmp</desc>
            <filename>Xml2thot.c.patch</filename>
            <type>text/plain</type>
            <size>1175</size>
            <attacher name="Magnus Henoch">magnus.henoch+w3bugzilla</attacher>
            
              <data encoding="base64">SW5kZXg6IGFtYXlhL1htbDJ0aG90LmMKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQpSQ1MgZmlsZTogL3NvdXJjZXMvcHVi
bGljL0FtYXlhL2FtYXlhL1htbDJ0aG90LmMsdgpyZXRyaWV2aW5nIHJldmlzaW9uIDEuNDc3CmRp
ZmYgLWMgLXIxLjQ3NyBYbWwydGhvdC5jCi0tLSBhbWF5YS9YbWwydGhvdC5jCTcgQXByIDIwMDkg
MTI6Mjc6MzggLTAwMDAJMS40NzcKKysrIGFtYXlhL1htbDJ0aG90LmMJOCBBcHIgMjAwOSAxNDox
MDo1MiAtMDAwMApAQCAtMjgyLDcgKzI4MiwxMiBAQAogCiAgIHdoaWxlICghZm91bmQgJiYgQ3Vy
cmVudFBhcnNlckN0eHQgIT0gTlVMTCkKICAgICB7Ci0gICAgICBpZiAoIXN0cmNtcCAoQ3VycmVu
dFBhcnNlckN0eHQtPlVyaU5hbWUsIFRlbXBsYXRlX1VSSSkpCisgICAgICBpZiAoIUN1cnJlbnRQ
YXJzZXJDdHh0LT5VcmlOYW1lKQorICAgICAgICB7CisgICAgICAgICAgLyogSWYgVXJpTmFtZSBp
cyBOVUxMLCBub25lIG9mIHRoZSBiZWxvdyBjYXNlcyBjb3VsZCBtYXRjaC4KKyAgICAgICAgICAg
ICBQcmV2ZW50IGEgc2VnZmF1bHQgYnkgbm90IGNvbXBhcmluZy4gKi8KKyAgICAgICAgfQorICAg
ICAgZWxzZSBpZiAoIXN0cmNtcCAoQ3VycmVudFBhcnNlckN0eHQtPlVyaU5hbWUsIFRlbXBsYXRl
X1VSSSkpCiAgICAgICAgIHsKICAgICAgICAgICAvKiBUZW1wbGF0ZXMgKi8KICAgICAgICAgICBp
ZiAoIXN0cmNtcCAoKGNoYXIgKil1cmlOYW1lLCBUZW1wbGF0ZV9VUkkpIHx8CkBAIC0zMTc5LDcg
KzMxODQsNyBAQAogICAgICAgICAgIGF0dHJOYW1lID0gKGNoYXIgKilUdGFTdHJkdXAgKChjaGFy
ICopcHRyKTsKICAgICAgICAgICBpZiAoVW5rbm93bk5TKQogICAgICAgICAgICAgQ3VycmVudFBh
cnNlckN0eHQgPSBOVUxMOwotICAgICAgICAgIGlmIChDdXJyZW50UGFyc2VyQ3R4dCAmJgorICAg
ICAgICAgIGlmIChDdXJyZW50UGFyc2VyQ3R4dCAmJiBDdXJyZW50UGFyc2VyQ3R4dC0+VXJpTmFt
ZSAmJgogICAgICAgICAgICAgICBzdHJjbXAgKChjaGFyICopbnNVUkksIChjaGFyICopQ3VycmVu
dFBhcnNlckN0eHQtPlVyaU5hbWUpICYmCiAgICAgICAgICAgICAgIENoYW5nZVhtbFBhcnNlckNv
bnRleHRCeVVyaSAobnNVUkkpKQogICAgICAgICAgICAgewo=
</data>

          </attachment>
      

    </bug>

</bugzilla>