Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • P purr-data
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 362
    • Issues 362
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 54
    • Merge requests 54
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Jonathan Wilkes
  • purr-data
  • Merge requests
  • !522

Closed
Created Sep 04, 2020 by Albert Gräf@aggraefDeveloper
  • Report abuse
Report abuse

Fix a spurious segfault on Windows.

  • Overview 2
  • Commits 1
  • Pipelines 1
  • Changes 1

This one is critical. The segfault happens inside glob_quit() when running gui-less (-nogui). It bothers me every time I test some changes to the Windows version and run regression_tests.pd gui-less as a quick check that the basic functionality still works. Which is its purpose after all. :) But with the regression test making pd.exe segfault, it becomes useless. It doesn't happen every time, but quite often.

Of course, our CI script also uses this regression test and suffers from the same defect. You can actually see this in many logs of the windows_i386_innosetup runner. Here is a typical example taken straight from the log of one of my recent builds:

Testing Purr Data for Windows
$ cd scripts
$ ../packages/win32_inno/build/bin/pd.com -noprefs -nogui -noaudio -send "init dollarzero \$0" regression_tests.pd
$ ../packages/win32_inno/build/bin/pd.com -noprefs -nostdpath -nogui -noaudio external-tests.pd

Note that there is no output from regression_tests.pd at all. This is a tell-tale sign of the segfault. Normally it should print something like this:

unpost_print: testing unpost...
 test message
unpost_print: testing unpost error...
 test message
warning: hex2dec: realtime unsafe memory allocation for lists with more than 10 elements
Done: all tests succeeded.
closing audio...
closing MIDI...
... done.

The easy fix is to just bypass the gui finalization code in glob_quit() when running gui-less (sys_nogui). This completely eradicates the segfault for me, and running regression_tests.pd works every time.

Edited Sep 04, 2020 by Albert Gräf
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: windows-segfault-fix