Artifacts Associated With Ticket ef23a85ac6bab7d4
Ticket change [f236c18c82] (rid 225211) by mookie on 2024-04-22 23:45:54:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
Hi Core, In attempt of using NaviServer with TCL9.0x -- a module for the server fails, log.c when compiling against TCL9. After reaching out to Gustaf, dev of NaviServer, a hot-patch has been created. His explanation: The issue is that Tcl_PanicProc is defined in Tcl9 with the attribute declaration TCL_NORETURN1, but it seems, this attribute definition has to be provided as well for the prototype. It would be certainly better, if this attribute definition would be part of the type declaration of Tcl_PanicProc in Tcl9. Not very long ago, the same code worked fine, so something has changed in Tcl9. The patch below addresses this issue, but this is not nice. Maybe, the tcl-core people have a suggestion, since this will effect as well other applications requiring the use of Tcl_SetPanicProc(). NaviServer Issue: https://sourceforge.net/p/naviserver/mailman/message/58763387/ Source to patched log.c: https://github.com/naviserver-project/naviserver/commit/c96c143ac2c7a88b99f8c32e7d140019fe5e7629 Many Thanks, David F
- foundin initialized to: "9.0b3"
- is_private initialized to: "0"
- login: "mookie"
- priority initialized to: "5 Medium"
- private_contact initialized to: "eb7513005aa11dbe2a07d8bff76f8af3c25f379b"
- resolution initialized to: "None"
- severity initialized to: "Important"
- status initialized to: "Open"
- submitter initialized to: "mookie"
- subsystem initialized to: "- New Builtin Object Types"
- title initialized to: "Tcl_PanicProc - Tcl9"
- type initialized to: "Bug"
Ticket change [62a89ea0a2] (rid 225212) by mookie on 2024-04-22 23:49:30:
- login: "mookie"
- mimetype: "text/plain"
- title changed to: "Tcl_PanicProc - Tcl9 & NaviServer"
Ticket change [908ff0dabf] (rid 225213) by mookie on 2024-04-22 23:51:10:
- login: "mookie"
- mimetype: "text/plain"
- subsystem changed to: "69. Other"
Ticket change [c9ad94563a] (rid 225214) by mookie on 2024-04-22 23:54:51:
- comment changed to:
Hi Core, In attempt of using NaviServer with TCL9.0x -- a module for the server fails, log.c when compiling against TCL9. After reaching out to Gustaf, dev of NaviServer, a hot-patch has been created. His explanation: The issue is that Tcl_PanicProc is defined in Tcl9 with the attribute declaration TCL_NORETURN1, but it seems, this attribute definition has to be provided as well for the prototype. It would be certainly better, if this attribute definition would be part of the type declaration of Tcl_PanicProc in Tcl9. Not very long ago, the same code worked fine, so something has changed in Tcl9. The patch below addresses this issue, but this is not nice. Maybe, the tcl-core people have a suggestion, since this will effect as well other applications requiring the use of Tcl_SetPanicProc(). Example Compilation error: cc -O2 -Wall -fPIC -pipe -finput-charset=UTF-8 -DNDEBUG -DSYSTEM_MALLOC -std=c99 -I../include -I"/usr/local/include" -DHAVE_CONFIG_H -c -o log.o log.c > log.c:262:22: error: incompatible function pointer types passing 'Tcl_PanicProc' (aka 'void (const char *, ...)') to parameter of type 'void (*)(const char *, ...) __attribute__((noreturn))' [-Wincompatible-function-pointer-types] Tcl_SetPanicProc(Panic); ^~~~~ /usr/local/include/tcl.h:2366:37: note: passing argument to parameter 'panicProc' here TCL_NORETURN1 Tcl_PanicProc *panicProc); NaviServer Issue: https://sourceforge.net/p/naviserver/mailman/message/58763387/ Source to patched log.c: https://github.com/naviserver-project/naviserver/commit/c96c143ac2c7a88b99f8c32e7d140019fe5e7629 Many Thanks, David F - login: "mookie"
- mimetype: "text/plain"
- comment changed to:
Ticket change [cb5086c98a] (rid 225215) by mookie on 2024-04-22 23:55:44:
- comment changed to:
Hi Core, In attempt of using NaviServer with TCL9.0x -- a module for the server fails, log.c when compiling against TCL9. After reaching out to Gustaf, dev of NaviServer, a hot-patch has been created. His explanation: The issue is that Tcl_PanicProc is defined in Tcl9 with the attribute declaration TCL_NORETURN1, but it seems, this attribute definition has to be provided as well for the prototype. It would be certainly better, if this attribute definition would be part of the type declaration of Tcl_PanicProc in Tcl9. Not very long ago, the same code worked fine, so something has changed in Tcl9. The patch below addresses this issue, but this is not nice. Maybe, the tcl-core people have a suggestion, since this will effect as well other applications requiring the use of Tcl_SetPanicProc(). Example Compilation error: > log.c:262:22: error: incompatible function pointer types passing 'Tcl_PanicProc' (aka 'void (const char *, ...)') to parameter of type 'void (*)(const char *, ...) __attribute__((noreturn))' [-Wincompatible-function-pointer-types] Tcl_SetPanicProc(Panic); ^~~~~ /usr/local/include/tcl.h:2366:37: note: passing argument to parameter 'panicProc' here TCL_NORETURN1 Tcl_PanicProc *panicProc); NaviServer Issue: https://sourceforge.net/p/naviserver/mailman/message/58763387/ Source to patched log.c: https://github.com/naviserver-project/naviserver/commit/c96c143ac2c7a88b99f8c32e7d140019fe5e7629 Many Thanks, David F - login: "mookie"
- mimetype: "text/plain"
- comment changed to:
Ticket change [f9e67f85fe] (rid 225216) by mookie on 2024-04-22 23:57:35:
- comment changed to:
Hi Core, In attempt of using NaviServer with TCL9.0x -- a module for the server fails, log.c when compiling against TCL9. OS: FreeBSD 14 TCL: 9.0b2/b3 NaviServer: 4.99 (pre-fix) After reaching out to Gustaf, dev of NaviServer, a hot-patch has been created. His explanation: The issue is that Tcl_PanicProc is defined in Tcl9 with the attribute declaration TCL_NORETURN1, but it seems, this attribute definition has to be provided as well for the prototype. It would be certainly better, if this attribute definition would be part of the type declaration of Tcl_PanicProc in Tcl9. Not very long ago, the same code worked fine, so something has changed in Tcl9. The patch below addresses this issue, but this is not nice. Maybe, the tcl-core people have a suggestion, since this will effect as well other applications requiring the use of Tcl_SetPanicProc(). Example Compilation error: > log.c:262:22: error: incompatible function pointer types passing 'Tcl_PanicProc' (aka 'void (const char *, ...)') to parameter of type 'void (*)(const char *, ...) __attribute__((noreturn))' [-Wincompatible-function-pointer-types] Tcl_SetPanicProc(Panic); ^~~~~ /usr/local/include/tcl.h:2366:37: note: passing argument to parameter 'panicProc' here TCL_NORETURN1 Tcl_PanicProc *panicProc); NaviServer Issue: https://sourceforge.net/p/naviserver/mailman/message/58763387/ Source to patched log.c: https://github.com/naviserver-project/naviserver/commit/c96c143ac2c7a88b99f8c32e7d140019fe5e7629 Many Thanks, David F - login: "mookie"
- mimetype: "text/plain"
- comment changed to:
Ticket change [33515be211] (rid 225217) by mookie on 2024-04-22 23:57:49:
- comment changed to:
Hi Core, In attempt of using NaviServer with TCL9.0x -- a module for the server fails, log.c when compiling against TCL9. OS: FreeBSD 14 TCL: 9.0b2/b3 NaviServer: 4.99 (pre-fix) After reaching out to Gustaf, dev of NaviServer, a hot-patch has been created. His explanation: The issue is that Tcl_PanicProc is defined in Tcl9 with the attribute declaration TCL_NORETURN1, but it seems, this attribute definition has to be provided as well for the prototype. It would be certainly better, if this attribute definition would be part of the type declaration of Tcl_PanicProc in Tcl9. Not very long ago, the same code worked fine, so something has changed in Tcl9. The patch below addresses this issue, but this is not nice. Maybe, the tcl-core people have a suggestion, since this will effect as well other applications requiring the use of Tcl_SetPanicProc(). Compilation error: > log.c:262:22: error: incompatible function pointer types passing 'Tcl_PanicProc' (aka 'void (const char *, ...)') to parameter of type 'void (*)(const char *, ...) __attribute__((noreturn))' [-Wincompatible-function-pointer-types] Tcl_SetPanicProc(Panic); ^~~~~ /usr/local/include/tcl.h:2366:37: note: passing argument to parameter 'panicProc' here TCL_NORETURN1 Tcl_PanicProc *panicProc); NaviServer Issue: https://sourceforge.net/p/naviserver/mailman/message/58763387/ Source to patched log.c: https://github.com/naviserver-project/naviserver/commit/c96c143ac2c7a88b99f8c32e7d140019fe5e7629 Many Thanks, David F - login: "mookie"
- mimetype: "text/plain"
- comment changed to:
Ticket change [70243e3a36] (rid 225218) by mookie on 2024-04-23 00:51:55:
- comment changed to:
Hi Core, In attempt of using NaviServer with TCL9.0x -- a module for the server fails, log.c when compiling against TCL9. OS: FreeBSD 14 TCL: 9.0b1/b2 NaviServer: 4.99 (pre-fix) After reaching out to Gustaf, dev of NaviServer, a hot-patch has been created. His explanation: The issue is that Tcl_PanicProc is defined in Tcl9 with the attribute declaration TCL_NORETURN1, but it seems, this attribute definition has to be provided as well for the prototype. It would be certainly better, if this attribute definition would be part of the type declaration of Tcl_PanicProc in Tcl9. Not very long ago, the same code worked fine, so something has changed in Tcl9. The patch below addresses this issue, but this is not nice. Maybe, the tcl-core people have a suggestion, since this will effect as well other applications requiring the use of Tcl_SetPanicProc(). Compilation error: > log.c:262:22: error: incompatible function pointer types passing 'Tcl_PanicProc' (aka 'void (const char *, ...)') to parameter of type 'void (*)(const char *, ...) __attribute__((noreturn))' [-Wincompatible-function-pointer-types] Tcl_SetPanicProc(Panic); ^~~~~ /usr/local/include/tcl.h:2366:37: note: passing argument to parameter 'panicProc' here TCL_NORETURN1 Tcl_PanicProc *panicProc); NaviServer Issue: https://sourceforge.net/p/naviserver/mailman/message/58763387/ Source to patched log.c: https://github.com/naviserver-project/naviserver/commit/c96c143ac2c7a88b99f8c32e7d140019fe5e7629 Many Thanks, David F - login: "mookie"
- mimetype: "text/plain"
- comment changed to:
Ticket change [b6640ff60a] (rid 225282) by jan.nijtmans on 2024-04-23 20:24:02:
- assignee changed to: "jan.nijtmans"
- login: "jan.nijtmans"
- mimetype: "text/plain"
Ticket change [9d3f9dc65e] (rid 225285) by gustafn3 on 2024-04-24 09:03:14:
- icomment:
The version in branch bug-ef23a85ac6 fixes the issue. Putting the declaration into the type is the right thing.
- login: "gustafn3"
- mimetype: "text/plain"
- icomment:
Ticket change [9316f64fde] (rid 225334) by jan.nijtmans on 2024-04-25 15:10:46:
- icomment:
Should be fixed [b95cc2b450d1f6dd|here] > The version in branch bug-ef23a85ac6 fixes the issue. Unfortunately, the earlier fix caused warnings on Linux: <pre> /home/runner/work/tcl/tcl/generic/tcl.h:600:1: warning: ‘noreturn’ attribute ignored [-Wattributes] 600 | typedef TCL_NORETURN1 void (Tcl_PanicProc) (const char *format, ...); | ^~~~~~~ </pre> which can be seen in the GITHUB build: [https://github.com/tcltk/tcl/actions/runs/8812574046/job/24188518470] The best solution, it turns out, is no longer use the `TCL_NORETURN1` option when setting/getting exitproc/panicproc functions, but let `Tcl_Panic()` handle all of this. If the user provides a `TCL_NORETURN` function as panicproc, that's fine. If the user doesn't do that, but provides a function which returns, then `Tcl_Panic()` will handle the last part of exiting. This way, I think, solves the NaviServer warning, and it handles everything I can think of. Thanks for the report! - login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [99e16dda91] (rid 225335) by gustafn3 on 2024-04-25 17:21:01:
- icomment:
I tested with the new version. Everything is still fine. Btw, the original issue was a compiler error, not a warning. Maybe, raising and error instead of a warning depends on the used compiler and version. I am still wondering why nobody else noted this. Everyone calling Tcl_SetPanicProc() was effected by this issue.
- login: "gustafn3"
- mimetype: "text/plain"
- icomment:
Ticket change [b6e6a88a62] (rid 225338) by jan.nijtmans on 2024-04-25 19:07:08:
- closedate changed to: "2460426.29662435"
- closer changed to: "jan.nijtmans"
- foundin changed to: "9.0b2"
- icomment: "Thanks for confirming that it works! Closing."
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Fixed"
- status changed to: "Closed"