Skip to content

Verbosity level > 2 crashes daemon #94

@marvin5300

Description

@marvin5300

Daemon crashes with verbosity level > 2.

Confirmed error somewhere in daemon.cpp lines 383 - 400:

if (verbose > 2) {
    bool ok = ads1115_p->setLowThreshold(0b0000000000000000);
    ok = ok && ads1115_p->setHighThreshold(-32768);
    if (ok)
        qDebug() << "successfully setting threshold registers";
    else
        qWarning() << "error: failed setting threshold registers";
    qDebug() << "single ended channels:";
    qDebug() << "ch0:" << ads1115_p->readADC(0) << "ch1:" << ads1115_p->readADC(1)
             << "ch2: " << ads1115_p->readADC(2) << "ch3:" << ads1115_p->readADC(3);
    ads1115_p->setDiffMode(true);
    qDebug() << "diff channels:";
    qDebug() << "ch0-1:" << ads1115_p->readADC(0) << "ch0-3: " << ads1115_p->readADC(1)
             << "ch1-3:" << ads1115_p->readADC(2) << "ch2-3: " << ads1115_p->readADC(3);
    ads1115_p->setDiffMode(false);
    qDebug() << "readout took" << ads1115_p->getLastTimeInterval() << "ms";
}

GDB backtrace:

Thread 7 (Thread 0x702ff400 (LWP 3227) "muondetector-da"):
#0 0x000930dc in Histogram::value2Bin(double) const ()
#1 0x000933d2 in Histogram::fill(double, double) ()
#2 0x0005d032 in Daemon::onAdcSampleReady(DeviceFunction<(DeviceType)0>::Sample) ()
#3 0x0005d224 in std::_Function_handler<void (DeviceFunction<(DeviceType)0>::Sample), Daemon::Daemon(Daemon::configuration, QObject*)::{lambda(DeviceFunction<(DeviceType)0>::Sample)#2}>::_M_invoke(std::_Any_data const&, DeviceFunction<(DeviceType)0>::Sample&&) ()
#4 0x000864a8 in ADS1115::getSample(unsigned int) ()
#5 0x000871ec in std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<DeviceFunction<(DeviceType)0>::Sample>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<DeviceFunction<(DeviceType)0>::Sample (ADS1115::)(unsigned int), ADS1115, unsigned int> >, DeviceFunction<(DeviceType)0>::Sample> >::_M_invoke(std::_Any_data const&) ()
#6 0x0008710e in std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>, bool) ()
#7 0x76c10af4 in __pthread_once_slow (once_control=0xf4ef4, init_routine=0x7649523c <__once_proxy>) at pthread_once.c:116
#8 0x00087436 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<DeviceFunction<(DeviceType)0>::Sample (ADS1115::)(unsigned int), ADS1115, unsigned int> >, DeviceFunction<(DeviceType)0>::Sample>::_Async_state_impl(std::thread::_Invoker<std::tuple<DeviceFunction<(DeviceType)0>::Sample (ADS1115::)(unsigned int), ADS1115, unsigned int> >&&)::{lambda()#1}> > >::_M_run() ()
#9 0x76496150 in ?? () from /lib/arm-linux-gnueabihf/libstdc++.so.6
#10 0x76c06310 in start_thread (arg=0x702ff400) at pthread_create.c:477
#11 0x762d95c8 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:73 from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 6 (Thread 0x70cff400 (LWP 3226) "mosquitto loop"):
#0 0x762d2788 in __pselect (nfds=20, readfds=0x70cfed3c, writefds=0x70cfecf4, exceptfds=0x762d2774 <__pselect+188>, timeout=, sigmask=0x0) at ../sysdeps/unix/sysv/linux/pselect.c:48
#1 0x76c33474 in mosquitto_loop_forever () from /lib/arm-linux-gnueabihf/libmosquitto.so.1
#2 0x76c3c370 in ?? () from /lib/arm-linux-gnueabihf/libmosquitto.so.1
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 5 (Thread 0x716ff400 (LWP 3225) "muondetector-da"):
#0 __GI___poll (timeout=61272, nfds=1, fds=0x70d05010) at ../sysdeps/unix/sysv/linux/poll.c:29
#1 __GI___poll (fds=0x70d05010, nfds=1, timeout=61272) at ../sysdeps/unix/sysv/linux/poll.c:26
#2 0x7581d938 in ?? () from /lib/arm-linux-gnueabihf/libglib-2.0.so.0
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 4 (Thread 0x720bd400 (LWP 3224) "QDBusConnection"):
#0 __GI___poll (timeout=-1, nfds=2, fds=0x7170c9c0) at ../sysdeps/unix/sysv/linux/poll.c:29
#1 __GI___poll (fds=0x7170c9c0, nfds=2, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:26
#2 0x7581d938 in ?? () from /lib/arm-linux-gnueabihf/libglib-2.0.so.0
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 3 (Thread 0x72cff400 (LWP 3223) "Qt bearer threa"):
--Type for more, q to quit, c to continue without paging--
#0 __GI___poll (timeout=10285, nfds=1, fds=0x72303b28) at ../sysdeps/unix/sysv/linux/poll.c:29
#1 __GI___poll (fds=0x72303b28, nfds=1, timeout=10285) at ../sysdeps/unix/sysv/linux/poll.c:26
#2 0x7581d938 in ?? () from /lib/arm-linux-gnueabihf/libglib-2.0.so.0
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 2 (Thread 0x73654400 (LWP 3222) "muondetector-da"):
#0 __GI___poll (timeout=-1, nfds=1, fds=0x72d03f40) at ../sysdeps/unix/sysv/linux/poll.c:29
#1 __GI___poll (fds=0x72d03f40, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:26
#2 0x7581d938 in ?? () from /lib/arm-linux-gnueabihf/libglib-2.0.so.0
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 1 (Thread 0x76fef040 (LWP 3219) "muondetector-da"):
#0 __pthread_clockjoin_ex (threadid=1882190848, thread_return=0x0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, block=block@entry=true) at pthread_join_common.c:145
#1 0x76c077ac in __pthread_join (threadid=, thread_return=) at pthread_join.c:24
#2 0x76496390 in std::thread::join() () from /lib/arm-linux-gnueabihf/libstdc++.so.6
#3 0x76c10af4 in __pthread_once_slow (once_control=0xf4efc, init_routine=0x7649523c <__once_proxy>) at pthread_once.c:116
#4 0x000870d2 in std::__future_base::_Async_state_commonV2::_M_complete_async() ()
#5 0x00086cc0 in ADS1115::readADC(unsigned int) ()
#6 0x0006a6e2 in Daemon::Daemon(Daemon::configuration, QObject*) ()
#7 0x00028cb4 in main ()

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdaemonEverything related to the daemon

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions