Comments (23)
No worries regarding the 1.1.0, it's just a variable that I forgot to change when I released the version, I've noticed it myself few minutes ago and changed it. See commit 8ce4b01
You can download from master and the install procedure again and it will be 1.2.0.
Regarding your crash, does it start only with gdb or also without gdb now?
from ksnip.
hmm, let's try something. Open up src/widgets/PaintArea.cpp
, go to line 310 and comment following out (just add // in front of the line):
void PaintArea::setCursor()
{
// delete mCursor; <-- Like here
mCursor = cursor();
for ( int i = 0; i < views().length(); i++ ) {
views().at( i )->setCursor( *mCursor );
}
}
Save, delete all from build directory and run cmake and make again. Try to run ./ksnip again, see what happens.
from ksnip.
Great! Thanks to you for developing such a great tool!
from ksnip.
What distro are you using?
from ksnip.
Slackware-current, 64-bit series.
gcc 5.4.0
from ksnip.
Attaching strace output (both stdin & stderr) of ksnip 1.2.0 invocation.
from ksnip.
I've just installed slackware 14.2 64bit in a virtual machine and ksnip was installed and started right away, without installing or changing anything else. So it seems for now not related to slackware rather something related to your system.
http://i.imgur.com/svYoS5Y.png
Can you try to run the ksnip in gdb, maybe we can see something there.
go back to the build directory and now run cmake but instead of cmake ..
use cmake -DCMAKE_BUILD_TYPE=Debug ..
Then continue with make
and gdb ./knsip
You should see the gdb prompt, type run
and watch the output. If you get the prompt again without crash type next
and hit enter, keep doing that until the crash happens or ksnip starts. Send me the output that you collect from there.
from ksnip.
I've just installed slackware 14.2 64bit in a virtual machine
Please be advised that Slackware 14.2 and Slackware-current differ significantly as of now (the latter has more up-to-date libraries and toolchain, etc.)
Will do what you suggest. Thanks!
from ksnip.
it's funny. I did what you said and now it runs correctly. Output:
(gdb) run
Starting program: /run/media/eduardo/Seagate Backup Plus Drive/build/slackbuilds/ksnip/ksnip-1.2.0/build/ksnip
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
ksnip run correctly. However it still identifies itself as 1.1.0.
from ksnip.
I found the issue!
I usually build ksnip as a Slackware package and for that we use bash scripts we call "SlackBuilds".
This particular SlackBuild was adapted from other software. There was a line where, if the CPU architecture was x86_64, it gave gcc as compiler flags the following; -O2 -fPIC
.
Since there wasn't any such flags when compiling ksnip "by hand", I tried building with the -fPIC
flag deleted. And it built without problem!
Ksnip now works correctly with the SlackBuild after deleting -fPIC
from the compiler flags
The fact, however, remains: the -fPIC
flag produced correct builds in 1.1.0 while in 1.2.0 gave segfaulting binaries.
For now, I deleted the -fPIC
flag from my SlackBuild and Ksnip run correctly again. Thanks!!
from ksnip.
Updated bug title to better reflect the crash case.
from ksnip.
It really is strange, but I'm glad that you found the issue.
I'll check later regarding the -fPIC flag.
from ksnip.
I just built a SlackBuild with -fPIC enabled and with the debug flag. I then ran gdb on the ksnip executable (which promptly segfaulted). This is the relevant gdb output:
(gdb) run
Starting program: /bin/ksnip
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff6df0000 in QCursor::~QCursor() () from /usr/lib64/libQtGui.so.4
(gdb)
Thanks!
from ksnip.
I'm not familiar with the -fPIC flag but it looks like it should be used with shared libraries to make them more independent of where they're executed. So not sure if you should be using this flag in first place.
I'm also unable to reproduce the issue on my end. I have added set(CMAKE_POSITION_INDEPENDENT_CODE ON)
to the CMakeLists.txt this is the equivalent of -fPIC, it compiles and runs without crash.
from ksnip.
Same on Slackware, no crash with PIC. Though I haven't tested it on -current which is a pre-release version for testing purposes.
from ksnip.
One more think we could check. Run gdb again, but when it crashes, run from the gdb prompt bt
Maybe the backtrace will show something.
from ksnip.
ok. First I forgot to give "next" when gdb showed a segfault. This is the full output:
(gdb) run
Starting program: /bin/ksnip
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff6df0000 in QCursor::~QCursor() () from /usr/lib64/libQtGui.so.4
(gdb) next
Single stepping until exit from function _ZN7QCursorD2Ev,
which has no line number information.
Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
(gdb)
from ksnip.
Backtrace:
(gdb) run
Starting program: /bin/ksnip
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff6df0000 in QCursor::~QCursor() () from /usr/lib64/libQtGui.so.4
(gdb) bt
#0 0x00007ffff6df0000 in QCursor::~QCursor() () at /usr/lib64/libQtGui.so.4
#1 0x000000000042a980 in PaintArea::setCursor() ()
#2 0x000000000042c10a in MainWindow::loadSettings() ()
#3 0x000000000042e966 in MainWindow::MainWindow() ()
#4 0x000000000041a15c in main ()
(gdb)
from ksnip.
After commenting out line 310 in PaintArea.cpp, Ksnip builds and run correctly even with the -fPIC flag enabled.
Thanks!!
from ksnip.
Interesting, so we know where the issue happens though I can't leave it like that, that would cause a memory leak.
I'll think about some solution then I will ask you again to test when I have a patch.
from ksnip.
Can you please download the latest version and try to build and run it?
https://github.com/DamirPorobic/ksnip/tree/v1.2.1
from ksnip.
I can confirm that 1.2.1 now builds and run correctly in x86_64 even with -O2 -fPIC enabled. Great!!
from ksnip.
Awesome! Thanks for testing and confirming. :)
from ksnip.
Related Issues (20)
- Transparency in selection does not work HOT 1
- Feature request: add option to remember last image effect HOT 1
- Add an ability to move the cursor by keyboard to precise the screenshot area
- Imgur automatic upload on screen capture not working HOT 1
- Can't set action hotkey to Crtl + Shift + number HOT 1
- Add option to output image to stdout
- KSnip minimizes to tray when New is clicked
- Allow to select the color for the "Border" image effect.
- Possibility to copy annotation to another screenshot
- Select and copy text from an annotation into the OS clipboard
- Minimum width window dimension too large - window does not fit on the screen/display
- Option to make "Save as" the default (instead of "Save")
- Connect to Imgur - after "get token" nothing happens.
- AppImage version doesn't launch when using KDE PLasma + Wayland
- Using the Rectangle Tool, Circle tool, Draw Tool, Number and Arrow outside of the canvas crops the shadow and line of pixels of the shape.
- I couldn't find the `Pin screenshots in frameless windows that stay atop other windows.` feature mentioned in the readme HOT 2
- Invalid reply from DBus: Screenshot is not allowed HOT 4
- rectangular area is displaced vertically on mac HOT 1
- UI is not showing any text or menu only icons visible HOT 1
- Animated GIF generation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ksnip.