Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segfault relating to to_string() call #365

Closed
betterphp opened this issue Nov 6, 2018 · 15 comments
Closed

Segfault relating to to_string() call #365

betterphp opened this issue Nov 6, 2018 · 15 comments

Comments

@betterphp
Copy link

betterphp commented Nov 6, 2018

Mentioned in #345 (comment) but appears to be a separate issue.

Below is from running pulseeffects from the commandline. Version installed is the 4.4.0 tag.

           PID: 11095 (pulseeffects)
           UID: 1000 (jacek)
           GID: 1000 (jacek)
        Signal: 11 (SEGV)
     Timestamp: Tue 2018-11-06 14:05:08 GMT (25s ago)
  Command Line: pulseeffects
    Executable: /usr/bin/pulseeffects
 Control Group: /user.slice/user-1000.slice/session-3.scope
          Unit: session-3.scope
         Slice: user-1000.slice
       Session: 3
     Owner UID: 1000 (jacek)
       Boot ID: 686772764ec84892944f8758c03d0280
    Machine ID: eea1c4afe0287570a9a9d6cc555cc707
      Hostname: jacek-work-desktop
       Storage: /var/lib/systemd/coredump/core.pulseeffects.1000.686772764ec84892944f8758c03d0280.11095.1541513108000000.lz4
       Message: Process 11095 (pulseeffects) of user 1000 dumped core.
                
                Stack trace of thread 11095:
                #0  0x000055fd43204477 _ZNSt7__cxx119to_stringEj (pulseeffects)
                #1  0x000055fd43204a6e _ZN12PipelineBaseC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKj (pulseeffects)
                #2  0x000055fd431eea5a _ZN16SinkInputEffectsC2EP12PulseManager (pulseeffects)
                #3  0x000055fd431adbfa _ZSt11make_uniqueI16SinkInputEffectsJP12PulseManagerEENSt9_MakeUniqIT_E15__single_objectEDpOT0_ (pulseeffects)
                #4  0x00007fbc51da2add _ZN3Gio17Application_Class16startup_callbackEP13_GApplication (libgiomm-2.4.so.1)
                #5  0x00007fbc53b2410d g_closure_invoke (libgobject-2.0.so.0)
                #6  0x00007fbc53b3709e n/a (libgobject-2.0.so.0)
                #7  0x00007fbc53b3f685 g_signal_emit_valist (libgobject-2.0.so.0)
                #8  0x00007fbc53b4009f g_signal_emit (libgobject-2.0.so.0)
                #9  0x00007fbc52d0a1a2 g_application_register (libgio-2.0.so.0)
                #10 0x00007fbc52d0a9b7 n/a (libgio-2.0.so.0)
                #11 0x00007fbc51da26ab _ZN3Gio11Application24local_command_line_vfuncERPPcRi (libgiomm-2.4.so.1)
                #12 0x00007fbc51da28ed _ZN3Gio17Application_Class33local_command_line_vfunc_callbackEP13_GApplicationPPPcPi (libgiomm-2.4.so.1)
                #13 0x00007fbc52d0ad46 g_application_run (libgio-2.0.so.0)
                #14 0x000055fd431a8b3c main (pulseeffects)
                #15 0x00007fbc4fd76b97 __libc_start_main (libc.so.6)
                #16 0x000055fd431a976a _start (pulseeffects)
                
                Stack trace of thread 11096:
                #0  0x00007fbc4fe69bf9 __GI___poll (libc.so.6)
                #1  0x00007fbc54034439 n/a (libglib-2.0.so.0)
                #2  0x00007fbc5403454c g_main_context_iteration (libglib-2.0.so.0)
                #3  0x00007fbc54034591 n/a (libglib-2.0.so.0)
                #4  0x00007fbc5405be85 n/a (libglib-2.0.so.0)
                #5  0x00007fbc5014d6db start_thread (libpthread.so.0)
                #6  0x00007fbc4fe7688f __clone (libc.so.6)
                
                Stack trace of thread 11098:
                #0  0x00007fbc4fe69bf9 __GI___poll (libc.so.6)
                #1  0x00007fbc54034439 n/a (libglib-2.0.so.0)
                #2  0x00007fbc5403454c g_main_context_iteration (libglib-2.0.so.0)
                #3  0x00007fbc452e136d n/a (libdconfsettings.so)
                #4  0x00007fbc5405be85 n/a (libglib-2.0.so.0)
                #5  0x00007fbc5014d6db start_thread (libpthread.so.0)
                #6  0x00007fbc4fe7688f __clone (libc.so.6)
                
                Stack trace of thread 11097:
                #0  0x00007fbc4fe69bf9 __GI___poll (libc.so.6)
                #1  0x00007fbc54034439 n/a (libglib-2.0.so.0)
                #2  0x00007fbc540347d2 g_main_loop_run (libglib-2.0.so.0)
                #3  0x00007fbc52d36f66 n/a (libgio-2.0.so.0)
                #4  0x00007fbc5405be85 n/a (libglib-2.0.so.0)
                #5  0x00007fbc5014d6db start_thread (libpthread.so.0)
                #6  0x00007fbc4fe7688f __clone (libc.so.6)
                
                Stack trace of thread 11099:
                #0  0x00007fbc4fe69bf9 __GI___poll (libc.so.6)
                #1  0x00007fbc54330481 n/a (libpulse.so.0)
                #2  0x00007fbc54321e40 pa_mainloop_poll (libpulse.so.0)
                #3  0x00007fbc543224d0 pa_mainloop_iterate (libpulse.so.0)
                #4  0x00007fbc54322560 pa_mainloop_run (libpulse.so.0)
                #5  0x00007fbc543303c9 n/a (libpulse.so.0)
                #6  0x00007fbc4fb29238 n/a (libpulsecommon-12.2.so)
                #7  0x00007fbc5014d6db start_thread (libpthread.so.0)
                #8  0x00007fbc4fe7688f __clone (libc.so.6)

Here's the startup output

(pulseeffects:11537): pulseeffects-DEBUG: 14:12:56.452: application: PE version: 4.4.0
(pulseeffects:11537): pulseeffects-DEBUG: 14:12:56.453: pulse_manager: context is connecting
(pulseeffects:11537): pulseeffects-DEBUG: 14:12:56.453: pulse_manager: context is authorizing
(pulseeffects:11537): pulseeffects-DEBUG: 14:12:56.453: pulse_manager: context is setting name
(pulseeffects:11537): pulseeffects-DEBUG: 14:12:56.453: pulse_manager: context is ready
(pulseeffects:11537): pulseeffects-DEBUG: 14:12:56.453: pulse_manager: connected to: unix:/run/user/1000/pulse/native
(pulseeffects:11537): pulseeffects-DEBUG: 14:12:56.453: pulse_manager: protocol version: 32
(pulseeffects:11537): pulseeffects-DEBUG: 14:12:56.453: pulse_manager: Pulseaudio version: 11.1
(pulseeffects:11537): pulseeffects-DEBUG: 14:12:56.453: pulse_manager: default pulseaudio source: bluez_sink.00_16_94_25_DB_E8.a2dp_sink.monitor
(pulseeffects:11537): pulseeffects-DEBUG: 14:12:56.454: pulse_manager: default pulseaudio sink: bluez_sink.00_16_94_25_DB_E8.a2dp_sink
(pulseeffects:11537): pulseeffects-DEBUG: 14:12:56.454: pulse_manager: loading Pulseeffects applications output sink...
(pulseeffects:11537): pulseeffects-DEBUG: 14:12:56.454: pulse_manager: default pulseaudio sink sampling rate: 44100 Hz
(pulseeffects:11537): pulseeffects-DEBUG: 14:12:56.454: pulse_manager: default pulseaudio sink audio format: s16le
(pulseeffects:11537): pulseeffects-DEBUG: 14:12:56.454: pulse_manager: sink loaded
(pulseeffects:11537): pulseeffects-DEBUG: 14:12:56.454: pulse_manager: loading Pulseeffects microphone output sink...
(pulseeffects:11537): pulseeffects-DEBUG: 14:12:56.454: pulse_manager: default pulseaudio source sampling rate: 44100 Hz
(pulseeffects:11537): pulseeffects-DEBUG: 14:12:56.454: pulse_manager: default pulseaudio source audio format: s16le
(pulseeffects:11537): pulseeffects-DEBUG: 14:12:56.455: pulse_manager: sink loaded
@betterphp
Copy link
Author

Found this in syslog, probably means something

Nov  6 14:12:56 localhost kernel: [683752.076801] pulseeffects[11537]: segfault at 70 ip 0000559909bf0477 sp 00007ffe5f8e0b30 error 4 in pulseeffects[559909b31000+2c4000]
Nov  6 14:12:56 localhost pulseaudio[9029]: [pulseaudio] module.c: Failed to open module "module-null-sink".
Nov  6 14:12:56 localhost systemd[1]: Started Process Core Dump (PID 11542/UID 0).
Nov  6 14:12:56 localhost pulseaudio[9029]: [pulseaudio] ltdl-bind-now.c: Failed to open module module-null-sink.so: module-null-sink.so: cannot open shared object file: No such file or directory
Nov  6 14:12:56 localhost pulseaudio[9029]: [pulseaudio] module.c: Failed to open module "module-null-sink".
Nov  6 14:12:57 localhost systemd-coredump[11543]: Process 11537 (pulseeffects) of user 1000 dumped core.#012#012Stack trace of thread 11537:#012#0  0x0000559909bf0477 _ZNSt7__cxx119to_stringEj (pulseeffects)#012#1  0x0000559909bf0a6e _ZN12PipelineBaseC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKj (pulseeffects)#012#2  0x0000559909bdaa5a _ZN16SinkInputEffectsC2EP12PulseManager (pulseeffects)#012#3  0x0000559909b99bfa _ZSt11make_uniqueI16SinkInputEffectsJP12PulseManagerEENSt9_MakeUniqIT_E15__single_objectEDpOT0_ (pulseeffects)#012#4  0x00007f0a7b5e2add _ZN3Gio17Application_Class16startup_callbackEP13_GApplication (libgiomm-2.4.so.1)#012#5  0x00007f0a7d36410d g_closure_invoke (libgobject-2.0.so.0)#012#6  0x00007f0a7d37709e n/a (libgobject-2.0.so.0)#012#7  0x00007f0a7d37f685 g_signal_emit_valist (libgobject-2.0.so.0)#012#8  0x00007f0a7d38009f g_signal_emit (libgobject-2.0.so.0)#012#9  0x00007f0a7c54a1a2 g_application_register (libgio-2.0.so.0)#012#10 0x00007f0a7c54a9b7 n/a (libgio-2.0.so.0)#012#11 0x00007f0a7b5e26ab _ZN3Gio11Application24local_command_line_vfuncERPPcRi (libgiomm-2.4.so.1)#012#12 0x00007f0a7b5e28ed _ZN3Gio17Application_Class33local_command_line_vfunc_callbackEP13_GApplicationPPPcPi (libgiomm-2.4.so.1)#012#13 0x00007f0a7c54ad46 g_application_run (libgio-2.0.so.0)#012#14 0x0000559909b94b3c main (pulseeffects)#012#15 0x00007f0a795b6b97 __libc_start_main (libc.so.6)#012#16 0x0000559909b9576a _start (pulseeffects)#012#012Stack trace of thread 11538:#012#0  0x00007f0a796a9bf9 __GI___poll (libc.so.6)#012#1  0x00007f0a7d874439 n/a (libglib-2.0.so.0)#012#2  0x00007f0a7d87454c g_main_context_iteration (libglib-2.0.so.0)#012#3  0x00007f0a7d874591 n/a (libglib-2.0.so.0)#012#4  0x00007f0a7d89be85 n/a (libglib-2.0.so.0)#012#5  0x00007f0a7998d6db start_thread (libpthread.so.0)#012#6  0x00007f0a796b688f __clone (libc.so.6)#012#012Stack trace of thread 11539:#012#0  0x00007f0a796a9bf9 __GI___poll (libc.so.6)#012#1  0x00007f0a7d874439 n/a (libglib-2.0.so.0)#012#2  0x00007f0a7d8747d2 g_main_loop_run (libglib-2.0.so.0)#012#3  0x00007f0a7c576f66 n/a (libgio-2.0.so.0)#012#4  0x00007f0a7d89be85 n/a (libglib-2.0.so.0)#012#5  0x00007f0a7998d6db start_thread (libpthread.so.0)#012#6  0x00007f0a796b688f __clone (libc.so.6)#012#012Stack trace of thread 11541:#012#0  0x00007f0a796a9bf9 __GI___poll (libc.so.6)#012#1  0x00007f0a7db70481 n/a (libpulse.so.0)#012#2  0x00007f0a7db61e40 pa_mainloop_poll (libpulse.so.0)#012#3  0x00007f0a7db624d0 pa_mainloop_iterate (libpulse.so.0)#012#4  0x00007f0a7db62560 pa_mainloop_run (libpulse.so.0)#012#5  0x00007f0a7db703c9 n/a (libpulse.so.0)#012#6  0x00007f0a79369238 n/a (libpulsecommon-12.2.so)#012#7  0x00007f0a7998d6db start_thread (libpthread.so.0)#012#8  0x00007f0a796b688f __clone (libc.so.6)#012#012Stack trace of thread 11540:#012#0  0x00007f0a796a9bf9 __GI___poll (libc.so.6)#012#1  0x00007f0a7d874439 n/a (libglib-2.0.so.0)#012#2  0x00007f0a7d87454c g_main_context_iteration (libglib-2.0.so.0)#012#3  0x00007f0a6eb2136d n/a (libdconfsettings.so)#012#4  0x00007f0a7d89be85 n/a (libglib-2.0.so.0)#012#5  0x00007f0a7998d6db start_thread (libpthread.so.0)#012#6  0x00007f0a796b688f __clone (libc.so.6)

@wwmm
Copy link
Owner

wwmm commented Nov 6, 2018

What you found in your syslog definitely means something. It seems your pulseaudio installation is broken. The null sink module is missing module-null-sink.so: cannot open shared object file: No such file or directory

@wwmm
Copy link
Owner

wwmm commented Nov 6, 2018

Just to clarify the null sink module is used by PulseEffects but is not part of our code. It is a builtin Pulseaudio module

@betterphp
Copy link
Author

The file it mentions is there alongside all the other modules

-rw-r--r-- 1 root root 18K Jul 23 20:04 /usr/lib/pulse-12.2/modules/module-null-sink.so

Sound works too, so I have no idea what's going on :(

@wwmm
Copy link
Owner

wwmm commented Nov 6, 2018

PulseEffects log output says your Pulseaudio version is 11.1. But the post above shows that the null sink library is in Pulseaudio 12.2 folder. This is very strange

@wwmm
Copy link
Owner

wwmm commented Nov 6, 2018

It seems to me that a few Pulseaudio packages were upgraded to version 12.2 and others stayed in 11.1

@wwmm
Copy link
Owner

wwmm commented Nov 6, 2018

Typical audio applications do not need the null sink module. So it is expected that they will work

@betterphp
Copy link
Author

betterphp commented Nov 6, 2018

I did a strace on the pulseaudio process while starting pulseeffects and it was trying to load from the 11.1 directory which was no longer there.

Removing the pulseaudio binary and a --reinstall made it load up perfectly.

Can't explain that but I'll close this as it was apparently something I messed up :P

@Blahpunkt
Copy link

@betterphp could you elaborate what you did there in an easy and detailled way (i.e. code snippets)? I think this could potentially help with some of the other problems I and others wrote about.

@betterphp
Copy link
Author

Sure, although I tried a few things at once so not sure which bit actually fixed it.

First how to work out where it's loading the libraries from. Get the process ID of the pulseaudio server ps aux | grep pulse then attach to that ID to see what it's doing strace -p PID (replace PID with the process ID). This will output a huge amount of information so dump it to a file instead strace -p PID &> pulse.log. In my case I know it's failing on the null sink module so I can search for that in the log file, finding something like this

openat(AT_FDCWD, "/usr/lib/pulse-11.1/modules/module-null-sink.la", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/module-null-sink.la", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/module-null-sink.la", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/libfakeroot/module-null-sink.la", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/local/lib/module-null-sink.la", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/module-null-sink.la", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/module-null-sink.la", O_RDONLY) = -1 ENOENT (No such file or directory)
access("/usr/lib/pulse-11.1/modules/module-null-sink.so", R_OK) = -1 ENOENT (No such file or directory)
access("/lib/module-null-sink.so", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/lib/module-null-sink.so", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/lib/x86_64-linux-gnu/libfakeroot/module-null-sink.so", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/local/lib/module-null-sink.so", R_OK) = -1 ENOENT (No such file or directory)
access("/lib/x86_64-linux-gnu/module-null-sink.so", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/lib/x86_64-linux-gnu/module-null-sink.so", R_OK) = -1 ENOENT (No such file or directory)

It's normal for it to check a list of paths, the same as when you run a command it searches in every folder in the $PATH. The important bit is that the first line is /usr/lib/pulse-11.1, the wrong version. If you don't have that same problem this probably won't help.

Now I'm assuming that something didn't update properly from 11.1 to 12.2 which is causing it to look in the wrong place despite being the correct version. So I removed the binary (to make sure the installer was putting it in the right place) and told it to reinstall

sudo rm /usr/bin/pulseaudio
sudo apt install --reinstall pulseaudio

The installer has put the binary back in the same place and launching it from the command line, just pulseaudio, works. Doing the strace again shows that it's looking in the correct place now. The lib path must have been stored somewhere that was not updated.

For some reason this leaves me with the service unable to start and no sound. So I panic that I'm going to have to work in silence for the rest of the day and blindly reboot hoping for the best.

sudo reboot

After that it all worked perfectly on pulseeffects 4.3.9 and pulseaudio 12.2.

Hopefully that will be of some use, this is the first time I've really done anything with pulseaudio - it seems annoyingly temperamental.

@hadware
Copy link

hadware commented Nov 10, 2018

Worked for me as well. I had the same problem after a 16.04 -> 18.04 upgrade (ubuntu).

@wwmm
Copy link
Owner

wwmm commented Nov 11, 2018

Maybe it would be good to have an entry in our FAQ about this Pulseaudio upgrade problem. As I use Arch Linux it would be better that one of you did this. Could you do it? It could be something like Segmentation fault after upgrading ubuntu with the commands that fix the problem.

@betterphp
Copy link
Author

I've added a new question to that page, let me know if it's okay :)

@wwmm
Copy link
Owner

wwmm commented Nov 11, 2018

it is fine :-)

@mikhailnov
Copy link
Contributor

Added to https://github.com/wwmm/pulseeffects/wiki/Package-Repositories
"Restart the user session or reboot after this, because PulseAudio will be upgraded, and it may cause problems if you don't restart."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants