[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

./packages/libreoffice/3.3.0/experimental r2340: use errno to get the correct error message if mkstemp() fails (from master)



------------------------------------------------------------
revno: 2340
committer: Rene Engelhard <rene@debian.org>
branch nick: experimental
timestamp: Fri 2011-01-21 23:05:57 +0100
message:
  use errno to get the correct error message if mkstemp() fails (from master)
added:
  patches/bridges-mkstemp-error-better-message.diff
modified:
  changelog
  patches/series
=== modified file 'changelog'
--- a/changelog	2011-01-21 01:18:09 +0000
+++ b/changelog	2011-01-21 22:05:57 +0000
@@ -1,5 +1,8 @@
 libreoffice (1:3.3.0~rc4-2) UNRELEASED; urgency=low
 
+  * debian/patches/bridges-mkstemp-error-better-message.diff: make failure to
+    create temp file because /tmp vanished more clear; backported from master
+
   * debian/rules:
     - remove obsolete (commented-out) FIXME section as /usr/share for icons
       works again since longer. Fixes actual splitout of the images to the
@@ -7,7 +10,7 @@
     - really substitute ${PRODUCTNAME_BR} ${PRODUCTVERSION} in Name[pt_BR]
       (closes: #610345)
 
- -- Rene Engelhard <rene@debian.org>  Fri, 21 Jan 2011 02:08:24 +0100
+ -- Rene Engelhard <rene@debian.org>  Fri, 21 Jan 2011 22:21:24 +0100
 
 libreoffice (1:3.3.0~rc4-1) experimental; urgency=low
 

=== added file 'patches/bridges-mkstemp-error-better-message.diff'
--- a/patches/bridges-mkstemp-error-better-message.diff	1970-01-01 00:00:00 +0000
+++ b/patches/bridges-mkstemp-error-better-message.diff	2011-01-21 22:05:57 +0000
@@ -0,0 +1,137 @@
+--- /dev/null	2011-01-21 21:09:34.015318257 +0100
++++ libreoffice-3.3.0/libreoffice-build/patches/dev300/bridges-mkstemp-error-better-message.diff	2011-01-21 22:20:19.000000000 +0100
+@@ -0,0 +1,123 @@
++[...]
++10:26 <@_rene_> hmm, what is executable memory, and why does OOo need oit and what can cause e.g. https://buildd.debian.org/fetch.cgi?pkg=libreoffice;ver=1%3A3.3.0~rc4-1;arch=i386;stamp=1295578275?
++10:26 <@_rene_> seems like a transient error, had that on sparc and s390 already (with basically the same code - rc3-1 vs. rc3-2 for example)
++10:27 < rnagy> log sitll loading ...
++10:27 < rnagy> sparc is 64 bit on debian or do you call it sparc64?
++10:28 < rnagy> since it say No such file or directory
++10:28 < rnagy> i suspect it's an SHM issue
++10:28 <@_rene_> I *think* it's 64bit kernel, 32bit userland, not sure, didn't follow that closely. would need to look at a "file" :)
++10:30 <@_rene_> the above one is i386, though :)
++10:31 < rnagy> are you running selinix?
++10:31 < rnagy> Well basically mmap() happens with PROT_EXEC and that fials
++10:32  * _rene_ not, the buildd might, though I don't think it does
++10:32 < rnagy> but  ihave no idea why it returns ENOENT
++10:32 <@_rene_> especially since it's the same machine which built it fine before
++10:32 < rnagy> any recent changes in glibc or kernel?
++10:32 <@_rene_> same with the above s390 example for example. rc3-1 -> built, rc3-2 1 day later -> fail
++10:33 <@_rene_> (and then succeeding again.)
++10:33 <@_rene_> I don't believe they updated glibc/kernel :)
++10:34 < rnagy> well mmap() does not return ENOENT
++10:34 < rnagy> so something else is going in the way
++10:34 < rnagy> running on NFS maybe?
++10:35 < rnagy> oh wait found it
++10:37 -!- _KAMI_1 (purple) [~kami@host-50-018.comunique.hu] has joined #libreoffice
++10:37 < rnagy>         char *tmpfname = new char[aTmpName.getLength()+1];
++10:37 < rnagy>         strncpy(tmpfname, aTmpName.getStr(), aTmpName.getLength()+1);
++10:37 < rnagy>         if ((block.fd = mkstemp(tmpfname)) == -1)
++10:37 < rnagy> what a stupid error message
++10:38 < rnagy> are you running a parallel build?
++10:40 < rnagy> bridges/source/cpp_uno/shared/vtablefactory.cxx:273
++10:41 < rnagy> do you have a /tmp in your chroot? :)
++10:41 < rnagy> is it 777?
++10:42 -!- caemir [~caemir@unaffiliated/caemir] has quit [Read error: Operation timed out]
++10:42 -!- hbrinkm [~Adium@sd-socks.staroffice.de] has quit [Quit: Leaving.]
++10:43 -!- hbrinkm (Henning Brinkmann) [~Adium@sd-socks.staroffice.de] has joined #libreoffice
++10:43 -!- Decorian (Dominic Hosler) [~quassel@dyn005188.shef.ac.uk] has joined #libreoffice
++10:44 <@tml_> rnagy: stupid error message indeed, omg
++10:44 < rnagy> _rene_: that is the only way that it could fail
++10:44 < rnagy> _rene_: http://pastebin.com/6Ns8QAad
++10:45 < rnagy> (atharva robert 10533)$ ./a.out
++10:45 < rnagy> mkstemp(): No such file or directory
++10:45 < rnagy> somehow your /tmp is gone
++10:45 -!- davidlt [~davidlt@154-140.79-83.cust.bluewin.ch] has quit [Read error: Connection reset by peer]
++10:46 -!- kdo (Karim) [~karim@gw-puteaux.linagora.com] has joined #libreoffice
++10:49 < rnagy> tml_: since there is no errno there
++10:49 < rnagy> perror() is kinda stupid
++10:51 < rnagy> -            perror("creation of executable memory area failed");
++10:51 < rnagy> +            fprintf(stderr, "mkstemp(\"%s\") failed\n", tmpfname);
++10:51 < rnagy> ok?
++10:52 < rnagy> actually we should use errno
++10:53 -!- camille_m (camillem) [~camille_m@gw-puteaux.linagora.com] has joined #libreoffice
++10:55 -!- boser (boser) [~boser@p4FD143D3.dip.t-dialin.net] has joined #libreoffice
++10:55 <@tml_> both the file name being created and strerror(errno) (if errno is meaningful), please
++10:55 < rnagy> http://pastebin.com/ZAPLyTrW
++10:56 < rnagy> i'd love if someone would test that on windows, but there should be an errno.h there too
++10:56 <@tml_> that code isn't used on windows, obviously
++10:56 < rnagy> oh right
++10:56 < rnagy> then
++10:57 < eagles0513875> hey mmeeks :) found someone that i have teamed up with to work on the easy hack that i started :) not to mention he has a nice pearl script to check each module for white spaces etc
++10:57 < rnagy> tml_: http://pastebin.com/BtADGMiV
++10:57 < rnagy> a perl script cannot be nice :)
++10:57 -!- DanShearer (Dan Shearer) [~chatzilla@mailgate1.valleyt.co.uk] has joined #libreoffice
++10:58 -!- hussam [~hussam@unaffiliated/hussam] has quit [Quit: Leaving.]
++10:58 < eagles0513875> rnagy: well it checks whole modules at a time which is quite nice :) so that way we know what files we need to patch to get rid of extra white space
++10:58 < eagles0513875> in the filters module alone there are 101 files that have the issue with extra white spaces etc in them
++10:59 <@tml_> rnagy: go for it before somebody complains that the message isn't localized;)
++11:00 < rnagy> ahhhahaa
++11:00 < rnagy> whoever started to localize unix error messages should be shot
++11:01 < eagles0513875> go hunt them down upstream :p
++11:01 <@tml_> yeah, they should have been kept in the original Etruskian
++11:01 < boser> i have a problem with the datalink between formular an db. http://picpaste.com/db_weg-NVjEyZAk.png
++11:02 < rnagy> tml_: can you please cherry-pick the commit to all stable branches?
++11:02 < rnagy> i have to run see my doctor
++11:02 <@tml_> rnagy: I don't think it qualifies as a blocker for 3.3.0
++11:02 <@tml_> rnagy: and not sure for 3.3 either
++11:03 < rnagy> it's not a blocker but it's a nice to have safe thing
++11:03 <@tml_> sure; but we do have very strict rules for the 3.3.0 branch
++11:04 <@tml_> for 3.3, I guess, yes it could be cherry-picked
++11:04 < rnagy> sure that's fine by me
++11:04 -!- oiaohm [~oiaohm@unaffiliated/oiaohm] has quit [Remote host closed the connection]
++11:07 < CIA-80> LibreOffice (ure) robert * bridges/source/cpp_uno/shared/vtablefactory.cxx: use errno to get the correct error message if mkstemp() fails
++[...]
++13:28 < rnagy> _rene_: is your problem fixed?
++[...]
++13:29 <@_rene_> rnagy: no idea, will need to try and point the buildd maintainers to your comments
++13:29 <@_rene_> rnagy: this is debian buildd. I expect it just forkin fine here :)
++13:29 <@mmeeks> RQ: for some other <insert magic, wonder new idea> - that is fine - we will include it as/when there are patches :-)
++13:30 <@_rene_> s/forking/working/
++13:30 < RQ> mmeeks: i was talking about upload
++13:30 < rnagy> ah okay
++[...]
++13:57 <@_rene_> rnagy: thanks, the clearer error message will at least help, 
++                anyways, even if the underlying problem isn't fixed on the 
++                buildds
++
++From 9160dfc191d4b2496f55ccba663815c08db4ba1b Mon Sep 17 00:00:00 2001
++From: Robert Nagy <robert@openbsd.org>
++Date: Fri, 21 Jan 2011 10:03:11 +0000
++Subject: use errno to get the correct error message if mkstemp() fails
++
++---
++diff --git a/bridges/source/cpp_uno/shared/vtablefactory.cxx b/bridges/source/cpp_uno/shared/vtablefactory.cxx
++index bc933a7..777d0da 100644
++--- bridges/source/cpp_uno/shared/vtablefactory.cxx
+++++ bridges/source/cpp_uno/shared/vtablefactory.cxx
++@@ -57,6 +57,7 @@
++ #if defined SAL_UNX
++ #include <unistd.h>
++ #include <string.h>
+++#include <errno.h>
++ #include <sys/mman.h>
++ #elif defined SAL_W32
++ #define WIN32_LEAN_AND_MEAN
++@@ -270,7 +271,7 @@ bool VtableFactory::createBlock(Block &block, sal_Int32 slotCount) const
++         char *tmpfname = new char[aTmpName.getLength()+1];
++         strncpy(tmpfname, aTmpName.getStr(), aTmpName.getLength()+1);
++         if ((block.fd = mkstemp(tmpfname)) == -1)
++-            perror("creation of executable memory area failed");
+++            fprintf(stderr, "mkstemp(\"%s\") failed: %s\n", tmpfname, strerror(errno));
++         if (block.fd == -1)
++         {
++             delete[] tmpfname;
++--
++cgit v0.8.3-6-g21f6
+--- libreoffice-3.3.0/libreoffice-build/patches/dev300/apply-old	2011-01-21 22:23:35.000000000 +0100
++++ libreoffice-3.3.0/libreoffice-build/patches/dev300/apply	2011-01-21 22:24:03.000000000 +0100
+@@ -390,6 +390,8 @@
+ # make OOo work under SELinux
+ ooo80816.selinux.bridges.diff, i#80816
+ 
++[ Fixes ]
++bridges-mkstemp-error-better-message.diff
+ 
+ [ WebDAVUpstream ]
+ SectionOwner => jholesov

=== modified file 'patches/series'
--- a/patches/series	2011-01-18 20:58:27 +0000
+++ b/patches/series	2011-01-21 22:05:57 +0000
@@ -4,3 +4,4 @@
 hack-no-rm-fr-of-smoketest-userconfig.diff
 do-not-switch-workspaces-of-wm.diff
 fix-mesa-headers-check.diff
+bridges-mkstemp-error-better-message.diff


Reply to: