Bug#1094197: libfolia: FTBFS almost everywhere: ../test-driver: line 112: 3579 Segmentation fault "$@" >> "$log_file" 2>&1

Johannes Schauer Marin Rodrigues josch at debian.org
Sun Jan 26 21:58:24 GMT 2025


Hi,

Quoting Chris Hofstaedtler (2025-01-26 22:38:31)
> > Don't know why it built on x86-conova-02 for i386.
> 
> Still unclear to me.
> 
> Might be a good idea to zero-initialize the "info" pointer.

I have no idea why I was in CC but I also got the segmentation fault on my
laptop (arm64) and this patch fixed it:

--- a/src/folia_utils.cxx
+++ b/src/folia_utils.cxx
@@ -688,7 +688,7 @@ namespace folia {
       \return a string with the hostname
     */
     string result = "unknown";
-    struct addrinfo hints, *info;
+    struct addrinfo hints, *info = NULL;
     int gai_result;
 
     char hostname[1024];
@@ -706,7 +706,8 @@ namespace folia {
     if ((gai_result = getaddrinfo(hostname, "http", &hints, &info)) != 0) {
       //      cerr << "getaddrinfo failed: " << gai_strerror(gai_result)
       //	   << ", using 'unknown' as hostname" << endl;
-      freeaddrinfo(info);
+      if (info != NULL)
+        freeaddrinfo(info);
       result = hostname;
       return result;
     }


Thanks!

cheers, josch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: signature
URL: <http://alioth-lists.debian.net/pipermail/debian-science-maintainers/attachments/20250126/3006f7a8/attachment.sig>


More information about the debian-science-maintainers mailing list