errors casting to xs:dateTimeStamp

Bug #1158975 reported by Till Westmann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zorba
Fix Released
Critical
Till Westmann

Bug Description

I think that I've found 2 problems casting to xs:dateTimeStamp:

1) This query

let $dt := xs:dateTime("2013-01-13T12:01:53+01:00")
let $dts := $dt cast as xs:dateTimeStamp
return
  $dts instance of xs:dateTimeStamp

return false

2) This query

xs:dateTime("2013-01-13T12:01:53") cast as xs:dateTimeStamp

causes a segfault.

Tags: dates segfault

Related branches

Changed in zorba:
assignee: nobody → Cezar Andrei (cezar-andrei)
importance: Undecided → Critical
Revision history for this message
Cezar Andrei (cezar-andrei) wrote :

The second query is a bug in the optimizer, see stack below. I'm assigning this to Markos while I'm still working on the first query.

==6659== Memcheck, a memory error detector
==6659== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==6659== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==6659== Command: ./zorba/build/bin/zorba -f -q e.xq
==6659==
==6659== Invalid read of size 8
==6659== at 0x56F2FA4: zorba::store::Item::isError() const (item.h:177)
==6659== by 0x56F1368: zorba::execute(zorba::CompilerCB*, zorba::expr*, zorba::store::ItemHandle<zorba::store::Item>&) (fold_rules.cpp:483)
==6659== by 0x56F0FEB: zorba::FoldConst::apply(zorba::RewriterContext&, zorba::expr*, bool&) (fold_rules.cpp:408)
==6659== by 0x56DB24D: zorba::RuleMajorDriver::rewrite(zorba::RewriterContext&) (rule_driver.cpp:63)
==6659== by 0x56DC85E: zorba::DefaultOptimizer::rewrite(zorba::RewriterContext&) (default_optimizer.cpp:95)
==6659== by 0x57190E9: zorba::XQueryCompiler::optimize(zorba::expr*) (compiler_api.cpp:375)
==6659== by 0x5718D2B: zorba::XQueryCompiler::compile(zorba::rchandle<zorba::parsenode> const&, bool, unsigned long&, zorba::audit::ScopedRecord&) (compiler_api.cpp:275)
==6659== by 0x5718BAB: zorba::XQueryCompiler::compile(std::istream&, zorba::rstring<zorba::rstring_classes::rep<zorba::atomic_int, std::char_traits<char>, std::allocator<char> > > const&, unsigned long&) (compiler_api.cpp:241)
==6659== by 0x549A4E2: zorba::XQueryImpl::doCompile(std::istream&, Zorba_CompilerHints const&, bool, unsigned long&) (xqueryimpl.cpp:611)
==6659== by 0x549A054: zorba::XQueryImpl::compile(std::istream&, zorba::SmartPtr<zorba::StaticContext> const&, Zorba_CompilerHints const&) (xqueryimpl.cpp:540)
==6659== by 0x415341: compileAndExecute(zorba::Zorba*, ZorbaCMDProperties const&, zorba::SmartPtr<zorba::StaticContext>&, std::string const&, std::istream&, std::ostream&, TimingInfo&) (zorbacmd.cpp:770)
==6659== by 0x416CFD: main (zorbacmd.cpp:1201)
==6659== Address 0x10 is not stack'd, malloc'd or (recently) free'd
==6659==

Changed in zorba:
assignee: Cezar Andrei (cezar-andrei) → Markos Zaharioudakis (markos-za)
Changed in zorba:
assignee: Markos Zaharioudakis (markos-za) → Cezar Andrei (cezar-andrei)
Revision history for this message
Till Westmann (tillw) wrote :

I'm sorry, I think that I was a little too impatient, because we really need this.
 I fixed both bugs and a third one in the proposed branch.
Can we continue to work with this one?

Revision history for this message
Cezar Andrei (cezar-andrei) wrote :

This should be fixed by Till's merge. Assigning to Till to confirm.

Changed in zorba:
assignee: Cezar Andrei (cezar-andrei) → Till Westmann (tillw)
tags: added: dates
tags: added: segfault
Changed in zorba:
milestone: none → 2.9
Till Westmann (tillw)
Changed in zorba:
status: New → Fix Committed
Chris Hillery (ceejatec)
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.