Segmentation fault while using Item or ItemFactory class in python
Bug #928135 reported by
Enemy Peng
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.
>>> content_
Segmentation fault
Zorba Version: 2.1.0
Related branches
lp:~zorba-coders/zorba/bug-928135_Seg_Fault_Python
- Rodolfo Ochoa: Approve
- Matthias Brantner: Approve
-
Diff: 10 lines (+0/-1)1 file modifiedswig/ItemFactory.h (+0/-1)
Changed in zorba: | |
milestone: | none → 2.2 |
Changed in zorba: | |
assignee: | nobody → Juan Zacarias (juan457) |
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.
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 InMemoryStore_ getInstance( ) Zorba_getInstan ce(store) ctory() item.createInte ger(4)
>>> store = zorba_api.
>>> zorba = zorba_api.
>>> content_item = zorba.getItemFa
>>> content_