#191 segfault creating thumbnails in a dir with missing perms

open
nobody
None
5
2014-07-14
2011-01-15
tbart4642272
No

Fuppes SVN-680 crashes when I start it in what seems to be the write-out-phase of a thumbnail - but I may be wrong.

Here is a (hopefully meaningful) backtrace.
I am running it like my init script does - changing uid to user fuppes first.
The SEGV does NOT happen when using
start-stop-daemon -v -c root --start --exec /usr/bin/fuppes -- --config-dir /etc/fuppes/ --database-file /var/lib/fuppes/fuppes.db
but running as root is discouraged.

..hm, now that I've run it once as root it works.
OK I think I have the problem: The (experimental) Gentoo ebuild seemingly installs fuppes in a way that makes thumbnails go to /etc/fuppes/thumbnails - and fuppes does not have write access to this dir.
thumbnails do not belong into /etc but how can we configure where thumbnails go to?
I (and gentoo) really like(s) config files to go into /etc but it seems like the thumbnail dir is hardcoded to the same dir as the config file - but please correct me if I am wrong.
It would be great if we could adjust the thumbnail dir in the config file...

anyway, the segfault should never happen, and the write-out needs to be checked for errors.
otherwise, fuppes seems to be great from the 10 minutes I've had time to play with it.
and: it works with a Pinnacle/Roku SoundBridge M1001 (which is not on your homepage yet).

Grüße aus Österreich,
th

blackknight scratch # gdb
GNU gdb (Gentoo 7.2 p1) 7.2
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.gentoo.org/>.
(gdb) file start-stop-daemon
Reading symbols from /sbin/start-stop-daemon...(no debugging symbols found)...done.
(gdb) run -v -c fuppes --start --exec /usr/bin/fuppes -- --config-dir /etc/fuppes/ --database-file /var/lib/fuppes/fuppes.db
Starting program: /sbin/start-stop-daemon -v -c fuppes --start --exec /usr/bin/fuppes -- --config-dir /etc/fuppes/ --database-file /var/lib/fuppes/fuppes.db
Starting /usr/bin/fuppes...
process 19218 is executing new program: /usr/bin/fuppes
[Thread debugging using libthread_db enabled]
FUPPES - 0.655
the Free UPnP Entertainment Service
http://fuppes.ulrich-voelkel.de

[New Thread 0xb7b32b70 (LWP 19221)]
read config file: /etc/fuppes/fuppes.cfg
[New Thread 0xb5df7b70 (LWP 19222)]
[New Thread 0xb55f6b70 (LWP 19223)]
[New Thread 0xb4df5b70 (LWP 19224)]
[New Thread 0xb45f4b70 (LWP 19225)]
[New Thread 0xb3df3b70 (LWP 19226)]
[New Thread 0xb33ffb70 (LWP 19227)]
[New Thread 0xb2bfeb70 (LWP 19228)]
[Thread 0xb2bfeb70 (LWP 19228) exited]
[New Thread 0xb23fdb70 (LWP 19229)]
[New Thread 0xb1bfcb70 (LWP 19230)]
[New Thread 0xb13fbb70 (LWP 19231)]
[New Thread 0xb0bfab70 (LWP 19232)]
webinterface: http://192.168.123.6:36053

l = change log-level
(disabled, normal, extended, debug) default is "normal"
i = print system info
s = print device settings
r = rebuild database
v = rebuild virtual container layout
u = update database
h = print this help

m = send m-search
a = send notify-alive
b = send notify-byebye

ctrl-c or q = quit

[Thread 0xb1bfcb70 (LWP 19230) exited]
[New Thread 0xb2bfeb70 (LWP 19233)]
[New Thread 0xb03f9b70 (LWP 19234)]
[Thread 0xb03f9b70 (LWP 19234) exited]
[New Thread 0xafbf8b70 (LWP 19235)]
[Thread 0xafbf8b70 (LWP 19235) exited]
create thumbnail 1 of 88 for: /mnt/data/Audio/Musik/+ ELECTRONIC/THE PRODIGY/Prodigy/the_prodigy-girls-svcd-2004-vme.avi

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb5df7b70 (LWP 19222)]
0xb7c0dd98 in fclose () from /lib/libc.so.6
(gdb) list
warning: Source file is more recent than executable.
105
106 void SignalHandler(int /*signal*/)
107 {
108 g_bExitApp = true;
109 }
110
111 int main(int argc, char* argv[])
112 {
113 #ifndef WIN32
114 if(!geteuid()) {
(gdb) bt
#0 0xb7c0dd98 in fclose () from /lib/libc.so.6
#1 0xb7ecc6bb in fuppes::File::close (this=0xb5df71d8) at lib/Common/File.cpp:119
#2 0xb7eae33b in fuppes::UpdateThread::run (this=0x8055190) at lib/ContentDirectory/UpdateThread.cpp:280
#3 0xb7ec96cc in fuppes::Thread::threadFunc (thread=0x8055190) at lib/Common/Thread.cpp:240
#4 0xb7e1392f in start_thread () from /lib/libpthread.so.0
#5 0xb7c8094e in clone () from /lib/libc.so.6
(gdb) ?
Undefined command: "". Try "help".
(gdb) help
List of classes of commands:

aliases -- Aliases of other commands
breakpoints -- Making program stop at certain points
data -- Examining data
files -- Specifying and examining files
internals -- Maintenance commands
obscure -- Obscure features
running -- Running the program
stack -- Examining the stack
status -- Status inquiries
support -- Support facilities
tracepoints -- Tracing of program execution without stopping the program
user-defined -- User-defined commands

Type "help" followed by a class name for a list of commands in that class.
Type "help all" for the list of all commands.
Type "help" followed by command name for full documentation.
Type "apropos word" to search for commands related to "word".
Command name abbreviations are allowed if unambiguous.
(gdb) frame 2
#2 0xb7eae33b in fuppes::UpdateThread::run (this=0x8055190) at lib/ContentDirectory/UpdateThread.cpp:280
warning: Source file is more recent than executable.
280 out.close();
(gdb) list
275 //cout << "HAS IMAGE: " << size << endl;
276
277 fuppes::File out(tmpfile.str());
278 out.open(File::Write);
279 out.write((char*)buffer, size);
280 out.close();
281
282
283 // set the album art id to the same value as the object id
284 obj->details()->setAlbumArtId(obj->objectId());
(gdb) frame 3
#3 0xb7ec96cc in fuppes::Thread::threadFunc (thread=0x8055190) at lib/Common/Thread.cpp:240
warning: Source file is more recent than executable.
240 pt->run();
(gdb) list
235 {
236 Thread* pt = static_cast<Thread*>(thread);
237
238 ThreadPool::add(pt);
239
240 pt->run();
241
242 ThreadPool::remove(pt);
243
244 #ifdef WIN32
(gdb) bt full
#0 0xb7c0dd98 in fclose () from /lib/libc.so.6
No symbol table info available.
#1 0xb7ecc6bb in fuppes::File::close (this=0xb5df71d8) at lib/Common/File.cpp:119
No locals.
#2 0xb7eae33b in fuppes::UpdateThread::run (this=0x8055190) at lib/ContentDirectory/UpdateThread.cpp:280
out = {m_fileName = {static npos = 4294967295,
_M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>},
_M_p = 0x8103f6c "181.jpg"}}, m_openMode = fuppes::File::Closed, m_file = 0x0}
size = 14994
buffer = 0x834db20 "\377\330\377", <incomplete sequence \340>
mimeType = "\364\177\373\267\270qߵ\223\301췛qߵ\370\256\006\b\324rߵ\344\327\343\267\330\003\376\267\005\000\000\000\377\377\377\377\370R\005\b!\326\344\267\005\000\000\000\353\210\327\267\364\177\373\267\274rߵ\274rߵ\370qߵ\216\273췼rߵ\350\256\006\b\200\036\006\b\364R\005\b\344\327\343\267\364\177", <incomplete sequence \373\267>
hasImage = true
diff = 5
filename = {static npos = 4294967295,
_M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>},
_M_p = 0x834abfc "/mnt/data/Audio/Musik/+ ELECTRONIC/THE PRODIGY/Prodigy/the_prodigy-girls-svcd-2004-vme.avi"}}
tmpfile = <incomplete type>
parent = 0x0
lastPid = 0
image = 0xb5df7318
thumbnailer = 0x80ee718
tmp = 134566604
diff = 5
sibling = 0xb7fb7ff4
connection = 0x806f700
---Type <return> to continue, or q <return> to quit---
obj = 0x8366658
qry = {m_query = 0x80f1d50}
ins = {m_query = 0x80f1d88}
get = {m_query = 0x80f1dc0}
sql = <incomplete type>
#3 0xb7ec96cc in fuppes::Thread::threadFunc (thread=0x8055190) at lib/Common/Thread.cpp:240
pt = 0x8055190
#4 0xb7e1392f in start_thread () from /lib/libpthread.so.0
No symbol table info available.
#5 0xb7c8094e in clone () from /lib/libc.so.6
No symbol table info available.
(gdb)

Discussion

  • tbart4642272
    tbart4642272
    2011-01-15

    • summary: Segmentation fault during init of DB/creating thumbnails --> segfault creating thumbnails in a dir with missing perms