Pratik Singh Bisht created XALANC-785:
-----------------------------------------

             Summary: XalanTransformer::Transform gives malloc error after 
building with libc++ on OSX 10.9
                 Key: XALANC-785
                 URL: https://issues.apache.org/jira/browse/XALANC-785
             Project: XalanC
          Issue Type: Bug
          Components: XalanC
    Affects Versions: 1.11
         Environment: Build and Execution: OS X 10.14, 10.12, 10.9
XCode version: 9.4, 8.3, 6.2
            Reporter: Pratik Singh Bisht
            Assignee: Gary Gregory


We are using Xalan and Xerces C++ libraries for XML transformation and parsing.
It had been working flawlessly till our 10.8 OS X support (with libstdc++ as 
standard library). Recently we upgraded our project to support target OSX 10.9 
with base SDK 10.12 and added C++11 support as well building it on OSX 10.14 
with XCode 9.4.
Since in XCode, C++11 support is only available with libc++, we had to rebuilt 
all the dependencies with C++11 to ensure ABI compatibility. But the Xalan 
binaries (built through runconfigure script) are crashing after rebuilding with 
libc++ and C++11 support flags.
The location is always Xalan Transformer::transform() API. I tried debugging 
with help of malloc guards and stepped through inside the Xalan code as well 
but the memory for which crash occurs is internally allocated in Xalan code and 
has no relation to input parameters.

Below is the call stack:

#0      0x00007fff879bd866 in __pthread_kill ()
#1      0x00007fff8cc3535c in pthread_kill ()
#2      0x00007fff8e63fb1a in abort ()
#3      0x00007fff91e4d690 in szone_error ()
#4      0x00007fff91e4ed95 in small_free_list_remove_ptr ()
#5      0x00007fff91e4b443 in szone_free_definite_size ()
#6      0x00000001011bd487 in xercesc_3_1::MemoryManagerImpl::deallocate(void*) 
()
#7      0x0000000100d7e539 in 
xalanc_1_11::ArenaAllocator<xalanc_1_11::XalanDOMString, 
xalanc_1_11::ArenaBlock<xalanc_1_11::XalanDOMString, unsigned long> >::reset() 
()
#8      0x0000000100d82062 in xalanc_1_11::XalanDOMStringPool::clear() ()
#9      0x0000000100e8088f in 
xalanc_1_11::StylesheetConstructionContextDefault::reset() ()
#10     0x0000000100e80329 in 
xalanc_1_11::StylesheetConstructionContextDefault::~StylesheetConstructionContextDefault()
 ()
#11     0x0000000100ed0559 in 
xalanc_1_11::XalanTransformer::doTransform(xalanc_1_11::XalanParsedSource 
const&, xalanc_1_11::XalanCompiledStylesheet const*, 
xalanc_1_11::XSLTInputSource const*, xalanc_1_11::XSLTResultTarget const&) ()
#12     0x0000000100ece2ad in 
xalanc_1_11::XalanTransformer::transform(xalanc_1_11::XSLTInputSource const&, 
xalanc_1_11::XSLTInputSource const&, xalanc_1_11::XSLTResultTarget const&) ()


And error:
malloc: *** error for object 0x103831c08: incorrect checksum for freed object - 
object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug


NOTE: Surprisingly the code executes on OSX 10.14 without any issue



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to