pytave causes segmentation fault in case of octave memory exhaustion error

Bug #461230 reported by Gawron
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Pytave
Fix Committed
Undecided
Unassigned

Bug Description

Use following code in a python interpreter:

import pytave
pytave.eval(1,"rand(10^10)")

It causes Segmentation fault immediately.

Gawron (gawron)
summary: - pytave causes segmentation fault in case of octace memory exhaustion
+ pytave causes segmentation fault in case of octave memory exhaustion
error
Revision history for this message
David Grundberg (individ) wrote :

I'm not surprised that it segfaults. It is not clear what you want me to do about it. Please state what you would rather have Pytave do, or close the bug. Thanks.

Revision history for this message
Gawron (gawron) wrote :

In my opinion pytave should raise OctaveError exception.

Please note, that in octave (tested in versions 3.0.1 and 3.2.2) instruction:

rand(10^10)

causes following error:

error: memory exhausted or requested size too large for range of Octave's index type -- trying to return to prompt

Changed in pytave:
status: New → Triaged
Revision history for this message
David Grundberg (individ) wrote :

Ok. I'm setting this triaged, will reproduce it later. Thanks.

Revision history for this message
highegg (highegg) wrote :

I think raising just MemoryError is equally sound, and it is far easier to implement because the std::bad_alloc -> MemoryError translation is built-in. A patch is uploaded. I'm not entirely sure that everything inside Octave is properly cleaned up when std::bad_alloc escapes out of feval or eval_string, but that's better left to Octave itself.
best regards

Changed in pytave:
status: Triaged → Fix Committed
Revision history for this message
Gawron (gawron) wrote :

Your fix works very well. Than You!

Revision history for this message
Ahmad Zeeshan (ahmadzn) wrote :

Hi! I am new in this field and want to get pytave. But the problem is that I can not get it from anywhere. Kindly help me.

Revision history for this message
David Grundberg (individ) wrote :

Ahmad Zeeshan. Please don't hijack bug reports. Thank you.

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.