Bug 412887 - Shared library calls exit
Summary: Shared library calls exit
Status: RESOLVED FIXED
Alias: None
Product: partitionmanager
Classification: Applications
Component: general (other bugs)
Version First Reported In: 4.0.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Andrius Štikonas
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-12 18:45 UTC by Mattia
Modified: 2020-10-12 20:28 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mattia 2019-10-12 18:45:36 UTC
rpmlint shows a warning about libkpmcore calling exit on GLIBC:

kpmcore.x86_64: W: shared-lib-calls-exit /usr/lib64/libkpmcore.so.4.0.1 exit@GLIBC_2.2.5

shared-lib-calls-exit:
This library package calls exit() or _exit(), probably in a non-fork()
context. Doing so from a library is strongly discouraged - when a library
function calls exit(), it prevents the calling program from handling the
error, reporting it to the user, closing files properly, and cleaning up any
state that the program has. It is preferred for the library to return an
actual error code and let the calling program decide how to handle the
situation.
Comment 1 Andrius Štikonas 2019-10-12 19:28:01 UTC
That's probably kpmcore/src/util/externalcommand.cpp::startHelper:L351

    QDBusInterface iface(QStringLiteral("org.kde.kpmcore.helperinterface"), QStringLiteral("/Helper"), QStringLiteral("org.kde.kpmcore.externalcommand"), QDBusConnection::systemBus());
    if (iface.isValid()) {
        exit(0);
    }

Yes, it would be good to send a signal to app to exit and possibly show dialog box in the GUI.
Comment 2 Andrius Štikonas 2020-10-12 19:48:58 UTC
Git commit 2dff59260c72582941dbfd4ec52625a0e3ea5ddd by Andrius Štikonas.
Committed on 12/10/2020 at 19:23.
Pushed by stikonas into branch 'master'.

Remove exit call from the helper. It is no longer used.

M  +0    -8    src/util/externalcommandhelper.cpp
M  +0    -1    src/util/externalcommandhelper.h

https://invent.kde.org/system/kpmcore/commit/2dff59260c72582941dbfd4ec52625a0e3ea5ddd
Comment 3 Andrius Štikonas 2020-10-12 20:28:20 UTC
(In reply to Andrius Štikonas from comment #2)
> Git commit 2dff59260c72582941dbfd4ec52625a0e3ea5ddd by Andrius Štikonas.
> Committed on 12/10/2020 at 19:23.
> Pushed by stikonas into branch 'master'.
> 
> Remove exit call from the helper. It is no longer used.
> 
> M  +0    -8    src/util/externalcommandhelper.cpp
> M  +0    -1    src/util/externalcommandhelper.h
> 
> https://invent.kde.org/system/kpmcore/commit/
> 2dff59260c72582941dbfd4ec52625a0e3ea5ddd

Argh, tagged the wrong commit with the fix. 

It's actually fixed in 296f281ffb562c5d8024ff1b6217c0d8dc0aeac4