Bug 469367 - Segmentation fault when trying to open an Origin file.
Summary: Segmentation fault when trying to open an Origin file.
Status: RESOLVED WAITINGFORINFO
Alias: None
Product: LabPlot2
Classification: Applications
Component: backend (show other bugs)
Version: 2.10.0
Platform: Arch Linux Linux
: NOR crash
Target Milestone: ---
Assignee: Stefan Gerlach
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-04 20:42 UTC by acast2000
Modified: 2023-06-30 16:10 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description acast2000 2023-05-04 20:42:42 UTC
SUMMARY

The program drops a segmentation fault when trying to open an OriginLab file.

STEPS TO REPRODUCE
1. Open labplot2 from Terminal
2. Open the "Open" dialog from the menu, locate the file 
3. Click open

OBSERVED RESULT
Segmentation fault

EXPECTED RESULT
File should open

SOFTWARE/OS VERSIONS
Linux: Arch Linux 
Labplot2 and its dependencies installed from the official repositories. 

ADDITIONAL INFORMATION

Backtrace (&possibly some more info):

[New Thread 0x7fffbbfff6c0 (LWP 18937)]
[Thread 0x7fffbbfff6c0 (LWP 18937) exited]
QItemSelectionModel: Selecting when no model has been set will result in a no-op.
QItemSelectionModel: Selecting when no model has been set will result in a no-op.
sitems ASPECT = Project(0x55555676ce80)
items ASPECT = Project(0x55555676ce80)
void MainWin::handleCurrentAspectChanged(AbstractAspect*)
void ProjectParser::importTo(Folder*, const QStringList&), starting import of /home/aleksandar/Downloads/UI karakteristika.opj
void ProjectParser::importTo(Folder*, const QStringList&) , selected pathes:  ()
virtual bool OriginProjectParser::load(Project*, bool)
virtual bool OriginProjectParser::load(Project*, bool), project tree found
bool OriginProjectParser::loadFolder(Folder*, tree<Origin::ProjectNode>::iterator, bool)
	* folder item name = Folder1
bool OriginProjectParser::loadFolder(Folder*, tree<Origin::ProjectNode>::iterator, bool), top level FOLDER
bool OriginProjectParser::loadFolder(Folder*, tree<Origin::ProjectNode>::iterator, bool)
	* folder item name = Book1
bool OriginProjectParser::loadFolder(Folder*, tree<Origin::ProjectNode>::iterator, bool), top level SPREADSHEET
bool OriginProjectParser::loadSpreadsheet(Spreadsheet*, bool, const QString&, int), own/workbook name = Book1, sheetIndex = -1
bool OriginProjectParser::loadSpreadsheet(Spreadsheet*, bool, const QString&, int), cols/maxRows = 2/32
bool OriginProjectParser::loadSpreadsheet(Spreadsheet*, bool, const QString&, int), column 0, name = A
bool OriginProjectParser::loadSpreadsheet(Spreadsheet*, bool, const QString&, int), column 1, name = B
	* folder item name = Graph1
bool OriginProjectParser::loadFolder(Folder*, tree<Origin::ProjectNode>::iterator, bool), top level GRAPH
void Worksheet::handleAspectAdded(const AbstractAspect*)
bool OriginProjectParser::loadWorksheet(Worksheet*, bool), preview = false
bool OriginProjectParser::loadWorksheet(Worksheet*, bool), worksheet name = Graph1

Thread 1 "labplot2" received signal SIGSEGV, Segmentation fault.
Origin::GraphLayer::is3D (this=0x5555565b28b0) at /usr/src/debug/labplot/labplot-2.10.0/src/3rdparty/liborigin/OriginObj.h:1051
Downloading source file /usr/src/debug/labplot/labplot-2.10.0/src/3rdparty/liborigin/OriginObj.h
[###                                                                                                                                            [ ###                                                                                                                                                                                                                                                                                           1051	        switch (c.type) {
(gdb) set logging enabled on
Copying output to gdb.txt.
Copying debug output to gdb.txt.
(gdb) thread apply all backtrace full

Thread 10 (Thread 0x7fffca7fc6c0 (LWP 18758) "labplot2:sh5"):
#0  0x00007ffff4a99f0e in __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x55555614dbe8) at futex-internal.c:57
        sc_cancel_oldtype = 0
        __arg6 = <optimized out>
        __arg3 = <optimized out>
        _a5 = <optimized out>
        _a2 = <optimized out>
        sc_ret = <optimized out>
        __arg4 = <optimized out>
        __arg1 = <optimized out>
        _a6 = <optimized out>
        _a3 = <optimized out>
        resultvar = <optimized out>
        __arg5 = <optimized out>
        __arg2 = <optimized out>
        _a4 = <optimized out>
        _a1 = <optimized out>
#1  __futex_abstimed_wait_common (futex_word=futex_word@entry=0x55555614dbe8, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0, cancel=cancel@entry=true) at futex-internal.c:87
        err = <optimized out>
        clockbit = 256
        op = 393
#2  0x00007ffff4a99f8f in __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x55555614dbe8, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at futex-internal.c:139
No locals.
#3  0x00007ffff4a9c7a0 in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x55555614db98, cond=0x55555614dbc0) at pthread_cond_wait.c:503
        spin = 0
        buffer = {__routine = 0x7ffff4a9c510 <__condvar_cleanup_waiting>, __arg = 0x7fffca7fb960, __canceltype = 0, __prev = 0x0}
        cbuffer = {wseq = 10, cond = 0x55555614dbc0, mutex = 0x55555614db98, private = 0}
        err = <optimized out>
        g = 0
        flags = <optimized out>
        g1_start = <optimized out>
--Type <RET> for more, q to quit, c to continue without paging--
        maxspin = 0
        signals = <optimized out>
        result = 0
        wseq = 10
        seq = 5
        private = 0
        maxspin = <optimized out>
        err = <optimized out>
        result = <optimized out>
        wseq = <optimized out>
        g = <optimized out>
        seq = <optimized out>
        flags = <optimized out>
        private = <optimized out>
        signals = <optimized out>
        done = <optimized out>
        g1_start = <optimized out>
        spin = <optimized out>
        buffer = <optimized out>
        cbuffer = <optimized out>
        s = <optimized out>
#4  ___pthread_cond_wait (cond=0x55555614dbc0, mutex=0x55555614db98) at pthread_cond_wait.c:618
No locals.
#5  0x00007fffe60c256c in cnd_wait () at ../mesa-23.0.3/src/c11/impl/threads_posix.c:135
No locals.
#6  util_queue_thread_func () at ../mesa-23.0.3/src/util/u_queue.c:290
No locals.
#7  0x00007fffe610b98c in impl_thrd_routine () at ../mesa-23.0.3/src/c11/impl/threads_posix.c:67
No locals.
#8  0x00007ffff4a9d44b in start_thread (arg=<optimized out>) at pthread_create.c:444
        ret = <optimized out>
        pd = <optimized out>
        out = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140737298157936, -1334793560527558149, -296, 19, 140737488338624, 140736582369280, 1334834240407644667, 1334812646094055931}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
--Type <RET> for more, q to quit, c to continue without paging--
        not_first_call = <optimized out>
#9  0x00007ffff4b20e40 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
No locals.

Thread 9 (Thread 0x7fffcaffd6c0 (LWP 18757) "labplot2:sh4"):
#0  0x00007ffff4a99f0e in __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x55555614dbe8) at futex-internal.c:57
        sc_cancel_oldtype = 0
        __arg6 = <optimized out>
        __arg3 = <optimized out>
        _a5 = <optimized out>
        _a2 = <optimized out>
        sc_ret = <optimized out>
        __arg4 = <optimized out>
        __arg1 = <optimized out>
        _a6 = <optimized out>
        _a3 = <optimized out>
        resultvar = <optimized out>
        __arg5 = <optimized out>
        __arg2 = <optimized out>
        _a4 = <optimized out>
        _a1 = <optimized out>
#1  __futex_abstimed_wait_common (futex_word=futex_word@entry=0x55555614dbe8, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0, cancel=cancel@entry=true) at futex-internal.c:87
        err = <optimized out>
        clockbit = 256
        op = 393
#2  0x00007ffff4a99f8f in __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x55555614dbe8, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at futex-internal.c:139
No locals.
#3  0x00007ffff4a9c7a0 in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x55555614db98, cond=0x55555614dbc0) at pthread_cond_wait.c:503
        spin = 0
        buffer = {__routine = 0x7ffff4a9c510 <__condvar_cleanup_waiting>, __arg = 0x7fffcaffc960, __canceltype = 0, __prev = 0x0}
        cbuffer = {wseq = 8, cond = 0x55555614dbc0, mutex = 0x55555614db98, private = 0}
        err = <optimized out>
--Type <RET> for more, q to quit, c to continue without paging--
        g = 0
        flags = <optimized out>
        g1_start = <optimized out>
        maxspin = 0
        signals = <optimized out>
        result = 0
        wseq = 8
        seq = 4
        private = 0
        maxspin = <optimized out>
        err = <optimized out>
        result = <optimized out>
        wseq = <optimized out>
        g = <optimized out>
        seq = <optimized out>
        flags = <optimized out>
        private = <optimized out>
        signals = <optimized out>
        done = <optimized out>
        g1_start = <optimized out>
        spin = <optimized out>
        buffer = <optimized out>
        cbuffer = <optimized out>
        s = <optimized out>
#4  ___pthread_cond_wait (cond=0x55555614dbc0, mutex=0x55555614db98) at pthread_cond_wait.c:618
No locals.
#5  0x00007fffe60c256c in cnd_wait () at ../mesa-23.0.3/src/c11/impl/threads_posix.c:135
No locals.
#6  util_queue_thread_func () at ../mesa-23.0.3/src/util/u_queue.c:290
No locals.
#7  0x00007fffe610b98c in impl_thrd_routine () at ../mesa-23.0.3/src/c11/impl/threads_posix.c:67
No locals.
#8  0x00007ffff4a9d44b in start_thread (arg=<optimized out>) at pthread_create.c:444
        ret = <optimized out>
        pd = <optimized out>
--Type <RET> for more, q to quit, c to continue without paging--
        out = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140737298157936, -1334793560527558149, -296, 19, 140737488338624, 140736590761984, 1334835341529885179, 1334812646094055931}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = <optimized out>
#9  0x00007ffff4b20e40 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
No locals.

Thread 8 (Thread 0x7fffcb7fe6c0 (LWP 18756) "labplot2:sh3"):
#0  0x00007ffff4a99f0e in __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x55555614dbe8) at futex-internal.c:57
        sc_cancel_oldtype = 0
        __arg6 = <optimized out>
        __arg3 = <optimized out>
        _a5 = <optimized out>
        _a2 = <optimized out>
        sc_ret = <optimized out>
        __arg4 = <optimized out>
        __arg1 = <optimized out>
        _a6 = <optimized out>
        _a3 = <optimized out>
        resultvar = <optimized out>
        __arg5 = <optimized out>
        __arg2 = <optimized out>
        _a4 = <optimized out>
        _a1 = <optimized out>
#1  __futex_abstimed_wait_common (futex_word=futex_word@entry=0x55555614dbe8, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0, cancel=cancel@entry=true) at futex-internal.c:87
        err = <optimized out>
        clockbit = 256
        op = 393
#2  0x00007ffff4a99f8f in __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x55555614dbe8, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at futex-internal.c:139
No locals.
#3  0x00007ffff4a9c7a0 in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x55555614db98, cond=0x55555614dbc0) at pthread_cond_wait.c:503
        spin = 0
--Type <RET> for more, q to quit, c to continue without paging--
        buffer = {__routine = 0x7ffff4a9c510 <__condvar_cleanup_waiting>, __arg = 0x7fffcb7fd960, __canceltype = 0, __prev = 0x0}
        cbuffer = {wseq = 6, cond = 0x55555614dbc0, mutex = 0x55555614db98, private = 0}
        err = <optimized out>
        g = 0
        flags = <optimized out>
        g1_start = <optimized out>
        maxspin = 0
        signals = <optimized out>
        result = 0
        wseq = 6
        seq = 3
        private = 0
        maxspin = <optimized out>
        err = <optimized out>
        result = <optimized out>
        wseq = <optimized out>
        g = <optimized out>
        seq = <optimized out>
        flags = <optimized out>
        private = <optimized out>
        signals = <optimized out>
        done = <optimized out>
        g1_start = <optimized out>
        spin = <optimized out>
        buffer = <optimized out>
        cbuffer = <optimized out>
        s = <optimized out>
#4  ___pthread_cond_wait (cond=0x55555614dbc0, mutex=0x55555614db98) at pthread_cond_wait.c:618
No locals.
#5  0x00007fffe60c256c in cnd_wait () at ../mesa-23.0.3/src/c11/impl/threads_posix.c:135
No locals.
#6  util_queue_thread_func () at ../mesa-23.0.3/src/util/u_queue.c:290
No locals.
#7  0x00007fffe610b98c in impl_thrd_routine () at ../mesa-23.0.3/src/c11/impl/threads_posix.c:67
No locals.
--Type <RET> for more, q to quit, c to continue without paging--q
Quit
(gdb) exit
A debugging session is active.

	Inferior 1 [process 18678] will be killed.

Quit anyway? (y or n) y
Comment 1 Alexander Semke 2023-05-05 06:26:11 UTC
(In reply to acast2000 from comment #0)
> SUMMARY
> The program drops a segmentation fault when trying to open an OriginLab file.

would it be possible for you to attach the file here so we can try to reproduce the problem?
Comment 2 Antonio Rojas 2023-05-05 08:21:07 UTC
System liborigin integration is quite broken. Labplot relies on a git snapshot of liborigin, which is incompatible with the latest stable 3.0.1 release. Yet, it happily accepts system liborigin 3.0.1 at build time and links against it. On top of that, it uses the bundled liborigin headers even when linking against system liborigin, which causes crashes due to the incompatibility.

Labplot cmake should not accept a system package of liborigin in this situation. Ideally, a new 3.0.2 release of liborigin should be cut containing the changes needed by labplot, and cmake should reject anything older than this version. Alternatively, if liborigin is unmaintained upstream, support for using the system version should be completely removed.
Comment 3 Bug Janitor Service 2023-05-05 08:53:48 UTC
A possibly relevant merge request was started @ https://invent.kde.org/education/labplot/-/merge_requests/283
Comment 4 Bug Janitor Service 2023-05-05 09:00:38 UTC
A possibly relevant merge request was started @ https://invent.kde.org/education/labplot/-/merge_requests/284
Comment 5 Stefan Gerlach 2023-05-05 09:27:41 UTC
Git commit 25598768ba6b19221785c0daacb01a1680b70492 by Stefan Gerlach, on behalf of Antonio Rojas.
Committed on 05/05/2023 at 09:11.
Pushed by sgerlach into branch 'master'.

Use system liborigin headers if linking against system liborigin

Currently the liborigin includes are hardcoded to the bundled version even when linking against the system one.
This can cause crashes and other errors due to incompatibilities betweeen both versions.
No stable liborigin release is supported, but at least now one will get a build time error that makes it clear, instead of crashes at runtime.

M  +2    -0    src/CMakeLists.txt
M  +1    -1    src/backend/datasources/projects/OriginProjectParser.cpp
M  +1    -1    src/backend/datasources/projects/OriginProjectParser.h

https://invent.kde.org/education/labplot/commit/25598768ba6b19221785c0daacb01a1680b70492
Comment 6 Stefan Gerlach 2023-05-05 09:35:10 UTC
Git commit 398089889437cd8056084b924f672e9a730bc4f1 by Stefan Gerlach, on behalf of Antonio Rojas.
Committed on 05/05/2023 at 09:34.
Pushed by sgerlach into branch 'release/2.10'.

Use system liborigin headers if linking against system liborigin

Currently the liborigin includes are hardcoded to the bundled version even when linking against the system one.
This can cause crashes and other errors due to incompatibilities betweeen both versions.
No stable liborigin release is supported, but at least now one will get a build time error that makes it clear, instead of crashes at runtime.

M  +2    -0    src/CMakeLists.txt
M  +1    -1    src/backend/datasources/projects/OriginProjectParser.cpp
M  +1    -1    src/backend/datasources/projects/OriginProjectParser.h

https://invent.kde.org/education/labplot/commit/398089889437cd8056084b924f672e9a730bc4f1
Comment 7 Stefan Gerlach 2023-05-05 13:10:32 UTC
Git commit cfdbdc5c743b2cd35fa7a878fc6f922076638e90 by Stefan Gerlach, on behalf of Antonio Rojas.
Committed on 05/05/2023 at 11:34.
Pushed by sgerlach into branch 'master'.

Set minimum liborigin version to 3.0.2

It does not exist yet, but anything older is unsupported.

M  +1    -1    cmake/FindLibOrigin.cmake

https://invent.kde.org/education/labplot/commit/cfdbdc5c743b2cd35fa7a878fc6f922076638e90
Comment 8 Stefan Gerlach 2023-05-05 13:11:30 UTC
Git commit cdc8a759aa654f2e9ecc42b06cce4364afbca0e7 by Stefan Gerlach, on behalf of Antonio Rojas.
Committed on 05/05/2023 at 13:11.
Pushed by sgerlach into branch 'release/2.10'.

Set minimum liborigin version to 3.0.2

It does not exist yet, but anything older is unsupported.

M  +1    -1    cmake/FindLibOrigin.cmake

https://invent.kde.org/education/labplot/commit/cdc8a759aa654f2e9ecc42b06cce4364afbca0e7
Comment 9 Alexander Semke 2023-06-06 19:50:52 UTC
(In reply to acast2000 from comment #0)
> SUMMARY
> 
> The program drops a segmentation fault when trying to open an OriginLab file.
> 
> STEPS TO REPRODUCE
> 1. Open labplot2 from Terminal
> 2. Open the "Open" dialog from the menu, locate the file 
> 3. Click open
> 
> OBSERVED RESULT
> Segmentation fault

We'd like to reproduce this issue. Would it be possible for you to attach the file here that is triggering the crash on your side?