crash in Streamable*Item with file module

Bug #996084 reported by Dennis Knochenwefel
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zorba
Fix Released
High
Chris Hillery

Bug Description

I was trying to

1. read a data file
2. get the md5 of the file content
3. return both the md5 and content in one XML node:
  <file><md5>...</md5><data>...</data></file>

Executing the complete example (see attachment) with any data.txt file leads to a crash. It seems that the streamreleaser in ~StreamableBase64BinaryItem() and ~StreamableStringItem() tries to delete the same ifstream.

Tags: crash

Related branches

Revision history for this message
Dennis Knochenwefel (dennis-knochenwefel) wrote :
tags: added: crash
description: updated
Revision history for this message
Chris Hillery (ceejatec) wrote :

I will take a look.

Matthias: should this be marked for 2.5?

Changed in zorba:
assignee: Matthias Brantner (matthias-brantner) → Chris Hillery (ceejatec)
Revision history for this message
Matthias Brantner (matthias-brantner) wrote :

Chris: I would like to see the fix before deciding whether it should go into 2.5.

Revision history for this message
Chris Hillery (ceejatec) wrote :

After discussions with Matthias, I have proposed a fix for this problem. The gist of the problem is that we did not previously have a situation where two items would both want to claim ownership of the same stream; in this case, a streamable base64 item was being used to create a streamable string item. The fix was to introduce a different factory for StreamableStringItem that takens a 'dependent' streamable item. The new item shares the istream from the dependent item, but NOT the StreamReleaser, and so the new item does not attempt to take ownership of the stream. However, the new item does maintain a reference to the original item, thus forcing the lifespan of the original item to be as long as its own. In this way they can share the stream without having to worry about which one will be destroyed first. I added Dennis's test case and confirmed that it runs fine with this change.

Changed in zorba:
status: New → In Progress
Changed in zorba:
status: In Progress → 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.