[ 
https://issues.apache.org/jira/browse/XERCESC-2179?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16991923#comment-16991923
 ] 

martin goodall commented on XERCESC-2179:
-----------------------------------------

At this point, I agree the suggested changes are not the solution and the fault 
causing the random seg. is elsewhere in the code. FYI, I converted my code to 
use ICU instead of Win transcode and the seg happened in a similar fashion with 
ICU on the stack instead of Win Transcode, but at the same memory handling 
locations.

I have managed to work around the issue and have no more time to look at the 
reported problem of a random seg, but the following information points to where 
the problem is:-

 

Segment violation scenario.

program is multithreaded, but all Xerces usage is protected by a mutex 
semaphore, so only one instance of Xerces is ever processing at once.

code performs (in thread)

1) request mutex

2) initialize Xerces

3) parse/process Xerces

4) terminate Xerces

5) release mutex

 

 

workaround scenario.

program is multithreaded, but all Xerces usage is protected by a mutex 
semaphore, so only one instance of Xerces is ever processing at once.

1{color:#172b4d}) after main function, initialize Xerces{color}

 

code performs (in thread)

2) request mutex

3) parse/process Xerces (keep handles alive and reuse for duration of the 
thread)

4) release mutex

 

after all threads finish...

{color:#172b4d}5) in main function, terminate Xerces{color}

 

{color:#172b4d}The web/documentation suggests both senarios should be valid 
ways to code but the first causes random segs. This means that the Xerces 
terminate function cannot be resetting all the globals/variables back to their 
initial state.{color}

{color:#172b4d}I hope the info is useful and sorry I haven't had the time to 
track down the actual issue.{color}

 

{color:#172b4d}mart{color}

 

 

 

 

> access violation in win32transservice.cpp with 64 bit compile
> -------------------------------------------------------------
>
>                 Key: XERCESC-2179
>                 URL: https://issues.apache.org/jira/browse/XERCESC-2179
>             Project: Xerces-C++
>          Issue Type: Bug
>          Components: DOM
>    Affects Versions: 3.2.2
>            Reporter: martin goodall
>            Assignee: Alberto Massari
>            Priority: Blocker
>             Fix For: 3.2.3
>
>         Attachments: Win32TransService.cpp
>
>
> calls to ::Reg... to get registry info are passing in stack variables that 
> are 8 bytes long into functions that overwrite 16 bytes, causing memory 
> overwrite and very random segs.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org

Reply via email to