Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

floating point exception on (*vips.ImageRef).Label #420

Open
cg10036 opened this issue Apr 11, 2024 · 1 comment
Open

floating point exception on (*vips.ImageRef).Label #420

cg10036 opened this issue Apr 11, 2024 · 1 comment

Comments

@cg10036
Copy link

cg10036 commented Apr 11, 2024

After running that code, the program exits with a floating point exception in about a minute.

package main

import (
	"github.com/davidbyttow/govips/v2/vips"
)

func main() {
	vips.Startup(&vips.Config{
		MaxCacheFiles: 0,
		MaxCacheMem:   0,
		MaxCacheSize:  0,
	})
	defer vips.Shutdown()

	for {
		size := 30

		img, err := vips.Black(size, size)
		if err != nil {
			panic(err)
		}

		if err := img.Label(&vips.LabelParams{
			Text:      "7",
			Font:      "Sans",
			Width:     vips.Scalar{Value: float64(size)},
			Height:    vips.Scalar{Value: float64(size)},
			OffsetX:   vips.Scalar{Value: 0},
			OffsetY:   vips.Scalar{Value: 0},
			Color:     vips.Color{R: 255, G: 255, B: 255},
			Opacity:   1,
			Alignment: vips.AlignCenter,
		}); err != nil {
			panic(err)
		}
	}
}
2024/04/11 08:17:09 [VIPS.info] found /usr/lib/x86_64-linux-gnu/vips-modules-8.14
2024/04/11 08:17:09 [VIPS.info] using configure-time prefix
2024/04/11 08:17:09 [VIPS.info] VIPS_PREFIX = /usr
2024/04/11 08:17:09 [VIPS.info] VIPS_LIBDIR = /usr/lib/x86_64-linux-gnu
2024/04/11 08:17:09 [VIPS.info] prefix = /usr
2024/04/11 08:17:09 [VIPS.info] libdir = /usr/lib/x86_64-linux-gnu
2024/04/11 08:17:09 [VIPS.info] searching "/usr/lib/x86_64-linux-gnu/vips-modules-8.14"
2024/04/11 08:17:09 [VIPS.info] loading "/usr/lib/x86_64-linux-gnu/vips-modules-8.14/vips-magick.so"
2024/04/11 08:17:09 [VIPS.info] loading "/usr/lib/x86_64-linux-gnu/vips-modules-8.14/vips-jxl.so"
2024/04/11 08:17:09 [VIPS.info] loading "/usr/lib/x86_64-linux-gnu/vips-modules-8.14/vips-heif.so"
2024/04/11 08:17:09 [VIPS.info] loading "/usr/lib/x86_64-linux-gnu/vips-modules-8.14/vips-poppler.so"
2024/04/11 08:17:09 [VIPS.info] loading "/usr/lib/x86_64-linux-gnu/vips-modules-8.14/vips-openslide.so"
2024/04/11 08:17:09 [VIPS.info] searching "/usr/lib/x86_64-linux-gnu/vips-plugins-8.14"
2024/04/11 08:17:09 [govips.info] vips 8.14.1 started with concurrency=8 cache_max_files=0 cache_max_mem=0 cache_max=0
2024/04/11 08:17:09 [govips.info] registered image type loader type=jp2k
2024/04/11 08:17:09 [govips.info] registered image type loader type=gif
2024/04/11 08:17:09 [govips.info] registered image type loader type=png
2024/04/11 08:17:09 [govips.info] registered image type loader type=svg
2024/04/11 08:17:09 [govips.info] registered image type loader type=webp
2024/04/11 08:17:09 [govips.info] registered image type loader type=heif
2024/04/11 08:17:09 [govips.info] registered image type loader type=heif
2024/04/11 08:17:09 [govips.info] registered image type loader type=jxl
2024/04/11 08:17:09 [govips.info] registered image type loader type=jpeg
2024/04/11 08:17:09 [govips.info] registered image type loader type=magick
2024/04/11 08:17:09 [govips.info] registered image type loader type=pdf
2024/04/11 08:17:09 [govips.info] registered image type loader type=tiff
signal: floating point exception (core dumped)
(gdb) bt
#0  runtime.raise () at /usr/local/go/src/runtime/sys_linux_amd64.s:154
#1  0x00000000004516db in runtime.raisebadsignal (sig=8, c=0x7f7466e9ef50) at /usr/local/go/src/runtime/signal_unix.go:987
#2  0x0000000000451a47 in runtime.badsignal (sig=8, c=0x7f7466e9ef50) at /usr/local/go/src/runtime/signal_unix.go:1096
#3  0x0000000000450388 in runtime.sigtrampgo (sig=8, info=0x7f7466e9f0f0, ctx=0x7f7466e9efc0) at /usr/local/go/src/runtime/signal_unix.go:468
#4  0x000000000046c746 in runtime.sigtramp () at /usr/local/go/src/runtime/sys_linux_amd64.s:352
#5  0x00007f74ccb23050 in <signal handler called> () at /lib/x86_64-linux-gnu/libc.so.6
#6  0x00007f74ccd09697 in g_hash_table_lookup () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#7  0x00007f74cc84311d in  () at /lib/x86_64-linux-gnu/libpangoft2-1.0.so.0
#8  0x00007f74ccce855d in g_atomic_rc_box_release_full () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#9  0x00007f74cc842ea7 in  () at /lib/x86_64-linux-gnu/libpangoft2-1.0.so.0
#10 0x00007f74cc842f37 in  () at /lib/x86_64-linux-gnu/libpangoft2-1.0.so.0
#11 0x00007f74ccd46cfd in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#12 0x00007f74ccb70134 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#13 0x00007f74ccbf07dc in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
@ViperG
Copy link

ViperG commented Oct 11, 2024

I believe I also have the same issue, however in our case it's an AWS go lambda that randomly gets the error on images that have a label added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants