Opened 15 years ago

Closed 15 years ago

#4274 closed bug (fixed)

[Soundplay Replicant] crash in BWindow::IsHidden

Reported by: diver Owned by: bga
Priority: normal Milestone: R1
Component: Kits/Interface Kit Version: R1/pre-alpha1
Keywords: Cc:
Blocked By: Blocking: #4338
Platform: All

Description

Happend while playing with SoundPlay replicant.

Thread 621 caused an exception: Segment violation
Reading symbols from /boot/system/runtime_loader...done.
Loaded symbols for /boot/system/runtime_loader
Reading symbols from /boot/system/lib/libbe.so...done.
Loaded symbols for /boot/system/lib/libbe.so
Reading symbols from /boot/system/lib/libtracker.so...done.
Loaded symbols for /boot/system/lib/libtracker.so
Reading symbols from /boot/system/lib/libroot.so...done.
Loaded symbols for /boot/system/lib/libroot.so
Reading symbols from /boot/system/lib/libstdc++.r4.so...done.
Loaded symbols for /boot/system/lib/libstdc++.r4.so
Reading symbols from /boot/system/lib/libtranslation.so...done.
Loaded symbols for /boot/system/lib/libtranslation.so
Reading symbols from /boot/system/lib/libtextencoding.so...done.
Loaded symbols for /boot/system/lib/libtextencoding.so
Reading symbols from /boot/system/apps/Workspaces...done.
Loaded symbols for /boot/system/apps/Workspaces
Reading symbols from /boot/system/add-ons/Translators/BMPTranslator...done.
Loaded symbols for /boot/system/add-ons/Translators/BMPTranslator
Reading symbols from /boot/system/add-ons/Translators/EXRTranslator...done.
Loaded symbols for /boot/system/add-ons/Translators/EXRTranslator
Reading symbols from /boot/system/lib/libilmimf.so...done.
Loaded symbols for /boot/system/lib/libilmimf.so
Reading symbols from /boot/system/lib/libz.so...done.
Loaded symbols for /boot/system/lib/libz.so
Reading symbols from /boot/system/add-ons/Translators/GIFTranslator...done.
Loaded symbols for /boot/system/add-ons/Translators/GIFTranslator
Reading symbols from /boot/system/add-ons/Translators/JPEG2000Translator...done.
Loaded symbols for /boot/system/add-ons/Translators/JPEG2000Translator
Reading symbols from /boot/system/add-ons/Translators/JPEGTranslator...done.
Loaded symbols for /boot/system/add-ons/Translators/JPEGTranslator
Reading symbols from /boot/system/add-ons/Translators/PCXTranslator...done.
Loaded symbols for /boot/system/add-ons/Translators/PCXTranslator
Reading symbols from /boot/system/add-ons/Translators/PNGTranslator...done.
Loaded symbols for /boot/system/add-ons/Translators/PNGTranslator
Reading symbols from /boot/system/add-ons/Translators/PPMTranslator...done.
Loaded symbols for /boot/system/add-ons/Translators/PPMTranslator
Reading symbols from /boot/system/add-ons/Translators/RAWTranslator...done.
Loaded symbols for /boot/system/add-ons/Translators/RAWTranslator
Reading symbols from /boot/system/add-ons/Translators/RTF-Translator...done.
Loaded symbols for /boot/system/add-ons/Translators/RTF-Translator
Reading symbols from /boot/system/add-ons/Translators/SGITranslator...done.
Loaded symbols for /boot/system/add-ons/Translators/SGITranslator
Reading symbols from /boot/system/add-ons/Translators/STXTTranslator...done.
Loaded symbols for /boot/system/add-ons/Translators/STXTTranslator
Reading symbols from /boot/system/add-ons/Translators/TGATranslator...done.
Loaded symbols for /boot/system/add-ons/Translators/TGATranslator
Reading symbols from /boot/system/add-ons/Translators/TIFFTranslator...done.
Loaded symbols for /boot/system/add-ons/Translators/TIFFTranslator
Reading symbols from /boot/system/add-ons/Translators/WonderBrushTranslator...done.
Loaded symbols for /boot/system/add-ons/Translators/WonderBrushTranslator
Reading symbols from /boot/home/Desktop/SoundPlay/SoundPlay...done.
Loaded symbols for /boot/home/Desktop/SoundPlay/SoundPlay
Reading symbols from /boot/home/config/lib/liblayout.so...done.
Loaded symbols for /boot/home/config/lib/liblayout.so
Reading symbols from /boot/system/lib/libmedia.so...done.
Loaded symbols for /boot/system/lib/libmedia.so
Reading symbols from /boot/system/lib/libgame.so...done.
Loaded symbols for /boot/system/lib/libgame.so
Reading symbols from /boot/system/lib/libbnetapi.so...done.
Loaded symbols for /boot/system/lib/libbnetapi.so
Reading symbols from /boot/system/lib/libnetwork.so...done.
Loaded symbols for /boot/system/lib/libnetwork.so
Reading symbols from /boot/home/Desktop/SoundPlay/Plugins/AudioIn...done.
Loaded symbols for /boot/home/Desktop/SoundPlay/Plugins/AudioIn
Reading symbols from /boot/home/Desktop/SoundPlay/Plugins/CPlusAdapter...done.
Loaded symbols for /boot/home/Desktop/SoundPlay/Plugins/CPlusAdapter
Reading symbols from /boot/home/Desktop/SoundPlay/Plugins/Deskbar...done.
Loaded symbols for /boot/home/Desktop/SoundPlay/Plugins/Deskbar
Reading symbols from /boot/home/Desktop/SoundPlay/Plugins/DeskbarFFT...done.
Loaded symbols for /boot/home/Desktop/SoundPlay/Plugins/DeskbarFFT
Reading symbols from /boot/home/Desktop/SoundPlay/Plugins/DeskbarVU...done.
Loaded symbols for /boot/home/Desktop/SoundPlay/Plugins/DeskbarVU
Reading symbols from /boot/home/Desktop/SoundPlay/Plugins/FreeVerb...done.
Loaded symbols for /boot/home/Desktop/SoundPlay/Plugins/FreeVerb
Reading symbols from /boot/home/Desktop/SoundPlay/Plugins/LiveEncoder...done.
Loaded symbols for /boot/home/Desktop/SoundPlay/Plugins/LiveEncoder
Reading symbols from /boot/home/Desktop/SoundPlay/Plugins/LoudnessPlugin...done.
Loaded symbols for /boot/home/Desktop/SoundPlay/Plugins/LoudnessPlugin
Reading symbols from /boot/home/Desktop/SoundPlay/Plugins/MP3Clean...done.
Loaded symbols for /boot/home/Desktop/SoundPlay/Plugins/MP3Clean
Reading symbols from /boot/home/Desktop/SoundPlay/Plugins/MidiRenderer...done.
Loaded symbols for /boot/home/Desktop/SoundPlay/Plugins/MidiRenderer
Reading symbols from /boot/home/Desktop/SoundPlay/Plugins/ModPlugin...done.
Loaded symbols for /boot/home/Desktop/SoundPlay/Plugins/ModPlugin
Reading symbols from /boot/home/Desktop/SoundPlay/Plugins/NoVoicePlugin...done.
Loaded symbols for /boot/home/Desktop/SoundPlay/Plugins/NoVoicePlugin
Reading symbols from /boot/home/Desktop/SoundPlay/Plugins/Noise...done.
Loaded symbols for /boot/home/Desktop/SoundPlay/Plugins/Noise
Reading symbols from /boot/home/Desktop/SoundPlay/Plugins/OggVorbis...done.
Loaded symbols for /boot/home/Desktop/SoundPlay/Plugins/OggVorbis
Reading symbols from /boot/home/config/lib/libogg.so...done.
Loaded symbols for /boot/home/config/lib/libogg.so
Reading symbols from /boot/home/config/lib/libvorbisfile.so...done.
Loaded symbols for /boot/home/config/lib/libvorbisfile.so
Reading symbols from /boot/home/config/lib/libvorbis.so...done.
Loaded symbols for /boot/home/config/lib/libvorbis.so
Reading symbols from /boot/home/Desktop/SoundPlay/Plugins/PitchChange...done.
Loaded symbols for /boot/home/Desktop/SoundPlay/Plugins/PitchChange
Reading symbols from /boot/home/Desktop/SoundPlay/Plugins/SimpleScopePlugin...done.
Loaded symbols for /boot/home/Desktop/SoundPlay/Plugins/SimpleScopePlugin
Reading symbols from /boot/home/Desktop/SoundPlay/Plugins/SpectrumAnalyzer...done.
Loaded symbols for /boot/home/Desktop/SoundPlay/Plugins/SpectrumAnalyzer
Loaded symbols for /boot/home/Desktop/SoundPlay/SoundPlay
[tcsetpgrp failed in terminal_inferior: Invalid Argument]
[Switching to team /boot/system/Tracker (81) thread w>SoundPlay playlist editor (621)]
0x0038099e in BWindow::IsHidden () from /boot/system/lib/libbe.so
(gdb) bt
#0  0x0038099e in BWindow::IsHidden () from /boot/system/lib/libbe.so
#1  0x0037f788 in BWindow::IsMinimized () from /boot/system/lib/libbe.so
#2  0x08c388aa in SoundPlayController::IsMainInterfaceHidden ()
   from /boot/home/Desktop/SoundPlay/SoundPlay
#3  0x08c3fd58 in aa_zzzzzzzzzzzzzzzzzzzz ()
   from /boot/home/Desktop/SoundPlay/SoundPlay
#4  0x002bfe9e in BLooper::Quit () from /boot/system/lib/libbe.so
#5  0x0037b766 in BWindow::Quit () from /boot/system/lib/libbe.so
#6  0x002c1527 in BLooper::_QuitRequested () from /boot/system/lib/libbe.so
#7  0x002bfa22 in BLooper::DispatchMessage () from /boot/system/lib/libbe.so
#8  0x0037e1e9 in BWindow::DispatchMessage () from /boot/system/lib/libbe.so
#9  0x00381d84 in BWindow::task_looper () from /boot/system/lib/libbe.so
#10 0x002c0f93 in BLooper::_task0_ () from /boot/system/lib/libbe.so
#11 0x00696124 in thread_entry () from /boot/system/lib/libroot.so
#12 0x7834bfec in ?? ()
(gdb)

Change History (15)

comment:1 by anevilyak, 15 years ago

Resolution: invalid
Status: newclosed

This isn't a Tracker bug, it's crashing in the SP replicant code, which could just be a bug in SP itself. Bear in mind, a replicant executes in the same team as the app it's part of, and as such will take the app with it if it misbehaves.

comment:2 by anevilyak, 15 years ago

Blocking: 4338 added

(In #4338) Duplicate of #4274.

comment:3 by diver, 15 years ago

But Tracker in R5 doesn't crash, I remember as i've used it a lot.

comment:4 by anevilyak, 15 years ago

Component: Applications/TrackerKits/Interface Kit
Resolution: invalid
Status: closedreopened

In that case the bug is most likely somewhere in the app or interface kit, like I said you only see the crash in Tracker because the replicant executes as part of the same team (the replicant itself is basically just an archived BView that gets inserted into the desktop's view hierarchy).

comment:5 by anevilyak, 15 years ago

Summary: [Tracker] crash in BWindow::IsHidden[Soundplay Replicant] crash in BWindow::IsHidden

comment:6 by anevilyak, 15 years ago

What version of Soundplay are you using for this test by the way?

comment:7 by diver, 15 years ago

It's SoundPlay 4.7.3.

comment:8 by axeld, 15 years ago

It can still be a bug in the application, though. It wouldn't be the first case where a n actual bug did go unnoticed in BeOS suddenly surfaced in Haiku.

in reply to:  8 comment:9 by anevilyak, 15 years ago

Replying to axeld:

It can still be a bug in the application, though. It wouldn't be the first case where a n actual bug did go unnoticed in BeOS suddenly surfaced in Haiku.

Very true, but pending further analysis I'll give Soundplay the benefit of the doubt for now :)

comment:10 by bga, 15 years ago

This is from Marco Nelissen: "one thing I remember is that BeOS would keep a list of windows, and some of the BWindow calls would verify that the 'this' pointer was in that list, so you could call certain BWindow methods on an invalid pointer without crashing. Maybe it's calling IsHidden on a null pointer or something, which could possibly have worked on BeOS"

So, yes. It may be indeed a bug in SoundPlay that was hidden in BeOS but then the question is, does binary compatibility includes replicating this behaviour?

comment:11 by axeld, 15 years ago

I guess he means the looper list, and that's something we do as well. But that will only work gracefully if the method in question tries to lock, and notices if that didn't work out.

If it's a bug in SoundPlay, I would bother Marco to fix it (and release a new binary that works under Haiku) ;-)

comment:12 by bga, 15 years ago

Oh, he is working on that. Don't worry. ;)

In any case, maybe it is worth to investigate this just to be sure? I can take a look at it if you do not have the time to. Just assign it to me.

comment:13 by axeld, 15 years ago

Owner: changed from axeld to bga
Status: reopenednew

Now that's an invitation I can't resist :-)

comment:14 by bonefish, 15 years ago

According to an objdump of BeOS R5's libbe, BWindow::IsMinimized() does lock. Interestingly it calls a function get_window_info() -- asking the app server? BWindow::IsHidden() calls BLooper::IsLocked(), so that can be "safely" called on a stale BWindow pointer, too. In Haiku neither method does any checks. So while I'm generally no fan of allowing calls on invalid objects (another object could have been created at the same address in the meantime), BeOS R5 does that and so should we.

BTW, our BLooper:IsLocked() looks broken: There's a race condition between checking the object's validity and accessing the object (the whole time the looper list lock should be held). Furthermore the fCachedStack optimization is questionable. At least on x86 it probably won't speed anything up. Don't know about other architectures, but find_thread(NULL) really should be made as fast as possible -- I'd rather optimize there.

comment:15 by axeld, 15 years ago

Resolution: fixed
Status: newclosed

Should be fixed in hrev32902. I did not change BWindow::IsHidden(), as it doesn't return in case IsLocked() is false, so it would still access the stale object.

Note: See TracTickets for help on using tickets.