Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 170490 - media-libs/mesa-6.5.1-r1 (?) - Call to gluBuild2DMipmaps causes segmentation fault
Summary: media-libs/mesa-6.5.1-r1 (?) - Call to gluBuild2DMipmaps causes segmentation ...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: AMD64 Linux
: High normal
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-11 21:00 UTC by Brandon Mintern
Modified: 2009-05-07 06:33 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
the mentioned attachment: sample file which segfaults as described (segfault.c,1.10 KB, text/plain)
2007-03-11 21:02 UTC, Brandon Mintern
Details
minor fixes to attachment (segfault.c,1.07 KB, text/plain)
2007-03-11 21:12 UTC, Brandon Mintern
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Brandon Mintern 2007-03-11 21:00:48 UTC
When calling gluBuild2DMipmaps(...) with valid parameters, a function closestFit(...) is called which in turn calls __GI_____strtod_l_internal with a null first parameter, which leads to a segmentation fault.

Reproducible: Always

Steps to Reproduce:
1. Download and compile the attached file with "gcc -Wall -g -o segfault segfault.c -lglut"
2. Run "gdb segfault"
3. Type "run", observe segfault, type "backtrace" and note the null argument.

Actual Results:  
Segmentation fault

Expected Results:  
Allocate a new OpenGL texture

Here is an example backtrace:

#0  0x00002b3552a6e036 in *__GI_____strtod_l_internal (nptr=0x0, endptr=0x0, 
    group=<value optimized out>, loc=0x2b3552c6d560) at strtod_l.c:531
#1  0x00002b3552e5e4ea in closestFit (target=3553, width=256, height=256, 
    internalFormat=6407, format=6407, type=5121, newWidth=0x7fff582cf064, 
    newHeight=0x7fff582cf060)
    at /usr/include/gentoo-multilib/amd64/stdlib.h:330
#2  0x00002b3552e65c51 in gluBuild2DMipmaps (target=3553, internalFormat=6407, 
    width=256, height=256, format=6407, type=5121, data=0x2aaaaab2a010)
    at libutil/mipmap.c:4571
#3  0x0000000000400960 in main () at segfault.c:39

I know that this probably is not a Gentoo-specific problem, but I am not a veteran bug-reporter, so I am hoping that someone can give me more info or try to help me out if there is something I'm doing wrong.

I have an nvidia card with OpenGL support, and I am even able to run beryl as my window manager, so I am sure it is not a mis-configuration problem.  I am not running beryl while trying to run this program.

Here is my emerge info, although I don't believe it to be relevant:

Portage 2.1.2.2 (default-linux/amd64/2006.1/desktop, gcc-4.1.1, glibc-2.5-r0, 2.6.19-gentoo-r5 x86_64)
=================================================================
System uname: 2.6.19-gentoo-r5 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 3800+
Gentoo Base System release 1.12.9
Timestamp of tree: Sun, 11 Mar 2007 09:00:01 +0000
ccache version 2.4 [disabled]
dev-java/java-config: 1.3.7, 2.0.31
dev-lang/python:     2.4.3-r4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.4-r6
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.14
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r2
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-ggdb -march=k8 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c"
CXXFLAGS="-ggdb -march=k8 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks metadata-transfer parallel-fetch sandbox sfperms splitdebug strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
MAKEOPTS="-j6"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X aac alsa amd64 amr ansi arts avahi bash-completion berkdb bitmap-fonts cairo caps cddb cdr cli cracklib crypt dbus djvu dri dvd dvdr dvdread eds emacs emboss encode esd fam fftw firefox flac fortran gdbm gif gnome gpm gprof gstreamer gtk gtk2 hal iconv ipv6 isdnlog jpeg lcms ldap libg++ mad midi mikmod mozbranding mp3 mpeg ncurses new-login nls nptl nptlonly nsplugin nvidia offensive ogg opengl pam pcre pdf perl png ppds pppd pulseaudio quicktime readline reflection sdl server session sndfile spell spl ssl symlink tcpd theora tk truetype truetype-fonts type1-fonts unicode vorbis xanim xml xorg xv xvid xvmc zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="apm ark ati chips cirrus cyrix dummy fbdev glint i128 i810 mga neomagic nv rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga trident tseng v4l vesa vga via vmware voodoo"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Brandon Mintern 2007-03-11 21:02:53 UTC
Created attachment 113005 [details]
the mentioned attachment: sample file which segfaults as described

Use "-lglut" when compiling.
Comment 2 Brandon Mintern 2007-03-11 21:12:40 UTC
Created attachment 113010 [details]
minor fixes to attachment

There was a slight bug in my buffer generating code, but one which had no relevance to the reported bug.  I wanted to make sure to correct it before someone pointed it out.  The original attachment was thrown together somewhat quickly based on an actual program I was writing, and the code had some minor, insignificant errors.
Comment 3 Jakub Moc (RETIRED) gentoo-dev 2007-03-11 21:17:03 UTC
Uh, which ebuild and version is this about?
Comment 4 Brandon Mintern 2007-03-11 21:22:23 UTC
(In reply to comment #3)
> Uh, which ebuild and version is this about?
> 

Sorry.

media-libs/mesa-6.5.1-r1, I believe.  I think that's where the GLU functions are defined, because I was able to see the gdb info when I re-emerged mesa with splitdebug as one of my FEATURES.
Comment 5 Brandon Mintern 2007-03-12 06:18:38 UTC
I just found out something which is likely relevant to this bug. Apparently, there was a conflict of nvidia modules. I installed a new version, and although I thought I had loaded it in the kernel, I apparently had not. When I tried to use OpenGL to render to a glut window, I was notified of the error.

It could be possible that my video card returned some kind of OpenGL error to the closestFit(...) function.  Ideally, this function should check the return value before calling strtod(...) and exit with an appropriate error message, rather than segfaulting.
Comment 6 Rémi Cardona (RETIRED) gentoo-dev 2009-05-07 06:33:10 UTC
libGL and libGLU are provided by either mesa or nvidia-drivers. If you can still reproduce this bug, please don't hesitate to reopen this bug.

Closing as per comment #5

Thanks