bugPSPP - Bugs: bug #67198, spread-sheet-widget / MacOS -...

 
 

bug #67198: spread-sheet-widget / MacOS - variable argument list calling method

Submitter:  Friedrich Beckmann <beckmanf>
Submitted:  Sun 08 Jun 2025 11:28:35 AM UTC
   
 
Category:  Compilation/Portability Severity:  7 - Major
Priority:  5 - Normal Status:  Ready for Test/Review
Assigned to:  None Open/Closed:  Open
Release:  None Effort:  0.00
* Mandatory Fields

Post a Comment

Add a New Comment Rich Markup
   

Discussion

Sat 27 Sep 2025 12:02:40 PM UTC, comment #3: 

Thanks for your fix! I tested this on Debian/trixie and  MacOS 15.6.1 and it works. It would be nice if we had a 0.11 released spread-sheet-widget version for this. Only two commits since the 0.10 release in 10/2023 so at least there can not be too many critical bugs in spread-sheet-widget.

Friedrich Beckmann <beckmanf>
Group Member
Thu 25 Sep 2025 07:42:59 PM UTC, comment #2: 

I have pushed your fix to the git repostory.  See
https://cgit.git. ... 7e0121bd96a041595

Please let me know if there are any problems with it.


John Darrington <jmd>
Group administrator
Fri 12 Sep 2025 05:10:24 PM UTC, comment #1: 

This problem makes the pspp gui completely unusable on MacOS. I tested this on MacOS Sequoia 15.6.1 on a MacbookProM4. This problem is in latest and the released 2.0.1 version. To reproduce:

1. Open psppire
2. In Variable view write "bottle" in Column 1, Row 1 (Name) to create a variable
    => After typing RETURN to end the edit in the cell, the name "Var0001" shows up.
    => In the terminal the following warning is shown:

    * (psppire:7866): WARNING *: 18:59:23.357: Changing unknown column 536870914 of variable sheet column not supported

    => The variable is not created with the name "bottle" but with the default name

3. Click again in Column 1, Row 1 (Name) to edit the name to "bottle"
4. After typing RETURN, the name remains "Var0001"
    => Again the warning is shown.

Doubleclicking the Type field, the Type Change Dialog appears. This works. I can change the type from "Numeric" to "String". Also the width can be changed via the dialog.

Editing the "Width" field in sheet does not work. The same warning is shown in terminal.

So I think this is related to the problem in the spread-sheet-widget as described below. But without fixing this, pspp does not work on the current arm based Macs.

Please consider the patch described below.

Friedrich Beckmann <beckmanf>
Group Member
Sun 08 Jun 2025 11:28:35 AM UTC, original submission:  

Eduardo reported a bug for pspp on MacOS on aarch64 for 2.0.1-g5c3e4c. I can reproduce this. See:

https://lists.gnu ... -06/msg00005.html

I tracked this down to strange parameters in "change_data_value" for col and row shortly before a crash. The debugger shows this:


(lldb) b change_data_value
Breakpoint 1: where = psppire`change_data_value + 32 at psppire-data-sheet.c:89:21, address = 0x000000010003448c
(lldb) run
Process 58531 launched: '/opt/homebrew/bin/psppire' (arm64)
Process 58531 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
    frame #0: 0x000000010003448c psppire`change_data_value(sheet=0x000000013be9f3e0, col=1876939856, row=2094132, value=0x00000001001ff434) at psppire-data-sheet.c:89:21
   86          static void
   87          change_data_value (PsppireDataSheet *sheet, gint col, gint row, GValue *value)
   88          {
-> 89            PsppireDataStore *store = NULL;
   90            g_object_get (sheet, "data-model", &store, NULL);
   91
   92            const struct variable *var = psppire_dict_get_variable (store->dict, col);
Target 0: (psppire) stopped.
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
  * frame #0: 0x000000010003448c psppire`change_data_value(sheet=0x000000013be9f3e0, col=1876939856, row=2094132, value=0x00000001001ff434) at psppire-data-sheet.c:89:21
    frame #1: 0x00000001002033d4 libspread-sheet-widget.0.dylib`ssw_cclosure_marshal_VOID__INT_INT_POINTER(closure=0x0000600001fc06b0, return_value=0x0000000000000000, n_param_values=4, param_values=0x000000016fdfd1c0, invocation_hint=0x000000016fdfd118, marshal_data=0x0000000000000000) at ssw-marshaller.c:82:3
    frame #2: 0x0000000100a4a500 libgobject-2.0.0.dylib`g_closure_invoke + 192
    frame #3: 0x0000000100a5f0c8 libgobject-2.0.0.dylib`signal_emit_unlocked_R + 1284
    frame #4: 0x0000000100a5e2f0 libgobject-2.0.0.dylib`signal_emit_valist_unlocked + 1812
    frame #5: 0x0000000100a5dbb0 libgobject-2.0.0.dylib`g_signal_emit_valist + 64
    frame #6: 0x00000001001ff46c libspread-sheet-widget.0.dylib`forward_signal(sheet=0x000000013be9f3e0) at ssw-sheet.c:786:3
    frame #7: 0x00000001002033d4 libspread-sheet-widget.0.dylib`ssw_cclosure_marshal_VOID__INT_INT_POINTER(closure=0x0000600001fc9c40, return_value=0x0000000000000000, n_param_values=4, param_values=0x000000016fdfd620, invocation_hint=0x000000016fdfd578, marshal_data=0x0000000000000000) at ssw-marshaller.c:82:3
    frame #8: 0x0000000100a4a500 libgobject-2.0.0.dylib`g_closure_invoke + 192


Check the strange values for col=1876939856, row=2094132. The function is called because this is a callback of a "value-change" signal. That one is triggered from "forward_signal".

"forward_signal" uses va_list and friends to emit a new signal. I changed the procedure there with the following patch:


diff --git a/src/ssw-sheet.c b/src/ssw-sheet.c
index b687372..a5e4eb6 100644
--- a/src/ssw-sheet.c
+++ b/src/ssw-sheet.c
@@ -779,12 +779,9 @@ ssw_sheet_class_init (SswSheetClass *class)
 }

 static void
-forward_signal (SswSheet *sheet, ...)
+forward_signal (SswSheet *sheet, gint col, gint row, const GValue *valuep, const gpointer ud)
 {
-  va_list ap;
-  va_start (ap, sheet);
-  g_signal_emit_valist (sheet, signals [VALUE_CHANGED], 0, ap);
-  va_end (ap);
+  g_signal_emit(sheet, signals [VALUE_CHANGED], 0, col, row, valuep);
 }

 static void
Mac:ssw fritz$ git


and then it works. So I think that the way the variable argument list is handled by simply giving ap as an argument might not work for all compilers. On github:

https://github.co ... i/ssw/tree/valist






Friedrich Beckmann <beckmanf>
Group Member

 

Attached Files

This item currently has no attached files.

(Note: upload size limit is set to 4.0MiB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

Carbon-Copy List
  • -email is unavailable- added by jmd (Posted a comment)
  • -email is unavailable- added by beckmanf (Reporter)
  • -email is unavailable- added by beckmanf (Submitted the item)
  •  

    Votes

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    History

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2025-09-12 beckmanf Severity5 - Average 7 - Major
    2025-06-08 beckmanf Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.16-11ef.
    Corresponding source code