ZorbaImpl::init might call GlobalEnvironment::init with a NULL store pointer

Bug #919189 reported by Ghislain Fourny
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zorba
Fix Released
Medium
Markos Zaharioudakis

Bug Description

At this location, in function ZorbaImpl::init(Store* store):

http://bazaar.launchpad.net/~zorba-coders/zorba/trunk/view/head:/src/api/zorbaimpl.cpp#L93

The assertion

assert(store == NULL || store2 == store);

allows the variable store to be NULL (and there are places that do call this function indirectly with an explicit NULL store pointer, such as here:

http://bazaar.launchpad.net/~zorba-coders/zorba/trunk/view/head:/modules/com/zorba-xquery/www/modules/http-client.xq.src/http_client.cpp#L68

).

However, this assertion is followed by

GlobalEnvironment::init(store);

that always fails upon a NULL pointer.

Revision history for this message
Markos Zaharioudakis (markos-za) wrote :

I removed the store == NULL test from the assertion.

Changed in zorba:
status: New → Fix Committed
Revision history for this message
Ghislain Fourny (gislenius) wrote :

Actually, would it make sense to completely remove the store parameter, make init a 0-ary function, and just use the store manager's singleton for initializing the global environment, since the variable store may only have a given value?

Revision history for this message
Markos Zaharioudakis (markos-za) wrote :

Ghislain, yes, what you say makes sense, given the current implementation. But the current API reflects our long-term goal of separating zorba from the store (into separate libraries). The application may link with several stores and start zorba with a different store each time. In this scenario, the store must be passed as an input to zorba.

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.