Bug 161331 - XInteractionRequest.getRequest crashes in XInteractionHandler callback in Python
Summary: XInteractionRequest.getRequest crashes in XInteractionHandler callback in Python
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: sdk (show other bugs)
Version:
(earliest affected)
24.2.3.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: QA:needsComment
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-29 22:54 UTC by Ritobroto Mukherjee
Modified: 2024-06-13 03:17 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
Minimal python example for the issue (1.72 KB, text/x-python)
2024-05-29 22:56 UTC, Ritobroto Mukherjee
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ritobroto Mukherjee 2024-05-29 22:54:58 UTC
Description:
When accessing the request object of the XInteractionRequest parameter in an XInteractionHandler from Python, the Python interpreter crashes with the error: "Fatal Python error: a function returned a result with an error set". 
The function works normally when called from Java however.

This bug was encountered while working on porting the PasswordContainer tests from Java to Python (https://gerrit.libreoffice.org/c/core/+/165038). A shorter sample is attached to the bug report as well, and can be run with `./instdir/program/python sample.py` via LibreOffice's internal python.

I attempted to debug the problem with gdb, but due to my very limited knowledge of Python UNO bindings, identifying the exact cause was challenging.
A shot-in-the-dark guess would be that since the result value MasterPasswordRequest is an exception type, returned through an Any object, the marshalling code that converts this value from C++ to Python might be causing the issue.

Steps to Reproduce:
1. Using the LibreOffice internal python, run the attached sample.py script.

Actual Results:
The python interpreter crashes with "Fatal Python error: a function returned a result with an error set"

Expected Results:
Not crash, and return a valid MasterPasswordRequest object.


Reproducible: Always


User Profile Reset: Yes

Additional Info:
Version: 24.8.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 4c5485ef6826b5b2483df869056aac4499aff229
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 1 Ritobroto Mukherjee 2024-05-29 22:56:05 UTC
Created attachment 194442 [details]
Minimal python example for the issue