Bug #2580
openepghttp-Abstürze
0%
Description
Hallo,
ich bekomme im Log immer epghttp-Abstürze und Neustarts. Im Browser ist davon nichts zu merken.
Im Log sieht das dann immer so aus:
Apr 25 12:39:31 SERVER epghttpd808: Not a JPEG file: starts with 0x89 0x50
Apr 25 12:39:31 SERVER systemd1: epghttpd.service: Main process exited, code=exited, status=1/FAILURE
Apr 25 12:39:31 SERVER systemd1: epghttpd.service: Failed with result 'exit-code'.
Apr 25 12:39:31 SERVER systemd1: epghttpd.service: Service hold-off time over, scheduling restart.
Apr 25 12:39:31 SERVER systemd1: epghttpd.service: Scheduled restart job, restart counter is at 1.
Apr 25 12:39:31 SERVER systemd1: Stopped epghttpd provides a webinterface for epg data.
Apr 25 12:39:31 SERVER systemd1: Starting epghttpd provides a webinterface for epg data...
Updated by horchi almost 5 years ago
- Status changed from New to Feedback
Konnte es nicht nicht Reproduzieren.
Kannst du den Backtrace dazu (am besten von der aktuellsten epgd/epghttpd Version) posten?
Updated by NemoN about 4 years ago
horchi wrote:
Konnte es nicht nicht Reproduzieren.
Kannst du den Backtrace dazu (am besten von der aktuellsten epgd/epghttpd Version) posten?
ich habe nicht direkt ein backtrace, aber mehr informationen dazu:
# dpkg -l | grep epgd ii epgd 1.1.163-0yavdr0~bionic amd64 a EPG daemon which fetch the EPG data ii epghttpd 1.1.163-0yavdr0~bionic amd64 Webinterface for epgd ii mariadb-plugin-epglv 1.1.163-0yavdr0~bionic amd64 mariadb plugin epglv (used by epgd) # epghttpd -n -l 3 -t [...] 14:05:43,953 Cache info: cacheExpire = 01.01.1970 01:00:00; cacheTag = ; cacheControl = 14:05:43,953 <- /data/eventimg with [no:0;maxW:100;maxH:70;id:950547;] (expire at 01.01.1970 01:00:00) 14:05:43,953 data: 08.10.2020 14:05:43; expire: 01.01.1970 01:00:00 14:05:43,953 lookup image for (950547/0) 14:05:43,954 found event for useid 950547 -> eventid is 110731073679727895 14:05:43,954 file: 22.09.2020 02:57:14; expire: 01.01.1970 01:00:00 14:05:43,954 found image with 243 bytes Not a JPEG file: starts with 0x3c 0x3f # locate 950547 /var/cache/vdr/epgimages/950547_0.jpg # file /var/cache/vdr/epgimages/950547_0.jpg /var/cache/vdr/epgimages/950547_0.jpg: symbolic link to ./images/5f68893181896530495b9e28.jpg # file /var/cache/vdr/epgimages/images/5f68893181896530495b9e28.jpg /var/cache/vdr/epgimages/images/5f68893181896530495b9e28.jpg: XML 1.0 document, ASCII text # more /var/cache/vdr/epgimages/images/5f68893181896530495b9e28.jpg <?xml version="1.0" encoding="UTF-8"?> <Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>ED6D7371CBBC848F</RequestId><HostId>bq9e0AAuBdTmVHD4Y/fYnOZZrI3zgpQvapP7DX+cetTrbqFx6hQf08hYxm5KPDbUrCWfIanaMbU=</HostId></Error>
epghttpd crashed wenn er ein JPG erwartet, aber ein anderes Format (in dem Fall ein Error-XML) bekommt
Updated by NemoN about 4 years ago
Anbei ein Patch welcher das Crash von epghttpd verhindert wenn irgendwas mit dem EventImage nicht stimmt (falsches Format etc)
diff --git a/lib/imgtools.c b/lib/imgtools.c index 63007e5..f166dec 100644 --- a/lib/imgtools.c +++ b/lib/imgtools.c @@ -7,6 +7,25 @@ #include "imgtools.h" +//*************************************************************************** +// Here's the routine that will replace the standard error_exit method: +//*************************************************************************** +#include <setjmp.h> + +struct my_error_mgr { + struct jpeg_error_mgr pub; // public" fields + jmp_buf setjmp_buffer; // for return to caller +}; +typedef struct my_error_mgr * my_error_ptr; + +METHODDEF(void) +my_error_exit (j_common_ptr cinfo) +{ + my_error_ptr myerr = (my_error_ptr) cinfo->err; + (*cinfo->err->output_message) (cinfo); + longjmp(myerr->setjmp_buffer, 1); +} + //*************************************************************************** // Image converting stuff //*************************************************************************** @@ -14,13 +33,18 @@ int fromJpeg(Imlib_Image& image, unsigned char* buffer, int size) { struct jpeg_decompress_struct cinfo; - struct jpeg_error_mgr jerr; + struct my_error_mgr jerr; int w, h; DATA8 *ptr, *line[16], *data; DATA32 *ptr2, *dest; int x, y; - cinfo.err = jpeg_std_error(&jerr); + cinfo.err = jpeg_std_error(&jerr.pub); + jerr.pub.error_exit = my_error_exit; + if (setjmp(jerr.setjmp_buffer)) { + jpeg_destroy_decompress(&cinfo); + return 0; + } jpeg_create_decompress(&cinfo); jpeg_mem_src(&cinfo, buffer, size); @@ -76,7 +100,7 @@ int fromJpeg(Imlib_Image& image, unsigned char* buffer, int size) long toJpeg(Imlib_Image image, MemoryStruct* data, int quality) { struct jpeg_compress_struct cinfo; - struct jpeg_error_mgr jerr; + struct my_error_mgr jerr; DATA32* ptr; DATA8* buf; @@ -84,7 +108,12 @@ long toJpeg(Imlib_Image image, MemoryStruct* data, int quality) data->clear(); - cinfo.err = jpeg_std_error(&jerr); + cinfo.err = jpeg_std_error(&jerr.pub); + jerr.pub.error_exit = my_error_exit; + if (setjmp(jerr.setjmp_buffer)) { + jpeg_destroy_compress(&cinfo); + return 0; + } jpeg_create_compress(&cinfo); jpeg_mem_dest(&cinfo, (unsigned char**)(&data->memory), &data->size);
Updated by horchi about 4 years ago
- Status changed from Feedback to Resolved
Danke für das Patch, habe es gerade übernommen. Bei mir ist das immer noch nicht passiert, vermute es sind die Daten eines Senders den ich nicht habe. Patch ist übernommen, committe ich nachher wenn er einen Download Runde überstanden hat.
Grüße Jörg