Git Product home page Git Product logo

Comments (11)

andreygursky avatar andreygursky commented on September 28, 2024 1

No right click crash on Debian (testing) with feh 3.10-1 and imlib2 1.11.1-2.

from feh.

NoSuck avatar NoSuck commented on September 28, 2024

I also encounter this issue (on Fedora 38 ala #703).

$ LC_ALL=C feh .
*** buffer overflow detected ***: terminated
中止 (コアダンプ)

It is not purely a “right-click” issue, however. It seems to be a toggle_menu issue and—as above—a startup issue.

“コアダンプ” above means “core dump”.

from feh.

KoshulaDora avatar KoshulaDora commented on September 28, 2024

I can confirm the issue can be easily replicated by installing feh on a fresh fedora 38 install. Did anyone manage to find a fix yet?

from feh.

CharlzKlug avatar CharlzKlug commented on September 28, 2024
[nix-shell:~/Projects/feh]$ /home/charlzk/local/bin/feh --version
feh version 3.10-3-g7751353-dirty
Compile-time switches: curl verscmp xinerama 

Right click crash confirmed in NixOS:

[nix-shell:~/Projects/feh]$ nix-info -m
 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.52, NixOS, 23.11 (Tapir), 23.11.20230911.3a2786e`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.17.0`
 - channels(root): `"home-manager, nixos"`
 - channels(charlzk): `""`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

from feh.

CharlzKlug avatar CharlzKlug commented on September 28, 2024

I have tried to build from source on Ubuntu 20.04.6 LTS, and right-click works fine.

from feh.

CharlzKlug avatar CharlzKlug commented on September 28, 2024

I have debugged a little:

1238			feh_menu_show_at_xy(menu_main, winwid, x, y);
(gdb) n
*** buffer overflow detected ***: terminated

Program received signal SIGABRT, Aborted.
0x00007ffff7ad2a8c in __pthread_kill_implementation () from /nix/store/9la894yvmmksqlapd4v16wvxpaw3rg70-glibc-2.37-8/lib/libc.so.6

Something goes wrong at 1238 in winwidget.c.

from feh.

CharlzKlug avatar CharlzKlug commented on September 28, 2024

Something goes wrong in the imlib_image_fill_polygon(poly);

Breakpoint 9, feh_menu_draw_submenu_at (x=70, y=4, dst=<optimized out>, ox=<optimized out>, 
    oy=<optimized out>) at menu.c:840
840		imlib_image_fill_polygon(poly);
(gdb) p poly
$8 = (ImlibPolygon) 0x478080
(gdb) p *poly
Attempt to dereference a generic pointer.
(gdb) s
*** buffer overflow detected ***: terminated

Program received signal SIGABRT, Aborted.
0x00007ffff7ad2a8c in __pthread_kill_implementation ()
   from /nix/store/9la894yvmmksqlapd4v16wvxpaw3rg70-glibc-2.37-8/lib/libc.so.6

from feh.

CharlzKlug avatar CharlzKlug commented on September 28, 2024

Workaround, which helps me: edit function feh_menu_draw_submenu_at in the file menu.c like:

void feh_menu_draw_submenu_at(int x, int y, Imlib_Image dst, int ox, int oy)
{
	x -= ox;
	y -= oy;
	imlib_context_set_image(dst);
	imlib_context_set_color(0, 0, 0, 255);
	imlib_image_draw_line(x, y+3, x+3, y+6, 0);
	imlib_image_draw_line(x+3, y+6, x, y+9, 0);
	imlib_image_draw_line(x, y+9, x, y+3, 0);
	return;
}

from feh.

CharlzKlug avatar CharlzKlug commented on September 28, 2024

A little bit improved code, that draw filled triangle:

void feh_menu_draw_submenu_at(int x, int y, Imlib_Image dst, int ox, int oy)
{
        // Draw filled triangle
        x -= ox;
	y -= oy;

	imlib_context_set_image(dst);
	imlib_context_set_color(0, 0, 0, 255);

	for (int i= 0; i <= 3; i++) {
	  imlib_image_draw_line(x+i, y+3+i, x+i, y+9-i, 0);
	}
	  
	return;
}

from feh.

derf avatar derf commented on September 28, 2024

Patch from #723 has been merged, so I'll consider this to be fixed. Thanks for pointing it out and for the PR!

from feh.

CharlzKlug avatar CharlzKlug commented on September 28, 2024

You are welcome!

from feh.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.