Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] Segmentation Fault with Remote Plugin



Hi,
I wrote a remote control plugin for the NEWSTRUCT+Hauppauge remote 
control. If this plugin is loaded and vdr terminates (e.g. restart), it 
crashes with a segmentation fault.

gdb:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (LWP 8934)]
0x0808c831 in Clear__9cListBase (this=0x80c9bec) at tools.c:874
874             delete objects;
(gdb) list
869
870     void cListBase::Clear(void)
871     {
872       while (objects) {
873             cListObject *object = objects->Next();
874             delete objects;
875             objects = object;
876             }
877       objects = lastObject = NULL;
878     }

(gdb) backtrace
#0  0x0808c831 in Clear__9cListBase (this=0x80c9bec) at tools.c:874
#1  0x0808c5e7 in _._9cListBase (this=0x80c9bec, __in_chrg=0) at 
tools.c:797
#2  0x08084ef3 in __static_initialization_and_destruction_0 
(__initialize_p=0,
    __priority=65535) at remote.c:135
#3  0x08084f46 in _GLOBAL_.D._7cRemote.in () at remote.c:135
#4  0x0805ee8a in __do_global_dtors_aux ()
#5  0x08092439 in _fini ()
#6  0x400f1456 in exit () from /lib/libc.so.6
#7  0x400de0cd in __libc_start_main () from /lib/libc.so.6

It appears that the segfault occurres when the remote control objects 
are destroyed by vdr.
The plugin remote class is derived from the cRemote class, but it's not 
a vanilla cRemote object.
The cRemotes class manages a list of cRemote objects. 
I think that the problem occures because of a type conflict: vdr tries 
to destroy an object in the cRemotes list which has a wrong type.
Could a C++ expert comment on this?

Oliver

P.S.: After removing the line 'Remotes.Add(this);' in remote.c,
the problem disappeared...



-- 
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe linux-dvb" as subject.



Home | Main Index | Thread Index