Strange issue with TXMLConfig

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Strange issue with TXMLConfig

Darius Blaszyk
All of a sudden I get a crash in my app trying to read a path from an XML file. The crash comes from the function TDOMNamedNodeMap.Find that crashes on this line: 

C := TDOMNode(FList.List^[I]).CompareName(name);

The strange thing is that a simplified example app does not crash! In any case I'm 100% sure the path exists and either way even if it didn't XMLConfig should not crash. The message form the lazarus code inspector is: Type TDOMNODE has no component named COMPARENAME.The code also never reaches the CompareName function when I set a breakpoint.

I'm at a loss. Is any one capable to understand what is happening?

Rgds, Darius


My code is:

    c := cache.GetValue('filelist/item_1/crc', 0);

The XML is:

<?xml version="1.0" encoding="utf-8"?>
<CONFIG>
  <filelist type="filecache" count="1">
    <item_1 crc="30150" filename="C:\myfile.txt"/>
  </filelist>
</CONFIG>

The BT is:

An unhandled exception occurred at $0000000100033BA4:
EAccessViolation: Access violation
  $0000000100033BA4 line 1783 of fcl-xml/src/dom.pp
  $0000000100033C75 line 1802 of fcl-xml/src/dom.pp
  $000000010003707D line 3159 of fcl-xml/src/dom.pp
  $000000010002EC28 line 195 of xmlconf.pp

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Strange issue with TXMLConfig

vojtech.cihak

Hi, I can only say that TDOMNode from Laz2_DOM in trunk has function CompareName.

 

V.

______________________________________________________________
> Od: Darius Blaszyk <[hidden email]>
> Komu: FPC-Pascal users discussions <[hidden email]>
> Datum: 18.01.2018 00:11
> Předmět: [fpc-pascal] Strange issue with TXMLConfig
>

All of a sudden I get a crash in my app trying to read a path from an XML file. The crash comes from the function TDOMNamedNodeMap.Find that crashes on this line: 

C := TDOMNode(FList.List^[I]).CompareName(name);

The strange thing is that a simplified example app does not crash! In any case I'm 100% sure the path exists and either way even if it didn't XMLConfig should not crash. The message form the lazarus code inspector is: Type TDOMNODE has no component named COMPARENAME.The code also never reaches the CompareName function when I set a breakpoint.

I'm at a loss. Is any one capable to understand what is happening?

Rgds, Darius


My code is:

    c := cache.GetValue('filelist/item_1/crc', 0);

The XML is:

<?xml version="1.0" encoding="utf-8"?>
<CONFIG>
  <filelist type="filecache" count="1">
    <item_1 crc="30150" filename="C:\myfile.txt"/>
  </filelist>
</CONFIG>

The BT is:

An unhandled exception occurred at $0000000100033BA4:
EAccessViolation: Access violation
  $0000000100033BA4 line 1783 of fcl-xml/src/dom.pp
  $0000000100033C75 line 1802 of fcl-xml/src/dom.pp
  $000000010003707D line 3159 of fcl-xml/src/dom.pp
  $000000010002EC28 line 195 of xmlconf.pp


----------

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Strange issue with TXMLConfig

vojtech.cihak
In reply to this post by Darius Blaszyk

The second TDOMNode from unit DOM (fcl-xml) has that function too, in FPC 3.0.4.

V.

______________________________________________________________
> Od: Vojtěch Čihák <[hidden email]>
> Komu: FPC-Pascal users discussions
> Datum: 18.01.2018 00:30
> Předmět: Re: [fpc-pascal] Strange issue with TXMLConfig
>

Hi, I can only say that TDOMNode from Laz2_DOM in trunk has function CompareName.

 

V.

______________________________________________________________
> Od: Darius Blaszyk <[hidden email]>
> Komu: FPC-Pascal users discussions <[hidden email]>
> Datum: 18.01.2018 00:11
> Předmět: [fpc-pascal] Strange issue with TXMLConfig
>


----------

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

----------

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Strange issue with TXMLConfig

Darius Blaszyk
> Hi, I can only say that TDOMNode from Laz2_DOM in trunk has function
> CompareName.

I'm using FPC 3.0.4 indeed. No dependency to the LCL.

Darius
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Strange issue with TXMLConfig

vojtech.cihak
In reply to this post by vojtech.cihak

Hmm, I remember there are two ways how to work with XML: Laz2_xxx and fcl-xml. My idea was that you got some wrong TDOMNode in the path.

V.

______________________________________________________________
> Od: Darius Blaszyk <[hidden email]>
> Komu: FPC-Pascal users discussions <[hidden email]>
> Datum: 18.01.2018 20:31
> Předmět: Re: [fpc-pascal] Strange issue with TXMLConfig
>

> Hi, I can only say that TDOMNode from Laz2_DOM in trunk has function
> CompareName.

I'm using FPC 3.0.4 indeed. No dependency to the LCL.

Darius
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Strange issue with TXMLConfig

Mattias Gaertner
In reply to this post by Darius Blaszyk
On Thu, 18 Jan 2018 20:31:20 +0100
Darius Blaszyk <[hidden email]> wrote:

> > Hi, I can only say that TDOMNode from Laz2_DOM in trunk has function
> > CompareName.  
>
> I'm using FPC 3.0.4 indeed. No dependency to the LCL.

Laz2_DOM is in LazUtils, not in the LCL.

Mattias
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal