Segmentation fault while using Item or ItemFactory class in python

Bug #928135 reported by Enemy Peng
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zorba
Fix Released
Undecided
Juan Zacarias

Bug Description

Here's the code to reproduce errors:

>>> import zorba_api
>>> item = zorba_api.ItemFactory()
>>> content_item.createInteger(4)
Segmentation fault

Zorba Version: 2.1.0

Related branches

Changed in zorba:
milestone: none → 2.2
Changed in zorba:
assignee: nobody → Juan Zacarias (juan457)
Revision history for this message
Juan Zacarias (juan457) wrote :

I have been reviewing this Segmentation fault you get, and looking at the implementation of the api for python it does make sense to get this error, the problem here is that calling the function zorba_api.ItemFactory() creates an item of the ItemFactory class with no actual initialization so when trying to access functions of this class it breaks with a segmentation error sinc ethe functions does not exist for an ItemFactory started that way.

A way to get acces to the itemFactory functions so it doesn't break is:

>>> import zorba_api
>>> store = zorba_api.InMemoryStore_getInstance()
>>> zorba = zorba_api.Zorba_getInstance(store)
>>> content_item = zorba.getItemFactory()
>>> content_item.createInteger(4)

Changed in zorba:
milestone: 2.2 → 2.5
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.