pointer being freed was not allocated

Bug #1176038 reported by Paul J. Lucas
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zorba
Fix Released
Critical
Nicolae Brinza

Bug Description

Given this query:

  <a xmlns:prefix="http://www.w3.org/" xmlns:prefix="http://www.w3.org/"/>

one gets:

zorba(54566) malloc: *** error for object 0x7f9c3b488850: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug

Zorba was compiled with:

  cmake -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug ..

This is on a Mac. The stack trace is:

#0 0x00007fff945f9d46 in __kill ()
#1 0x00007fff899a7df0 in abort ()
#2 0x00007fff8997b9b9 in free ()
#3 0x000000010de89319 in zorba::parsenode::~parsenode (this=0x7ffb494887f0) at parsenode_base.h:49
#4 0x000000010dde2ade in zorba::SimpleRCObject::free (this=0x7ffb494887f0) at rchandle.h:144
#5 0x000000010dd9df91 in zorba::SimpleRCObject::removeReference (this=0x7ffb494887f0, lock=0x0) at rchandle.h:154
#6 0x000000010e1748ac in removeReference<zorba::parsenode> (t=0x7ffb494887f0) at rchandle.h:422
#7 0x000000010e18172c in release_hack<zorba::parsenode> (ref=0x7ffb494887f0) at xquery_parser.y:908
#8 0x000000010e177ced in zorba::xquery_parser::yydestruct_ (this=0x7fff51eda988, yymsg=0x0, yytype=529, yyvaluep=0x7ffb49487db8, yylocationp=0x7ffb49487f40) at xquery_parser.y:921
#9 0x000000010e1726ee in zorba::xquery_parser::parse (this=0x7fff51eda988) at /Users/pjl/src/flwor/zorba/repo/bug-1176038/zorba/build/src/compiler/parser/xquery_parser.cpp:11061
#10 0x000000010de46229 in zorba::xquery_driver::parse_stream (this=0x7fff51edaed0, in=@0x7fff51edb0d8, aFilename=@0x7ffb49486438) at /Users/pjl/src/flwor/zorba/repo/bug-1176038/zorba/src/compiler/parser/xquery_driver.cpp:199
#11 0x000000010e108f0c in zorba::XQueryCompiler::parse (this=0x7fff51edb4c0, aXQuery=@0x7ffb49485d80, aFileName=@0x7ffb49486438) at /Users/pjl/src/flwor/zorba/repo/bug-1176038/zorba/src/compiler/api/compiler_api.cpp:230
#12 0x000000010e109af2 in zorba::XQueryCompiler::compile (this=0x7fff51edb4c0, aXQuery=@0x7ffb49485d80, aFileName=@0x7ffb49486438, nextDynamicVarId=@0x7fff51edb5c8) at /Users/pjl/src/flwor/zorba/repo/bug-1176038/zorba/src/compiler/api/compiler_api.cpp:312
#13 0x000000010dd9392d in zorba::XQueryImpl::doCompile (this=0x7ffb494863e0, aQuery=@0x7ffb49485d80, aHints=@0x7fff51edbd38, fork_sctx=true, nextDynamicVarId=@0x7fff51edb5c8) at /Users/pjl/src/flwor/zorba/repo/bug-1176038/zorba/src/api/xqueryimpl.cpp:613
#14 0x000000010dd94334 in zorba::XQueryImpl::compile (this=0x7ffb494863e0, aQuery=@0x7ffb49485d80, aStaticContext=@0x7fff51edcab0, aHints=@0x7fff51edbd38) at /Users/pjl/src/flwor/zorba/repo/bug-1176038/zorba/src/api/xqueryimpl.cpp:541
#15 0x000000010dd28120 in compileAndExecute (zorbaInstance=0x10f6d9d90, properties=@0x7fff51edcf20, staticContext=@0x7fff51edcab0, qfilepath=@0x7fff51edcb90, qfile=@0x7ffb49485d80, outputStream=@0x7fff787d6f10, timing=@0x7fff51edc508) at /Users/pjl/src/flwor/zorba/repo/bug-1176038/zorba/bin/zorbacmd.cpp:776
#16 0x000000010dd2a985 in main (argc=3, argv=0x7fff51edd118) at /Users/pjl/src/flwor/zorba/repo/bug-1176038/zorba/bin/zorbacmd.cpp:1205

Related branches

description: updated
description: updated
description: updated
Changed in zorba:
assignee: nobody → Nicolae Brinza (nbrinza)
Revision history for this message
Paul J. Lucas (paul-lucas) wrote :

$ g++ -v
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.11~67/src/configure --disable-checking --enable-werror --prefix=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.11~67/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)

$ flex --version
flex 2.5.35 Apple(flex-31)

$ bison --version
bison (GNU Bison) 2.7

Changed in zorba:
status: New → Fix Committed
Changed in zorba:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.