Re: [xml] Anyone else having problems with Sun Workshop?



I just tried RTLD_LOCAL or'ed with both RTLD_NOW and RTLD_LAZY.  Both gave me
the same problem.

Basically, it was my fault.  I was using some of the same symbol names in
my locally scoped variables as in the library.  I didn't think it would matter,
but it did.  

(GCC worked, but I can easily see how the problem happened).

The problem was with the doValidityCheckingDefaultValue.  I wanted to set
it to one.  So, first, I made an integer pointer, and pointed it to
the library's symbol:

xmlDoValidityCheckingDefaultValue = (int *)
                 dlsym(handle, "xmlDoValidityCheckingDefaultValue");
*xmlDoValidityCheckingDefaultValue=1; /* and, set it to one */

This worked fine . . . . under gcc.

Under Solaris, since xmlDoValidityChecking was a global in both scopes, when
libxml examined the variable, sometimes it got it's own global (set to one),
and sometimes it got my pointer (set to an address).

Personally, I solved the problem by putting all of my function/variable
pointers into a structure.  The code is cleaner this way anyway.

Anyway, live and learn,


Dave


On Wed, Jun 06, 2001 at 02:46:55PM +0100, Gary Pennington wrote:
I'm not an expert in this area, but a quick perusal of the man page for dlopen() indicates that you should 
get
the result you want if you or RTLD_LOCAL into the mode parameters.

In other words, I don't think it's the Solaris linker that's broken, but your code may be.

Gary

David Frascone wrote:

I found it.  It was solaris' BRAIN DEAD linker.

Basically, I'm doing a dlopen on the library, and mapping the internal
functions that I call to local function pointers.  But, for some reason,
the Solaris linker doesn't like me to use the same names for my pointers
as the ones used in the library.

Live and learn.

libxml is working for me now.

-Dave

On Tue, Jun 05, 2001 at 01:57:41PM -0500, David Frascone wrote:
On Tue, Jun 05, 2001 at 02:54:42PM -0400, Daniel Veillard wrote:
On Tue, Jun 05, 2001 at 01:49:00PM -0500, David Frascone wrote:
program terminated by signal SEGV (no mapping at the fault address)
Current function is startElement
 1067     ctxt->valid &= xmlValidateRoot(&ctxt->vctxt, ctxt->myDoc);
(/ws/on81-tools/SUNWspro/SC6.1/bin/../WS6U1/bin/sparcv9/dbx) where
  [1] 0x22da0(0x35e8c, 0x349a0, 0x0, 0x0, 0x0, 0x0), at 0x22d9f
=>[2] startElement(ctx = 0x35e20, fullname = 0x22f78 "dictionary", atts = (nil)), line 1067 in 
"SAX.c"

  Nothing abnormal to me. If it crashes there, this would mean
ctxt has been corrupted, no really I don't have a clue. Someone
will have to debug this.


Easy enough:

(/ws/on81-tools/SUNWspro/SC6.1/bin/../WS6U1/bin/sparcv9/dbx) print *ctx
*ctx = (void)
(/ws/on81-tools/SUNWspro/SC6.1/bin/../WS6U1/bin/sparcv9/dbx) print ctx
ctx = 0x35e20
(/ws/on81-tools/SUNWspro/SC6.1/bin/../WS6U1/bin/sparcv9/dbx) frame 3
Current function is xmlParseStartTag
 6141           ctxt->sax->startElement(ctxt->userData, name, atts);
(/ws/on81-tools/SUNWspro/SC6.1/bin/../WS6U1/bin/sparcv9/dbx) print *ctxt
*ctxt = {
    sax               = 0x35f38
    userData          = 0x35e20
    myDoc             = 0x349a0
    wellFormed        = 1
    replaceEntities   = 0
    version           = 0x35b40 "1.0"
    encoding          = (nil)
    standalone        = -1
    html              = 0
    input             = 0x36040
    inputNr           = 1
    inputMax          = 5
    inputTab          = 0x27538
    node              = 0x34ba0
    nodeNr            = 1
    nodeMax           = 10
    nodeTab           = 0x35fb0
    record_info       = 0
    node_seq          = {
        maximum = 0
        length  = 0
        buffer  = (nil)
    }
    errNo             = 0
    hasExternalSubset = 1
    hasPErefs         = 0
    external          = 1
    valid             = 1
    validate          = -14480968
    vctxt             = {
        userData  = 0x35e20
        error     = 0xff13eb50 = &xmlParserValidityError()
        warning   = 0xff13ed00 = &xmlParserValidityWarning()
        node      = (nil)
        nodeNr    = 0
        nodeMax   = 0
        nodeTab   = (nil)
        finishDtd = 0
        doc       = 0x349a0
        valid     = 1
        vstate    = (nil)
        vstateNr  = 0
        vstateMax = 0
        vstateTab = (nil)
    }
    instate           = XML_PARSER_CONTENT
    token             = 0
    directory         = 0x27578 "/home/dfrascon/work/xml"
    name              = (nil)
    nameNr            = 0
    nameMax           = 10
    nameTab           = 0x35fe0
    nbChars           = 540
    checkIndex        = 0
    keepBlanks        = 0
    disableSAX        = 0
    inSubset          = 0
    intSubName        = 0x22f00 "dictionary"
    extSubURI         = 0x349f8 "avp.dtd"
    extSubSystem      = (nil)
    space             = 0x36014
    spaceNr           = 2
    spaceMax          = 10
    spaceTab          = 0x36010
    depth             = 0
    entity            = 0x34be8
    charset           = 1
    nodelen           = 0
    nodemem           = -1
    pedantic          = 0
    _private          = (nil)
    loadsubset        = 0
}
(/ws/on81-tools/SUNWspro/SC6.1/bin/../WS6U1/bin/sparcv9/dbx)


_______________________________________________
xml mailing list
xml gnome org
http://mail.gnome.org/mailman/listinfo/xml


_______________________________________________
xml mailing list
xml gnome org
http://mail.gnome.org/mailman/listinfo/xml





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]