[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[HTCondor-users] Bug in Python Bindings: Segfault during queue_with_itemdata



Hey List,

I've stumbled upon a bug in the Python Bindings v8.9.6. I'm writing here
as there is no clear way to submit a ticket (might require an account?).

The Submit.queue_with_itemdata method causes a segmentation fault when
the iterator passed raises an exception during next(it).
Submit.queue_with_itemdata() should check whether an exception occurred
during next(it) and pass on this exception to its Python caller.

Minimal reproducible example:

```
import htcondor
def my_it():
    raise Exception()
    yield {}

sub = htcondor.Submit()
schedd = htcondor.Schedd()
with schedd.transaction() as txn:
    result = sub.queue_with_itemdata(txn, itemdata=my_it())
```

#6721 ([1]) also describes various segmentation faults, but these are
probably unrelated. I presume this segfault occurs because callers of
[2] do not check for a Python exception and thus use invalid data at
some point.

Cheers,
Paul Skopnik

[1]: https://htcondor-wiki.cs.wisc.edu/index.cgi/tktview?tn=6721
[2]:
https://github.com/htcondor/htcondor/blob/V8_9_6-branch/src/python-bindings/schedd.cpp#L636